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
13 changes: 10 additions & 3 deletions mindee/v2/search/models/model_search_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@

@dataclass(kw_only=True)
class ModelSearchParameters(BaseSearchParameters[ModelSearchResponse]):
"""Search parameters 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.
Comment thread
ianardee marked this conversation as resolved.
"""

name: str | None = None
"""Case-insensitive search term for the model name."""
"""Filter models by partial name match, case-insensitive."""

model_type: str | None = None
"""Case-insensitive search term for the model type."""
"""Filter by an exact model type."""

_slug: ClassVar[str] = "models"
_response_class: type[ModelSearchResponse] = ModelSearchResponse
Expand Down
4 changes: 4 additions & 0 deletions tests/v2/search/test_model_search_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ def test_must_have_results(v2_client: Client):

assert response is not None
assert len(response.models) > 0
for model in response.models:
assert model.id
assert model.name
assert model.model_type
assert response.pagination is not None
assert response.pagination.total_items >= 1
assert response.pagination.page == 1
Expand Down