MCPcopy Create free account
hub / github.com/di-sukharev/opencommit / fetchMistralModels

Function fetchMistralModels

out/cli.cjs:86278–86294  ·  view source on GitHub ↗
(apiKey)

Source from the content-addressed store, hash-verified

86276 }
86277 const data = await response.json();
86278 const models = data.data?.map((m5) => m5.id).filter((id) => id.startsWith("claude-")).sort();
86279 return models && models.length > 0 ? models : MODEL_LIST.anthropic;
86280 } catch {
86281 return MODEL_LIST.anthropic;
86282 }
86283}
86284async function fetchMistralModels(apiKey) {
86285 try {
86286 const response = await fetch("https://api.mistral.ai/v1/models", {
86287 headers: {
86288 Authorization: `Bearer ${apiKey}`
86289 }
86290 });
86291 if (!response.ok) {
86292 return MODEL_LIST.mistral;
86293 }
86294 const data = await response.json();
86295 const models = data.data?.map((m5) => m5.id).sort();
86296 return models && models.length > 0 ? models : MODEL_LIST.mistral;
86297 } catch {

Callers 1

fetchModelsForProviderFunction · 0.70

Calls 2

jsonMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected