MCPcopy
hub / github.com/anomalyco/models.dev / fetchModels

Function fetchModels

packages/core/src/sync/providers/xai.ts:50–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48 ];
49 },
50 async fetchModels() {
51 const key = process.env.XAI_API_KEY;
52 if (key === undefined) throw new Error("xAI sync requires XAI_API_KEY");
53 await assertFullModelAccess(key);
54
55 const models = await Promise.all([
56 fetchTypedModels(key, "language-models"),
57 fetchTypedModels(key, "image-generation-models"),
58 fetchTypedModels(key, "video-generation-models"),
59 ]);
60
61 return { models: models.flat() };
62 },
63 parseModels(raw) {
64 const models = XAIResponse.parse(raw).models;
65 const seen = new Set<string>();

Callers

nothing calls this directly

Calls 2

assertFullModelAccessFunction · 0.85
fetchTypedModelsFunction · 0.85

Tested by

no test coverage detected