add user agent for models.dev request
This commit is contained in:
@@ -64,7 +64,11 @@ export namespace ModelsDev {
|
|||||||
async function refresh() {
|
async function refresh() {
|
||||||
const file = Bun.file(filepath)
|
const file = Bun.file(filepath)
|
||||||
log.info("refreshing")
|
log.info("refreshing")
|
||||||
const result = await fetch("https://models.dev/api.json").catch(() => {})
|
const result = await fetch("https://models.dev/api.json", {
|
||||||
|
headers: {
|
||||||
|
"User-Agent": "opencode",
|
||||||
|
},
|
||||||
|
}).catch(() => {})
|
||||||
if (result && result.ok) await Bun.write(file, result)
|
if (result && result.ok) await Bun.write(file, result)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user