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
|
|
@ -41,6 +41,17 @@ export interface Ref extends Schema.Schema.Type<typeof Ref> {}
|
|||
export const Family = Schema.String.pipe(Schema.brand("Model.Family"))
|
||||
export type Family = typeof Family.Type
|
||||
|
||||
export type ReasoningField = "reasoning" | "reasoning_content" | "reasoning_text" | (string & {})
|
||||
export const ReasoningField: Schema.Codec<ReasoningField> = Schema.Union([
|
||||
Schema.Literals(["reasoning", "reasoning_content", "reasoning_text"]),
|
||||
Schema.String,
|
||||
]).annotate({ identifier: "Model.ReasoningField" })
|
||||
|
||||
export interface Compatibility extends Schema.Schema.Type<typeof Compatibility> {}
|
||||
export const Compatibility = Schema.Struct({
|
||||
reasoningField: ReasoningField.pipe(optional),
|
||||
}).annotate({ identifier: "Model.Compatibility" })
|
||||
|
||||
export interface Capabilities extends Schema.Schema.Type<typeof Capabilities> {}
|
||||
export const Capabilities = Schema.Struct({
|
||||
tools: Schema.Boolean,
|
||||
|
|
@ -75,6 +86,7 @@ export const Info = Schema.Struct({
|
|||
providerID: Provider.ID,
|
||||
family: Family.pipe(optional),
|
||||
name: Schema.String,
|
||||
compatibility: Compatibility.pipe(optional),
|
||||
package: Provider.Package.pipe(optional),
|
||||
...Provider.Overlays,
|
||||
capabilities: Capabilities,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue