We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e60ded0 commit d71153eCopy full SHA for d71153e
1 file changed
packages/opencode/src/provider/models.ts
@@ -81,7 +81,11 @@ export namespace ModelsDev {
81
const file = Bun.file(filepath)
82
const result = await file.json().catch(() => {})
83
if (result) return result as Record<string, Provider>
84
- const json = await data()
+ if (typeof data === "function") {
85
+ const json = await data()
86
+ return JSON.parse(json) as Record<string, Provider>
87
+ }
88
+ const json = await fetch("https://models.dev/api.json").then((x) => x.text())
89
return JSON.parse(json) as Record<string, Provider>
90
}
91
0 commit comments