feat(ai): support custom reasoning fields (#38227)
This commit is contained in:
parent
69c05ae3fc
commit
23483ea013
24 changed files with 306 additions and 67 deletions
|
|
@ -8,6 +8,7 @@ import { ConfigPermissionV1 } from "./permission"
|
|||
import { ConfigProviderV1 } from "./provider"
|
||||
import { ConfigProviderOptionsV1 } from "./provider-options"
|
||||
import { ProviderV2 } from "../../provider"
|
||||
import { ModelV2 } from "../../model"
|
||||
|
||||
const keys = new Set([
|
||||
"logLevel",
|
||||
|
|
@ -278,6 +279,7 @@ function migrateModel(info: typeof ConfigProviderV1.Model.Type) {
|
|||
modelID: info.id,
|
||||
family: info.family,
|
||||
name: info.name,
|
||||
compatibility: ModelV2.compatibility(info.interleaved),
|
||||
package: info.provider?.npm ? ProviderV2.aisdk(info.provider.npm) : undefined,
|
||||
settings: info.provider?.api ? { ...settings, baseURL: info.provider.api } : settings,
|
||||
capabilities,
|
||||
|
|
|
|||
|
|
@ -16,9 +16,10 @@ export const Model = Schema.Struct({
|
|||
tool_call: Schema.optional(Schema.Boolean),
|
||||
interleaved: Schema.optional(
|
||||
Schema.Union([
|
||||
Schema.Literal(true),
|
||||
Schema.Boolean,
|
||||
Schema.String,
|
||||
Schema.Struct({
|
||||
field: Schema.Literals(["reasoning", "reasoning_content", "reasoning_details"]),
|
||||
field: Schema.String,
|
||||
}),
|
||||
]),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue