discourse-ai/lib/automation/llm_persona_triage.rb
Sam cf45e6884c
FIX: persona triage should be logged to automation (#1326)
We were logging persona triage as "bot" in logs, causing some
confusions around real world usage

This amends it so we log usage to "automation - AUTOMATION NAME"
2025-05-08 12:51:36 +10:00

24 lines
669 B
Ruby

# frozen_string_literal: true
module DiscourseAi
module Automation
module LlmPersonaTriage
def self.handle(post:, persona_id:, whisper: false, silent_mode: false, automation: nil)
DiscourseAi::AiBot::Playground.reply_to_post(
post: post,
persona_id: persona_id,
whisper: whisper,
silent_mode: silent_mode,
feature_name: "automation - #{automation&.name}",
)
rescue => e
Discourse.warn_exception(
e,
message: "Error responding to: #{post&.url} in LlmPersonaTriage.handle",
)
raise e if Rails.env.test?
nil
end
end
end
end