diff options
| author | Dax Raad <[email protected]> | 2025-05-28 14:16:56 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-05-28 14:17:02 -0400 |
| commit | 4767276a0e35deb0fd9cf44bbd7cb1157c5991f7 (patch) | |
| tree | 56323bb0bffdd4bca93316907ca975ab67e18bd3 /js/src | |
| parent | 71bab45065a2ace8ea2f59d4f4856136ffd1b157 (diff) | |
| download | opencode-4767276a0e35deb0fd9cf44bbd7cb1157c5991f7.tar.gz opencode-4767276a0e35deb0fd9cf44bbd7cb1157c5991f7.zip | |
more
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/app/config.ts | 3 | ||||
| -rw-r--r-- | js/src/bun/index.ts | 5 | ||||
| -rw-r--r-- | js/src/index.ts | 1 | ||||
| -rw-r--r-- | js/src/llm/llm.ts | 35 |
4 files changed, 42 insertions, 2 deletions
diff --git a/js/src/app/config.ts b/js/src/app/config.ts index a3edbf889..3ebb8734b 100644 --- a/js/src/app/config.ts +++ b/js/src/app/config.ts @@ -15,8 +15,9 @@ export namespace Config { outputCached: z.number(), }), contextWindow: z.number(), - maxTokens: z.number(), + maxTokens: z.number().optional(), attachment: z.boolean(), + reasoning: z.boolean().optional(), }); export type Model = z.output<typeof Model>; diff --git a/js/src/bun/index.ts b/js/src/bun/index.ts index e921c825a..6eb6e1bde 100644 --- a/js/src/bun/index.ts +++ b/js/src/bun/index.ts @@ -7,7 +7,10 @@ export namespace BunProc { cmd: string[], options?: Bun.SpawnOptions.OptionsObject<any, any, any>, ) { - const root = path.resolve(process.cwd(), process.argv0); + const root = + process.argv0 !== "bun" + ? path.resolve(process.cwd(), process.argv0) + : process.argv0; log.info("running", { cmd: [root, ...cmd], options, diff --git a/js/src/index.ts b/js/src/index.ts index 3758ad718..1977f7c7d 100644 --- a/js/src/index.ts +++ b/js/src/index.ts @@ -94,6 +94,7 @@ cli const providers = await LLM.providers(); const providerID = Object.keys(providers)[0]; const modelID = Object.keys(providers[providerID].info.models!)[0]; + console.log("using", providerID, modelID); const result = await Session.chat({ sessionID: session.id, providerID, diff --git a/js/src/llm/llm.ts b/js/src/llm/llm.ts index e34030c50..1f8f08567 100644 --- a/js/src/llm/llm.ts +++ b/js/src/llm/llm.ts @@ -35,10 +35,45 @@ export namespace LLM { }, }, }, + openai: { + models: { + "codex-mini-latest": { + name: "Codex Mini", + cost: { + input: 1.5 / 1_000_000, + inputCached: 0.375 / 1_000_000, + output: 6.0 / 1_000_000, + outputCached: 0.0 / 1_000_000, + }, + contextWindow: 200000, + maxTokens: 100000, + attachment: true, + reasoning: true, + }, + }, + }, + google: { + models: { + "gemini-2.5-pro-preview-03-25": { + name: "Gemini 2.5 Pro", + cost: { + input: 1.25 / 1_000_000, + inputCached: 0 / 1_000_000, + output: 10 / 1_000_000, + outputCached: 0 / 1_000_000, + }, + contextWindow: 1000000, + maxTokens: 50000, + attachment: true, + }, + }, + }, }; const AUTODETECT: Record<string, string[]> = { anthropic: ["ANTHROPIC_API_KEY"], + openai: ["OPENAI_API_KEY"], + google: ["GOOGLE_GENERATIVE_AI_API_KEY"], }; const state = App.state("llm", async (app) => { |
