Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/v2/search/models/modelSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import { BaseSearch } from "@/v2/search/baseSearch.js";
import { ModelSearchResponse } from "@/v2/search/models/modelSearchResponse.js";

/**
* Search for models.
* Search for models within the organization linked to the API key.
*
* All search filters are optional.
* If no search filters are given, all models belonging to the organization are returned.
*
* Results are paginated.
*/
export class ModelSearch extends BaseSearch {
/** @inheritDoc */
Expand Down
4 changes: 2 additions & 2 deletions src/v2/search/models/modelSearchParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ export interface ModelSearchParametersConstructor extends BaseSearchParametersCo
*/
export class ModelSearchParameters extends BaseSearchParameters {
/**
* Case-insensitive search term for the model name
* Filter models by partial name match, case-insensitive.
*/
name?: string;

/**
* Case-insensitive search term for the model type
* Filter by an exact model type.
*/
modelType?: string;

Expand Down
5 changes: 5 additions & 0 deletions tests/v2/search/modelSearch.integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ describe("MindeeV2 - Integration - Model Search", { timeout: 120000 }, () => {
const response: ModelSearchResponse = await client.search(ModelSearch, {});
assert.ok(response);
assert.ok(response.models.length > 0);
for (const model of response.models) {
assert.ok(model.id);
assert.ok(model.name);
assert.ok(model.modelType);
}
assert.ok(response.pagination);
assert.ok(response.pagination.totalItems >= 1);
assert.equal(response.pagination.page, 1);
Expand Down