fix nix
This commit is contained in:
parent
8f0d08fae0
commit
fa1a54ba3d
1 changed files with 3 additions and 1 deletions
|
|
@ -16,7 +16,9 @@ import pkg from "../package.json"
|
||||||
import { Script } from "@opencode-ai/script"
|
import { Script } from "@opencode-ai/script"
|
||||||
|
|
||||||
// Fetch and generate models.dev snapshot
|
// Fetch and generate models.dev snapshot
|
||||||
const modelsData = await fetch(`https://models.dev/api.json`).then((x) => x.text())
|
const modelsData = process.env.MODELS_DEV_API_JSON
|
||||||
|
? await Bun.file(process.env.MODELS_DEV_API_JSON).text()
|
||||||
|
: await fetch(`https://models.dev/api.json`).then((x) => x.text())
|
||||||
await Bun.write(
|
await Bun.write(
|
||||||
path.join(dir, "src/provider/models-snapshot.ts"),
|
path.join(dir, "src/provider/models-snapshot.ts"),
|
||||||
`// Auto-generated by build.ts - do not edit\nexport const snapshot = ${modelsData} as const\n`,
|
`// Auto-generated by build.ts - do not edit\nexport const snapshot = ${modelsData} as const\n`,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue