Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions apps/ai-dial-admin/src/constants/grid-columns/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ export const numericColumn: Partial<ColDef> = {
filterValueGetter: (params) => numberValueFormatter(params.data[params.colDef.field || '']),
};

export const priceColumn: Partial<ColDef> = {
...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<ColDef> => {
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 || '']),
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
Loading