fix: return response correctly

This commit is contained in:
Shivam Mishra
2025-01-20 17:07:23 +05:30
parent 6a3d23c11a
commit 906171462f
@@ -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