mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-02 21:32:10 +03:00
fix(catalog): make combos auto-compute context_length for any provider id form (#3417)
Integrated into release/v3.8.17
This commit is contained in:
committed by
GitHub
parent
89a76d8c1c
commit
dbd70ddd1f
23
scripts/ad-hoc/regen-opencode-config.ts
Normal file
23
scripts/ad-hoc/regen-opencode-config.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* One-shot regen of ~/.config/opencode/opencode.json from the live
|
||||
* OmniRoute /v1/models catalog. Run after a catalog change to refresh
|
||||
* the opencode client.
|
||||
*
|
||||
* Usage: bun run scripts/regen-opencode-config.ts
|
||||
* or npx tsx scripts/regen-opencode-config.ts
|
||||
*/
|
||||
import { generateOpencodeConfig } from "../src/lib/cli-helper/config-generator/opencode.ts";
|
||||
|
||||
const baseURL = process.env.OMNIROUTE_URL ?? "http://localhost:20128";
|
||||
const apiKey = process.env.OMNIROUTE_KEY ?? process.env.OPENCODE_API_KEY ?? "";
|
||||
|
||||
if (!apiKey) {
|
||||
console.error(
|
||||
"OMNIROUTE_KEY (or OPENCODE_API_KEY) env var is required. " +
|
||||
"Find it in OmniRoute dashboard → Settings → API Keys."
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const out = await generateOpencodeConfig({ baseUrl: baseURL, apiKey });
|
||||
console.log(out);
|
||||
Reference in New Issue
Block a user