Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions packages/core/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,21 @@ export const Model = z
attachment: z.boolean(),
reasoning: z.boolean(),
temperature: z.boolean(),
tool_call: z.boolean(),
tool_call: z
.union([
z.boolean(),
z
.object({
supported: z.boolean(),
streaming: z.boolean().optional(),
parallel: z.boolean().optional(),
coerces_types: z.boolean().optional(),
})
.strict(),
])
.describe(
"Supports tool calling. Can be a boolean or an object for granular capabilities.",
),
knowledge: z
.string()
.regex(/^\d{4}-\d{2}(-\d{2})?$/, {
Expand Down Expand Up @@ -71,7 +85,7 @@ export const Model = z
{
message: "Cannot set cost.reasoning when reasoning is false",
path: ["cost", "reasoning"],
}
},
);

export type Model = z.infer<typeof Model>;
Expand All @@ -87,7 +101,7 @@ export const Provider = z
.string()
.min(
1,
"Please provide a link to the provider documentation where models are listed"
"Please provide a link to the provider documentation where models are listed",
),
models: z.record(Model),
})
Expand All @@ -103,6 +117,6 @@ export const Provider = z
message:
"'api' field is required if and only if npm is '@ai-sdk/openai-compatible'",
path: ["api"],
}
},
);
export type Provider = z.infer<typeof Provider>;
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ attachment = false
reasoning = false
temperature = true
knowledge = "2023-12"
tool_call = true
open_weights = true

[tool_call]
supported = true
streaming = false
coerces_types = true

[cost]
input = 0.72
output = 0.72
Expand Down