mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-07-01 12:02:16 +00:00
This change moves all the personas code into its own module. We want to treat them as a building block features can built on top of, same as `Completions::Llm`. The code to title a message was moved from `Bot` to `Playground`.
18 lines
473 B
Ruby
18 lines
473 B
Ruby
# frozen_string_literal: true
|
|
module DiscourseAi
|
|
module Automation
|
|
module LlmToolTriage
|
|
def self.handle(post:, tool_id:, automation: nil)
|
|
tool = AiTool.find_by(id: tool_id)
|
|
return if !tool
|
|
return if !tool.parameters.blank?
|
|
|
|
context = DiscourseAi::Personas::BotContext.new(post: post)
|
|
|
|
runner = tool.runner({}, llm: nil, bot_user: Discourse.system_user, context: context)
|
|
runner.invoke
|
|
end
|
|
end
|
|
end
|
|
end
|