Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(prompts): show correct observation count for prompts in folders (#9792)

Nimard521a005a48c
diff --git a/web/src/features/prompts/components/prompts-table.tsx b/web/src/features/prompts/components/prompts-table.tsx
index 178b2c6dc8..e1357cb039 100644
--- a/web/src/features/prompts/components/prompts-table.tsx
+++ b/web/src/features/prompts/components/prompts-table.tsx
@@ -117,6 +117,9 @@ export function PromptTable() {
const currentFolderPath = queryParams.folder || "";
+ const buildFullPath = (currentFolder: string, itemName: string) =>
+ currentFolder ? `${currentFolder}/${itemName}` : itemName;
+
const prompts = api.prompts.all.useQuery(
{
page: paginationState.pageIndex,
@@ -140,7 +143,10 @@ export function PromptTable() {
const promptMetrics = api.prompts.metrics.useQuery(
{
projectId: projectId as string,
- promptNames: prompts.data?.prompts.map((p) => p.name) ?? [],
+ promptNames:
+ prompts.data?.prompts.map((p) =>
+ buildFullPath(currentFolderPath, p.name),
+ ) ?? [],
},
{
enabled:
@@ -169,9 +175,6 @@ export function PromptTable() {
})),
);
- const buildFullPath = (currentFolder: string, itemName: string) =>
- currentFolder ? `${currentFolder}/${itemName}` : itemName;
-
// Backend returns folder representatives with row_type metadata
const processedRowData = useMemo(() => {
if (!promptsRowData.rows) return { ...promptsRowData, rows: [] };