File tree Expand file tree Collapse file tree 2 files changed +14
-17
lines changed
dashboard/ai-analytics/src/lib Expand file tree Collapse file tree 2 files changed +14
-17
lines changed Original file line number Diff line number Diff line change @@ -8,23 +8,7 @@ export const fetchAvailableDimensions = async () => {
88 }
99
1010 try {
11- // SQL query to get all unique values for each dimension
12- const query = `
13- SELECT
14- groupUniqArray(organization) as organization,
15- groupUniqArray(project) as project,
16- groupUniqArray(environment) as environment,
17- groupUniqArray(model) as model,
18- groupUniqArray(provider) as provider
19- FROM llm_events WHERE timestamp > now() - interval '1 month' FORMAT JSON
20- ` ;
21-
22- // URL encode the query
23- const encodedQuery = encodeURIComponent ( query ) ;
24- const url = `${ TINYBIRD_API_URL } /v0/sql?q=${ encodedQuery } ` ;
25-
26- console . log ( 'Fetching available dimensions from:' , url ) ;
27-
11+ const url = `${ TINYBIRD_API_URL } /v0/pipes/llm_dimensions.json` ;
2812 const response = await fetch ( url , {
2913 headers : {
3014 Authorization : `Bearer ${ TINYBIRD_API_KEY } ` ,
Original file line number Diff line number Diff line change 1+ TOKEN read_pipes READ
2+
3+ NODE llm_dimensions_node
4+ SQL >
5+ SELECT
6+ groupUniqArray(organization) as organization,
7+ groupUniqArray(project) as project,
8+ groupUniqArray(environment) as environment,
9+ groupUniqArray(model) as model,
10+ groupUniqArray(provider) as provider
11+ FROM llm_events WHERE timestamp > now() - interval '1 month'
12+
13+ TYPE endpoint
You can’t perform that action at this time.
0 commit comments