diff options
| author | Dax Raad <[email protected]> | 2025-05-28 12:53:22 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-05-28 12:53:22 -0400 |
| commit | 55a6fcdd3f5b3c55712e5cfc9dd4d994da38d4c8 (patch) | |
| tree | aef660f4e7b0fae135dc1f90cf6920b53238ed5b /js/src/app | |
| parent | 4132fcc1b286af5e61bf5eaa89f789988362f995 (diff) | |
| download | opencode-55a6fcdd3f5b3c55712e5cfc9dd4d994da38d4c8.tar.gz opencode-55a6fcdd3f5b3c55712e5cfc9dd4d994da38d4c8.zip | |
add provider_list
Diffstat (limited to 'js/src/app')
| -rw-r--r-- | js/src/app/config.ts | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/js/src/app/config.ts b/js/src/app/config.ts index 947298c67..77a1f606f 100644 --- a/js/src/app/config.ts +++ b/js/src/app/config.ts @@ -1,25 +1,34 @@ import path from "node:path"; import { Log } from "../util/log"; import { z } from "zod"; +import { LLM } from "../llm/llm"; export namespace Config { const log = Log.create({ service: "config" }); + 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(), + attachment: z.boolean(), + }); + export type Model = z.output<typeof Model>; + + export const Provider = z.object({ + options: z.record(z.string(), z.any()).optional(), + models: z.record(z.string(), Model).optional(), + }); + export type Provider = z.output<typeof Provider>; + export const Info = z .object({ - providers: z - .object({ - anthropic: z - .object({ - apiKey: z.string().optional(), - headers: z.record(z.string(), z.string()).optional(), - baseURL: z.string().optional(), - }) - .strict() - .optional(), - }) - .strict() - .optional(), + providers: z.record(z.string(), Provider).optional(), }) .strict(); |
