mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-07-08 23:32:45 +00:00
This PR enhances the LLM triage automation with several important improvements: - Add ability to use AI personas for automated replies instead of canned replies - Add support for whisper responses - Refactor LLM persona reply functionality into a reusable method - Add new settings to configure response behavior in automations - Improve error handling and logging - Fix handling of personal messages in the triage flow - Add comprehensive test coverage for new features - Make personas configurable with more flexible requirements This allows for more dynamic and context-aware responses in automated workflows, with better control over visibility and attribution.
22 lines
553 B
Ruby
22 lines
553 B
Ruby
# frozen_string_literal: true
|
|
module DiscourseAi
|
|
module Automation
|
|
module LlmPersonaTriage
|
|
def self.handle(post:, persona_id:, whisper: false, automation: nil)
|
|
DiscourseAi::AiBot::Playground.reply_to_post(
|
|
post: post,
|
|
persona_id: persona_id,
|
|
whisper: whisper,
|
|
)
|
|
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
|