feat(ai): support custom reasoning fields (#38227)

This commit is contained in:
Aiden Cline 2026-07-21 23:42:59 -05:00 committed by GitHub
commit 23483ea013
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 306 additions and 67 deletions

View file

@ -43,7 +43,7 @@ type SourceModel = {
readonly reasoning_options?: readonly ReasoningOption[]
readonly temperature?: boolean
readonly tool_call: boolean
readonly interleaved?: true | { readonly field: "reasoning" | "reasoning_content" | "reasoning_details" }
readonly interleaved?: boolean | string | { readonly field: string }
readonly cost?: Cost
readonly limit: { readonly context: number; readonly input?: number; readonly output: number }
readonly modalities?: { readonly input: readonly Modality[]; readonly output: readonly Modality[] }
@ -495,6 +495,7 @@ function modelInfo(
modelID: ModelV2.ID.make(model.id),
providerID,
name: input.name ?? model.name,
compatibility: ModelV2.compatibility(model.interleaved),
family: model.family ? ModelV2.Family.make(model.family) : undefined,
package: model.provider?.npm ? ProviderV2.aisdk(model.provider.npm) : undefined,
settings: model.provider?.api ? { baseURL: model.provider.api } : undefined,