Skip to content

Commit bef84fc

Browse files
authored
📝 better docs for model search (#459)
1 parent f55a0e7 commit bef84fc

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

‎mindee/v2/search/models/model_search_parameters.py‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,20 @@
77

88
@dataclass(kw_only=True)
99
class ModelSearchParameters(BaseSearchParameters[ModelSearchResponse]):
10-
"""Search parameters for models."""
10+
"""
11+
Search for models within the organization linked to the API key.
12+
13+
All search filters are optional.
14+
If no search filters are given, all models belonging to the organization are returned.
15+
16+
Results are paginated.
17+
"""
1118

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

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

1825
_slug: ClassVar[str] = "models"
1926
_response_class: type[ModelSearchResponse] = ModelSearchResponse

‎tests/v2/search/test_model_search_integration.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ def test_must_have_results(v2_client: Client):
1616

1717
assert response is not None
1818
assert len(response.models) > 0
19+
for model in response.models:
20+
assert model.id
21+
assert model.name
22+
assert model.model_type
1923
assert response.pagination is not None
2024
assert response.pagination.total_items >= 1
2125
assert response.pagination.page == 1

0 commit comments

Comments
 (0)