mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-07 09:18:41 +00:00
feat: Make the models.dev domain configurable for offline environments (#9258)
This commit is contained in:
@@ -85,7 +85,8 @@ export namespace ModelsDev {
|
||||
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())
|
||||
const url = Global.Path.modelsDevUrl
|
||||
const json = await fetch(`${url}/api.json`).then((x) => x.text())
|
||||
return JSON.parse(json) as Record<string, Provider>
|
||||
}
|
||||
|
||||
@@ -95,7 +96,8 @@ export namespace ModelsDev {
|
||||
log.info("refreshing", {
|
||||
file,
|
||||
})
|
||||
const result = await fetch("https://models.dev/api.json", {
|
||||
const url = Global.Path.modelsDevUrl
|
||||
const result = await fetch(`${url}/api.json`, {
|
||||
headers: {
|
||||
"User-Agent": Installation.USER_AGENT,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user