feat(core): sync models.dev reasoning options
This commit is contained in:
parent
80c0b06980
commit
a47ff5c746
9 changed files with 112 additions and 2 deletions
|
|
@ -48,6 +48,7 @@ export const Plugin = PluginV2.define({
|
|||
if (config.capabilities !== undefined) {
|
||||
model.capabilities = {
|
||||
tools: config.capabilities.tools,
|
||||
reasoningOptions: config.capabilities.reasoningOptions?.map((option) => ({ ...option })),
|
||||
input: [...config.capabilities.input],
|
||||
output: [...config.capabilities.output],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ export type Family = typeof Family.Type
|
|||
|
||||
export const Capabilities = Schema.Struct({
|
||||
tools: Schema.Boolean,
|
||||
reasoningOptions: Schema.Array(Schema.Record(Schema.String, Schema.Any)).pipe(Schema.optional),
|
||||
// mime patterns, image, audio, video/*, text/*
|
||||
input: Schema.String.pipe(Schema.Array),
|
||||
output: Schema.String.pipe(Schema.Array),
|
||||
|
|
|
|||
|
|
@ -43,6 +43,11 @@ const Cost = Schema.Struct({
|
|||
),
|
||||
})
|
||||
|
||||
export const ReasoningOption = Schema.StructWithRest(Schema.Struct({ type: Schema.String }), [
|
||||
Schema.Record(Schema.String, Schema.MutableJson),
|
||||
])
|
||||
export type ReasoningOption = typeof ReasoningOption.Type
|
||||
|
||||
export const Model = Schema.Struct({
|
||||
id: Schema.String,
|
||||
name: Schema.String,
|
||||
|
|
@ -50,6 +55,7 @@ export const Model = Schema.Struct({
|
|||
release_date: Schema.String,
|
||||
attachment: Schema.Boolean,
|
||||
reasoning: Schema.Boolean,
|
||||
reasoning_options: Schema.optional(Schema.Array(ReasoningOption)),
|
||||
temperature: Schema.Boolean,
|
||||
tool_call: Schema.Boolean,
|
||||
interleaved: Schema.optional(
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ export const ModelsDevPlugin = PluginV2.define({
|
|||
}
|
||||
draft.capabilities = {
|
||||
tools: model.tool_call,
|
||||
reasoningOptions: model.reasoning_options?.map((option) => ({ ...option })),
|
||||
input: [...(model.modalities?.input ?? [])],
|
||||
output: [...(model.modalities?.output ?? [])],
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue