From 906171462f9168ef398b793df4ca7e8c4cd04d3b Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Mon, 20 Jan 2025 17:07:23 +0530 Subject: [PATCH] fix: return response correctly --- enterprise/app/services/captain/copilot/chat_service.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/enterprise/app/services/captain/copilot/chat_service.rb b/enterprise/app/services/captain/copilot/chat_service.rb index 069fee569..ac172c832 100644 --- a/enterprise/app/services/captain/copilot/chat_service.rb +++ b/enterprise/app/services/captain/copilot/chat_service.rb @@ -8,9 +8,11 @@ class Captain::Copilot::ChatService end def execute(input) - @agent.execute(input, conversation_history_context) + response = @agent.execute(input, conversation_history_context) Rails.logger.info("[CAPTAIN][CopilotChatService] Incrementing response usage for #{@assistant.account.id}") @assistant.account.increment_response_usage + + response end private