|
|
@@ -3,6 +3,7 @@ import { Log } from "../util/log"
|
|
|
import path from "path"
|
|
|
import { z } from "zod"
|
|
|
import { data } from "./models-macro" with { type: "macro" }
|
|
|
+import { Installation } from "../installation"
|
|
|
|
|
|
export namespace ModelsDev {
|
|
|
const log = Log.create({ service: "models.dev" })
|
|
|
@@ -63,7 +64,7 @@ export namespace ModelsDev {
|
|
|
log.info("refreshing")
|
|
|
const result = await fetch("https://models.dev/api.json", {
|
|
|
headers: {
|
|
|
- "User-Agent": "opencode",
|
|
|
+ "User-Agent": Installation.USER_AGENT,
|
|
|
},
|
|
|
}).catch(() => {})
|
|
|
if (result && result.ok) await Bun.write(file, result)
|