fix(provider): derive variants from reasoning metadata (#36624)

This commit is contained in:
Aiden Cline
2026-07-13 01:21:59 -05:00
committed by GitHub
parent f47684787a
commit a8062ea314
8 changed files with 534 additions and 175 deletions
+16 -3
View File
@@ -44,6 +44,21 @@ const Cost = Schema.Struct({
),
})
const ReasoningOption = Schema.Union([
Schema.Struct({
type: Schema.Literal("effort"),
values: Schema.Array(Schema.NullOr(Schema.String)),
}),
Schema.Struct({
type: Schema.Literal("toggle"),
}),
Schema.Struct({
type: Schema.Literal("budget_tokens"),
min: Schema.optional(Schema.Finite),
max: Schema.optional(Schema.Finite),
}),
])
export const Model = Schema.Struct({
id: Schema.String,
name: Schema.String,
@@ -51,11 +66,9 @@ export const Model = Schema.Struct({
release_date: Schema.String,
attachment: Schema.Boolean,
reasoning: Schema.Boolean,
// models.dev is external metadata and reasoning controls are expected to evolve.
// Provider normalization extracts the subset understood by this client.
reasoning_options: Schema.optional(Schema.Unknown),
temperature: Schema.Boolean,
tool_call: Schema.Boolean,
reasoning_options: Schema.optional(Schema.Array(ReasoningOption)),
interleaved: Schema.optional(
Schema.Union([
Schema.Literal(true),