diff --git a/apps/ai-dial-admin/src/constants/grid-columns/configs.ts b/apps/ai-dial-admin/src/constants/grid-columns/configs.ts index 1fe12cb01..aea900567 100644 --- a/apps/ai-dial-admin/src/constants/grid-columns/configs.ts +++ b/apps/ai-dial-admin/src/constants/grid-columns/configs.ts @@ -22,17 +22,19 @@ export const numericColumn: Partial = { filterValueGetter: (params) => numberValueFormatter(params.data[params.colDef.field || '']), }; -export const priceColumn: Partial = { - ...numericColumn, - headerComponentParams: { - innerHeaderComponent: HeaderWithHintButton, - innerHeaderComponentParams: { - hintText: - 'The calculated price is an approximation. Since different models, applications, and configurations may have varying token usage and processing costs, it’s not possible to determine the exact final price in advance. \n' + - 'The estimate gives you a general idea of expected costs, but the actual price may differ depending on how the chat unfolds (e.g., message length, complexity, model type, or additional features used).', - hintTitle: 'Total Price', +export const priceColumn = (title: string): Partial => { + return { + ...numericColumn, + headerComponentParams: { + innerHeaderComponent: HeaderWithHintButton, + innerHeaderComponentParams: { + hintText: + 'The calculated price is an approximation. Since different models, applications, and configurations may have varying token usage and processing costs, it’s not possible to determine the exact final price in advance. \n' + + 'The estimate gives you a general idea of expected costs, but the actual price may differ depending on how the chat unfolds (e.g., message length, complexity, model type, or additional features used).', + hintTitle: title, + }, }, - }, - valueFormatter: ({ value }) => `$${priceValueFormatter(value)}`, - filterValueGetter: (params) => priceValueFormatter(params.data[params.colDef.field || '']), + valueFormatter: ({ value }) => `$${priceValueFormatter(value)}`, + filterValueGetter: (params) => priceValueFormatter(params.data[params.colDef.field || '']), + }; }; diff --git a/apps/ai-dial-admin/src/constants/grid-columns/grid-columns.tsx b/apps/ai-dial-admin/src/constants/grid-columns/grid-columns.tsx index f0f6667c6..5c8f998fa 100644 --- a/apps/ai-dial-admin/src/constants/grid-columns/grid-columns.tsx +++ b/apps/ai-dial-admin/src/constants/grid-columns/grid-columns.tsx @@ -362,13 +362,13 @@ export const USAGE_LOG_TRACES_COLUMNS: ColDef[] = [ headerName: 'Deployment Price', minWidth: 180, hide: false, - ...priceColumn, + ...priceColumn('Deployment Price'), }, { field: 'price', headerName: 'Total Price', hide: false, - ...priceColumn, + ...priceColumn('Total Price'), }, { field: 'number_request_messages', @@ -418,7 +418,7 @@ export const USAGE_LOG_CONVERSATIONS_COLUMNS: ColDef[] = [ field: 'deployment_price', headerName: 'Total Price', hide: false, - ...priceColumn, + ...priceColumn('Total Price'), }, { field: 'number_request_messages',