mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-10 03:14:55 +01:00
type error fix
This commit is contained in:
32
js/src/provider/provider.ts
Normal file
32
js/src/provider/provider.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import z from "zod";
|
||||
|
||||
export namespace Provider {
|
||||
export const Model = z
|
||||
.object({
|
||||
name: z.string().optional(),
|
||||
cost: z.object({
|
||||
input: z.number(),
|
||||
inputCached: z.number(),
|
||||
output: z.number(),
|
||||
outputCached: z.number(),
|
||||
}),
|
||||
contextWindow: z.number(),
|
||||
maxTokens: z.number().optional(),
|
||||
attachment: z.boolean(),
|
||||
reasoning: z.boolean().optional(),
|
||||
})
|
||||
.openapi({
|
||||
ref: "Provider.Model",
|
||||
});
|
||||
export type Model = z.output<typeof Model>;
|
||||
|
||||
export const Info = z
|
||||
.object({
|
||||
options: z.record(z.string(), z.any()).optional(),
|
||||
models: z.record(z.string(), Model),
|
||||
})
|
||||
.openapi({
|
||||
ref: "Provider.Info",
|
||||
});
|
||||
export type Info = z.output<typeof Info>;
|
||||
}
|
||||
Reference in New Issue
Block a user