MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / fetchGroqModels

Function fetchGroqModels

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

Source from the content-addressed store, hash-verified

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 {
86298 return MODEL_LIST.mistral;
86299 }
86300}
86301async function fetchGroqModels(apiKey) {
86302 try {
86303 const response = await fetch("https://api.groq.com/openai/v1/models", {
86304 headers: {
86305 Authorization: `Bearer ${apiKey}`
86306 }
86307 });
86308 if (!response.ok) {
86309 return MODEL_LIST.groq;
86310 }
86311 const data = await response.json();
86312 const models = data.data?.map((m5) => m5.id).sort();
86313 return models && models.length > 0 ? models : MODEL_LIST.groq;
86314 } catch {

Callers 1

fetchModelsForProviderFunction · 0.70

Calls 2

jsonMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…