feat: model usage
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
import { formatLargeNumber } from '@/utils';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
export const overviewConfigs = [
|
||||
{
|
||||
key: 'worker_count',
|
||||
@@ -25,52 +22,6 @@ export const overviewConfigs = [
|
||||
}
|
||||
];
|
||||
|
||||
export const exportTableColumns = [
|
||||
{
|
||||
title: 'Date',
|
||||
dataIndex: 'date',
|
||||
render: (text: string) => {
|
||||
return dayjs(text).format('YYYY-MM-DD');
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'User',
|
||||
dataIndex: 'user',
|
||||
render: (text: string) => {
|
||||
return text || 'admin';
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Model',
|
||||
dataIndex: 'model',
|
||||
render: (text: string) => {
|
||||
return text || 'All Models';
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
title: 'Completion Tokens',
|
||||
dataIndex: 'completion_tokens',
|
||||
render: (text: number) => {
|
||||
return formatLargeNumber(text) || 0;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Prompt Tokens',
|
||||
dataIndex: 'prompt_tokens',
|
||||
render: (text: number) => {
|
||||
return formatLargeNumber(text) || 0;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'API Requests',
|
||||
dataIndex: 'request_count',
|
||||
render: (text: number) => {
|
||||
return formatLargeNumber(text) || 0;
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
export const baseColorMap = {
|
||||
baseL2: 'rgba(13,171,219,0.8)',
|
||||
baseL1: 'rgba(0,34,255,0.8)',
|
||||
|
||||
@@ -44,3 +44,20 @@ export interface DashboardProps {
|
||||
};
|
||||
active_models: any[];
|
||||
}
|
||||
|
||||
export interface DashboardUsageData {
|
||||
api_request_history: any[];
|
||||
completion_token_history: any[];
|
||||
prompt_token_history: any[];
|
||||
}
|
||||
|
||||
export interface TableRow {
|
||||
id: number;
|
||||
prompt_token_count: number;
|
||||
completion_token_count: number;
|
||||
operation: string;
|
||||
model_id: number;
|
||||
date: string;
|
||||
user_id: number;
|
||||
request_count: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user