mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-04 01:23:32 +00:00
fix: use OpenCode model catalog URL (#39672)
Co-authored-by: Dax Raad <d@ironbay.co>
This commit is contained in:
parent
ff0382e971
commit
a4f25a94b4
5 changed files with 8 additions and 8 deletions
|
|
@ -1,4 +1,4 @@
|
|||
const modelsUrl = process.env.OPENCODE_MODELS_URL || "https://models.dev"
|
||||
const modelsUrl = process.env.OPENCODE_MODELS_URL || "https://models.opencode.ai"
|
||||
|
||||
export const modelsData = process.env.MODELS_DEV_API_JSON
|
||||
? await Bun.file(process.env.MODELS_DEV_API_JSON).text()
|
||||
|
|
|
|||
|
|
@ -151,10 +151,10 @@ const layer = Layer.effect(
|
|||
),
|
||||
)
|
||||
|
||||
const source = Flag.OPENCODE_MODELS_URL || "https://models.dev"
|
||||
const source = Flag.OPENCODE_MODELS_URL || "https://models.opencode.ai"
|
||||
const filepath = path.join(
|
||||
Global.Path.cache,
|
||||
source === "https://models.dev" ? "models.json" : `models-${Hash.fast(source)}.json`,
|
||||
source === "https://models.opencode.ai" ? "models.json" : `models-${Hash.fast(source)}.json`,
|
||||
)
|
||||
const ttl = Duration.minutes(5)
|
||||
const lockKey = `models-dev:${filepath}`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import * as fs from "node:fs/promises"
|
|||
import * as path from "node:path"
|
||||
|
||||
const RECORDINGS_DIR = path.resolve(import.meta.dir, "..", "test", "fixtures", "recordings")
|
||||
const MODELS_DEV_URL = "https://models.dev/api.json"
|
||||
const MODELS_DEV_URL = "https://models.opencode.ai/api.json"
|
||||
|
||||
type JsonRecord = Record<string, unknown>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { query } from "@solidjs/router"
|
||||
|
||||
export const modelCatalogSourceUrl = "https://models.dev/catalog.json"
|
||||
export const modelCatalogPricingUrl = "https://models.dev/api.json"
|
||||
export const modelCatalogLabSourceUrl = "https://models.dev/labs"
|
||||
export const modelCatalogSourceUrl = "https://models.opencode.ai/catalog.json"
|
||||
export const modelCatalogPricingUrl = "https://models.opencode.ai/api.json"
|
||||
export const modelCatalogLabSourceUrl = "https://models.opencode.ai/labs"
|
||||
|
||||
export type ModelCatalogCost = {
|
||||
input: number
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ function providerIconsPlugin() {
|
|||
}
|
||||
|
||||
async function fetchProviderIcons() {
|
||||
const url = process.env.OPENCODE_MODELS_URL || "https://models.dev"
|
||||
const url = process.env.OPENCODE_MODELS_URL || "https://models.opencode.ai"
|
||||
const providers = await fetch(`${url}/api.json`)
|
||||
.then((res) => res.json())
|
||||
.then((json) => Object.keys(json))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue