MCPcopy Create free account
hub / github.com/arctic-cli/interface / defaultModel

Function defaultModel

packages/arctic/src/provider/provider.ts:2179–2193  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2177 }
2178
2179 export async function defaultModel() {
2180 const cfg = await Config.get()
2181 if (cfg.model) return parseModel(cfg.model)
2182
2183 const provider = await list()
2184 .then((val) => Object.values(val))
2185 .then((x) => x.find((p) => !cfg.provider || Object.keys(cfg.provider).includes(p.id)))
2186 if (!provider) throw new Error("no providers found")
2187 const [model] = sort(Object.values(provider.models))
2188 if (!model) throw new Error("no models found")
2189 return {
2190 providerID: provider.id,
2191 modelID: model.id,
2192 }
2193 }
2194
2195 export function parseModel(model: string) {
2196 const [providerPart, ...rest] = model.split("/")

Callers

nothing calls this directly

Calls 4

parseModelFunction · 0.85
listFunction · 0.70
sortFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected