mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-05 00:50:41 +00:00
fix: allow fake-chat to report usage for costly model
Modified the event handler in AIChatService to only skip usage reporting for fake-chat when it's not using the costly model, allowing the costly model to properly report its usage and costs. ai: true
This commit is contained in:
@@ -78,7 +78,8 @@ class AIChatService extends BaseService {
|
||||
|
||||
const svc_event = this.services.get('event');
|
||||
svc_event.on('ai.prompt.report-usage', async (_, details) => {
|
||||
if ( details.service_used === 'fake-chat' ) return;
|
||||
// Only skip usage reporting for fake-chat if it's not using the costly model
|
||||
if ( details.service_used === 'fake-chat' && details.model_used !== 'costly' ) return;
|
||||
|
||||
const values = {
|
||||
user_id: details.actor?.type?.user?.id,
|
||||
|
||||
Reference in New Issue
Block a user