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
4 changes: 2 additions & 2 deletions src/Mindee.Cli/Commands/V2/SearchModelsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ public SearchModelsCommand() : base("search-models", "Search available models.")
{
_nameOption = new Option<string?>("--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<string> { "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);
Expand Down
9 changes: 6 additions & 3 deletions src/Mindee/V2/Search/Models/ModelSearchParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@
namespace Mindee.V2.Search.Models
{
/// <summary>
/// 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 on lines +8 to +11
/// </summary>
public class ModelSearchParameters : BaseSearchParameters
{
/// <summary>
/// Case-insensitive search term for the model name
/// Filter models by partial name match, case-insensitive.
/// </summary>
public string Name { get; }

/// <summary>
/// Case-insensitive search term for the model type
/// Filter by an exact model type.
/// </summary>
public string ModelType { get; }

Expand Down
7 changes: 6 additions & 1 deletion tests/Mindee.IntegrationTests/V2/Search/ModelSearchTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Mindee.V2;
using Mindee.V2.Parsing.Search;
using Mindee.V2.Search.Models;

namespace Mindee.IntegrationTests.V2.Search
Expand All @@ -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);
Expand Down
Loading