discourse/plugins/discourse-ai/lib/agents/tools/option.rb
Sam e3fae646d4
DEV: AI persona to agent migration (#38319)
Co-authored-by: Keegan George <kgeorge13@gmail.com>
2026-03-10 15:59:45 +11:00

27 lines
679 B
Ruby
Vendored

# frozen_string_literal: true
module DiscourseAi
module Agents
module Tools
class Option
attr_reader :tool, :name, :type, :values, :default
def initialize(tool:, name:, type:, values: nil, default: nil)
@tool = tool
@name = name.to_s
@type = type
@values = values
@default = default
end
def localized_name
I18n.t("discourse_ai.ai_bot.tool_options.#{tool.signature[:name]}.#{name}.name")
end
def localized_description
I18n.t("discourse_ai.ai_bot.tool_options.#{tool.signature[:name]}.#{name}.description")
end
end
end
end
end