mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-17 09:58:00 +00:00
Move the model kinds into the rule engine
This commit is contained in:
16 files changed
+731
-10
No files matched your search
@@ -170,7 +170,7 @@ public class ProviderGoogle() : BaseProvider(LLMProviders.GOOGLE, new Uri("https
|
||||
[
|
||||
..result.Models.Where(model =>
|
||||
model.Id.StartsWith("gemini-", StringComparison.OrdinalIgnoreCase) &&
|
||||
!this.IsEmbeddingModel(model.Id))
|
||||
!model.IsEmbeddingModel())
|
||||
.Select(this.WithDisplayNameFallback)
|
||||
]
|
||||
};
|
||||
@@ -189,7 +189,7 @@ public class ProviderGoogle() : BaseProvider(LLMProviders.GOOGLE, new Uri("https
|
||||
{
|
||||
Models =
|
||||
[
|
||||
..result.Models.Where(model => this.IsEmbeddingModel(model.Id))
|
||||
..result.Models.Where(model => model.IsEmbeddingModel())
|
||||
.Select(this.WithDisplayNameFallback)
|
||||
]
|
||||
};
|
||||
@@ -222,12 +222,6 @@ public class ProviderGoogle() : BaseProvider(LLMProviders.GOOGLE, new Uri("https
|
||||
token: token);
|
||||
}
|
||||
|
||||
private bool IsEmbeddingModel(string modelId)
|
||||
{
|
||||
return modelId.Contains("embedding", StringComparison.OrdinalIgnoreCase) ||
|
||||
modelId.Contains("embed", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
private Model WithDisplayNameFallback(Model model)
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(model.DisplayName)
|
||||
|
||||
Reference in new issue
Block a user