fix(core): loading models.dev in dev
parent
e60ded01df
commit
d71153eae6
|
|
@ -81,7 +81,11 @@ export namespace ModelsDev {
|
|||
const file = Bun.file(filepath)
|
||||
const result = await file.json().catch(() => {})
|
||||
if (result) return result as Record<string, Provider>
|
||||
const json = await data()
|
||||
if (typeof data === "function") {
|
||||
const json = await data()
|
||||
return JSON.parse(json) as Record<string, Provider>
|
||||
}
|
||||
const json = await fetch("https://models.dev/api.json").then((x) => x.text())
|
||||
return JSON.parse(json) as Record<string, Provider>
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue