mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-22 03:16:35 +00:00
add user agent for models.dev request
This commit is contained in:
parent
3aa6eeb426
commit
851e900982
1 changed files with 5 additions and 1 deletions
|
|
@ -64,7 +64,11 @@ export namespace ModelsDev {
|
|||
async function refresh() {
|
||||
const file = Bun.file(filepath)
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue