chore(core): checkpoint model capability defaults
This commit is contained in:
parent
14a5529793
commit
0030028ebc
14 changed files with 380 additions and 28 deletions
|
|
@ -26,7 +26,24 @@ export const Capabilities = Schema.Struct({
|
|||
tools: Schema.Boolean,
|
||||
input: Schema.Array(Schema.String),
|
||||
output: Schema.Array(Schema.String),
|
||||
}).annotate({ identifier: "Model.Capabilities" })
|
||||
})
|
||||
.annotate({ identifier: "Model.Capabilities" })
|
||||
.pipe(
|
||||
statics((schema) => ({
|
||||
defaults: (
|
||||
input: {
|
||||
readonly tools?: boolean
|
||||
readonly input?: ReadonlyArray<string>
|
||||
readonly output?: ReadonlyArray<string>
|
||||
} = {},
|
||||
) =>
|
||||
schema.make({
|
||||
tools: input.tools ?? false,
|
||||
input: input.input === undefined ? ["text", "image"] : [...input.input],
|
||||
output: input.output === undefined ? ["text"] : [...input.output],
|
||||
}),
|
||||
})),
|
||||
)
|
||||
|
||||
export interface Cost extends Schema.Schema.Type<typeof Cost> {}
|
||||
export const Cost = Schema.Struct({
|
||||
|
|
@ -93,7 +110,7 @@ export const Info = Schema.Struct({
|
|||
providerID,
|
||||
name: modelID,
|
||||
api: { id: modelID, type: "native", settings: {} },
|
||||
capabilities: { tools: false, input: [], output: [] },
|
||||
capabilities: Capabilities.defaults(),
|
||||
request: { headers: {}, body: {} },
|
||||
variants: [],
|
||||
time: { released: 0 },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue