namespace AIStudio.Provider.OpenRouter; /// /// A data model for an OpenRouter model from the API. /// /// The model's ID. /// The model's human-readable display name. /// The model's provider-reported reasoning behavior. 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, }, }; } /// /// The reasoning defaults returned for a model by OpenRouter's model catalog. /// /// Whether reasoning is enabled when the request does not configure it. /// Whether reasoning cannot be disabled for the model. public readonly record struct OpenRouterReasoning(bool DefaultEnabled, bool Mandatory);