mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-14 06:53:47 +00:00
Fixing some things left over
This commit is contained in:
1 parent
bbbcdddc91
commit
b28f2bcf6c
7 files changed
+147
-18
No files matched your search
@@ -5,4 +5,24 @@ namespace AIStudio.Provider.OpenRouter;
|
||||
/// </summary>
|
||||
/// <param name="Id">The model's ID.</param>
|
||||
/// <param name="Name">The model's human-readable display name.</param>
|
||||
public readonly record struct OpenRouterModel(string Id, string? Name);
|
||||
/// <param name="Reasoning">The model's provider-reported reasoning behavior.</param>
|
||||
public readonly record struct OpenRouterModel(string Id, string? Name, OpenRouterReasoning? Reasoning)
|
||||
{
|
||||
public Model ToModel() => new(this.Id, this.Name)
|
||||
{
|
||||
ReasoningBehavior = this.Reasoning switch
|
||||
{
|
||||
{ Mandatory: true } => ModelReasoningBehavior.ALWAYS_ON,
|
||||
{ DefaultEnabled: true } => ModelReasoningBehavior.DEFAULT_ON,
|
||||
not null => ModelReasoningBehavior.OPTIONAL,
|
||||
_ => ModelReasoningBehavior.UNKNOWN,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The reasoning defaults returned for a model by OpenRouter's model catalog.
|
||||
/// </summary>
|
||||
/// <param name="DefaultEnabled">Whether reasoning is enabled when the request does not configure it.</param>
|
||||
/// <param name="Mandatory">Whether reasoning cannot be disabled for the model.</param>
|
||||
public readonly record struct OpenRouterReasoning(bool DefaultEnabled, bool Mandatory);
|
||||
@@ -116,7 +116,7 @@ public sealed class ProviderOpenRouter() : BaseProvider(LLMProviders.OPEN_ROUTER
|
||||
storeType,
|
||||
"models",
|
||||
modelResponse => modelResponse.Data
|
||||
.Select(n => new Model(n.Id, n.Name))
|
||||
.Select(n => n.ToModel())
|
||||
.Where(model => model.IsChatModel()),
|
||||
apiKeyProvisional,
|
||||
requestConfigurator: (request, secretKey) =>
|
||||
@@ -133,7 +133,7 @@ public sealed class ProviderOpenRouter() : BaseProvider(LLMProviders.OPEN_ROUTER
|
||||
return this.LoadModelsResponse<OpenRouterModelsResponse>(
|
||||
SecretStoreType.EMBEDDING_PROVIDER,
|
||||
"embeddings/models",
|
||||
modelResponse => modelResponse.Data.Select(n => new Model(n.Id, n.Name)),
|
||||
modelResponse => modelResponse.Data.Select(n => n.ToModel()),
|
||||
apiKeyProvisional,
|
||||
requestConfigurator: (request, secretKey) =>
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user