mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-07-01 20:12:15 +00:00
22 lines
549 B
Ruby
22 lines
549 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 = {
|
||
|
post_id: post.id,
|
||
|
automation_id: automation&.id,
|
||
|
automation_name: automation&.name,
|
||
|
}
|
||
|
|
||
|
runner = tool.runner({}, llm: nil, bot_user: Discourse.system_user, context: context)
|
||
|
runner.invoke
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|