wip: refactoring tui

This commit is contained in:
adamdottv
2025-06-13 06:23:12 -05:00
parent 9abc2a0cf8
commit 97837d2d23
9 changed files with 506 additions and 133 deletions

View File

@@ -7,31 +7,40 @@ export namespace ModelsDev {
const log = Log.create({ service: "models.dev" })
const filepath = path.join(Global.Path.cache, "models.json")
export const Model = z.object({
name: z.string(),
attachment: z.boolean(),
reasoning: z.boolean(),
temperature: z.boolean(),
cost: z.object({
input: z.number(),
output: z.number(),
inputCached: z.number(),
outputCached: z.number(),
}),
limit: z.object({
context: z.number(),
output: z.number(),
}),
id: z.string(),
})
export const Model = z
.object({
name: z.string(),
attachment: z.boolean(),
reasoning: z.boolean(),
temperature: z.boolean(),
cost: z.object({
input: z.number(),
output: z.number(),
inputCached: z.number(),
outputCached: z.number(),
}),
limit: z.object({
context: z.number(),
output: z.number(),
}),
id: z.string(),
})
.openapi({
ref: "Model.Info",
})
export type Model = z.infer<typeof Model>
export const Provider = z.object({
name: z.string(),
env: z.array(z.string()),
id: z.string(),
models: z.record(Model),
})
export const Provider = z
.object({
name: z.string(),
env: z.array(z.string()),
id: z.string(),
models: z.record(Model),
})
.openapi({
ref: "Provider.Info",
})
export type Provider = z.infer<typeof Provider>
export async function get() {