MCPcopy Create free account
hub / github.com/anomalyco/opencode / fetchProviderIcons

Function fetchProviderIcons

packages/ui/vite.config.ts:47–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45}
46
47async function fetchProviderIcons() {
48 const url = process.env.OPENCODE_MODELS_URL || "https://models.dev"
49 const providers = await fetch(`${url}/api.json`)
50 .then((res) => res.json())
51 .then((json) => Object.keys(json))
52 await Promise.all(
53 providers.map((provider) =>
54 fetch(`${url}/logos/${provider}.svg`)
55 .then((res) => res.text())
56 .then((svg) => fs.writeFileSync(`./src/assets/icons/provider/${provider}.svg`, svg)),
57 ),
58 )
59}

Callers 2

configureServerFunction · 0.85
buildStartFunction · 0.85

Calls 4

jsonMethod · 0.65
textMethod · 0.65
fetchFunction · 0.50
allMethod · 0.45

Tested by

no test coverage detected