feat: log increments
This commit is contained in:
@@ -26,6 +26,7 @@ class Captain::Conversation::ResponseBuilderJob < ApplicationJob
|
||||
return process_action('handoff') if handoff_requested?
|
||||
|
||||
create_messages
|
||||
Rails.logger.info("[CAPTAIN][ResponseBuilderJob] Incrementing response usage for #{account.id}")
|
||||
account.increment_response_usage
|
||||
end
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ class Captain::Copilot::ChatService
|
||||
|
||||
def execute(input)
|
||||
@agent.execute(input, conversation_history_context)
|
||||
Rails.logger.info("[CAPTAIN][CopilotChatService] Incrementing response usage for #{account.id}")
|
||||
@assistant.account.increment_response_usage
|
||||
end
|
||||
|
||||
|
||||
@@ -14,11 +14,17 @@ class CaptainListener < BaseListener
|
||||
|
||||
def generate_notes(assistant, conversation)
|
||||
Captain::Llm::ContactNotesService.new(assistant, conversation).generate_and_update_notes
|
||||
conversation.account.increment_response_usage
|
||||
|
||||
account = conversation.account
|
||||
Rails.logger.info("[CAPTAIN][ContactNotesService] Incrementing response usage for #{account.id}")
|
||||
account.increment_response_usage
|
||||
end
|
||||
|
||||
def generate_faqs(assistant, conversation)
|
||||
Captain::Llm::ConversationFaqService.new(assistant, conversation).generate_and_deduplicate
|
||||
conversation.account.increment_response_usage
|
||||
|
||||
account = conversation.account
|
||||
Rails.logger.info("[CAPTAIN][ConversationFaqService] Incrementing response usage for #{account.id}")
|
||||
account.increment_response_usage
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user