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:
KernelDeimos
2025-03-24 15:50:39 -04:00
committed by Eric Dubé
parent 7a2851d2cc
commit 617fb49178
@@ -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,