mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-07-08 23:32:45 +00:00
This allows for a new mode in persona triage where nothing is posted on topics. This allows people to perform all triage actions using tools Additionally introduces new APIs to create chat messages from tools which can be useful in certain moderation scenarios Co-authored-by: Natalie Tay <natalie.tay@gmail.com> * remove TODO code --------- Co-authored-by: Natalie Tay <natalie.tay@gmail.com>
23 lines
609 B
Ruby
23 lines
609 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,
|
|
)
|
|
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
|