feat: enhance token usage tracking and history management
- Updated HTML assets for improved loading. - Integrated token usage tracking in chat processing, appending usage details to transcripts. - Enhanced OpenAIProvider to include usage data in chat completion responses. - Implemented asynchronous retrieval of recent token usage history. - Added utility functions for managing transcript files and parsing usage data. - Updated UI components to reflect changes in usage status handling. - Ensured consistent usage status definitions across the application.
This commit is contained in:
@@ -82,7 +82,8 @@ async function handleLocalProviderApi(path: string, method: string, body: any) {
|
||||
return { success: true, ok: true, json: result, data: result };
|
||||
}
|
||||
if (path === '/api/usage/recent-token-history' && method === 'GET') {
|
||||
return { success: true, ok: true, json: providerApiService.getUsageHistory(), data: providerApiService.getUsageHistory() };
|
||||
const usageHistory = await providerApiService.getUsageHistory();
|
||||
return { success: true, ok: true, json: usageHistory, data: usageHistory };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user