MCPcopy Create free account
hub / github.com/pollinations/pollinations / fetchModelStats

Function fetchModelStats

shared/utils/model-stats.ts:31–44  ·  view source on GitHub ↗
(log: Logger)

Source from the content-addressed store, hash-verified

29}
30
31async function fetchModelStats(log: Logger): Promise<TinybirdModelStats> {
32 try {
33 const response = await fetch(TINYBIRD_MODEL_STATS_URL);
34 if (!response.ok) {
35 throw new Error(`Tinybird API error: ${response.status}`);
36 }
37 return (await response.json()) as TinybirdModelStats;
38 } catch (error) {
39 log.error("Failed to fetch model stats from Tinybird: {error}", {
40 error,
41 });
42 return { data: [] };
43 }
44}

Callers

nothing calls this directly

Calls 3

jsonMethod · 0.80
errorMethod · 0.80
fetchFunction · 0.50

Tested by

no test coverage detected