From 3680af3f2f0ec8e1075306aebd2bd163209a442b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ianar=C3=A9=20S=C3=A9vi?= Date: Mon, 7 Sep 2026 19:35:59 +0200 Subject: [PATCH] :memo: better docs for model search --- src/Mindee.Cli/Commands/V2/SearchModelsCommand.cs | 4 ++-- src/Mindee/V2/Search/Models/ModelSearchParameters.cs | 9 ++++++--- .../Mindee.IntegrationTests/V2/Search/ModelSearchTest.cs | 7 ++++++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/Mindee.Cli/Commands/V2/SearchModelsCommand.cs b/src/Mindee.Cli/Commands/V2/SearchModelsCommand.cs index 4b796791..36287b02 100644 --- a/src/Mindee.Cli/Commands/V2/SearchModelsCommand.cs +++ b/src/Mindee.Cli/Commands/V2/SearchModelsCommand.cs @@ -23,14 +23,14 @@ public SearchModelsCommand() : base("search-models", "Search available models.") { _nameOption = new Option("--name", "-n") { - Description = "Filter by model name partial match (case insensitive).", + Description = "Filter models by partial name match, case-insensitive.", DefaultValueFactory = _ => null }; Options.Add(_nameOption); var availableModels = new List { "extraction", "crop", "classification", "ocr", "split" }; var modelTypeDescription = """ - Filter by exact model type. + Filter by an exact model type. Available options: """; modelTypeDescription += string.Join("\n - ", availableModels); diff --git a/src/Mindee/V2/Search/Models/ModelSearchParameters.cs b/src/Mindee/V2/Search/Models/ModelSearchParameters.cs index 0fdbc0aa..8addbc3a 100644 --- a/src/Mindee/V2/Search/Models/ModelSearchParameters.cs +++ b/src/Mindee/V2/Search/Models/ModelSearchParameters.cs @@ -5,17 +5,20 @@ namespace Mindee.V2.Search.Models { /// - /// 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. /// public class ModelSearchParameters : BaseSearchParameters { /// - /// Case-insensitive search term for the model name + /// Filter models by partial name match, case-insensitive. /// public string Name { get; } /// - /// Case-insensitive search term for the model type + /// Filter by an exact model type. /// public string ModelType { get; } diff --git a/tests/Mindee.IntegrationTests/V2/Search/ModelSearchTest.cs b/tests/Mindee.IntegrationTests/V2/Search/ModelSearchTest.cs index bcd7cc0c..4592ce2b 100644 --- a/tests/Mindee.IntegrationTests/V2/Search/ModelSearchTest.cs +++ b/tests/Mindee.IntegrationTests/V2/Search/ModelSearchTest.cs @@ -1,5 +1,4 @@ using Mindee.V2; -using Mindee.V2.Parsing.Search; using Mindee.V2.Search.Models; namespace Mindee.IntegrationTests.V2.Search @@ -23,6 +22,12 @@ public async Task ModelSearch_mustHaveResults() Assert.NotNull(response); Assert.NotNull(response.Models); Assert.NotEmpty(response.Models); + foreach (var model in response.Models) + { + Assert.NotEmpty(model.Id); + Assert.NotEmpty(model.Name); + Assert.NotEmpty(model.ModelType); + } Assert.NotNull(response.Pagination); Assert.True(response.Pagination.TotalItems > 1); Assert.Equal(1, response.Pagination.Page);