2024-01-04 08:44:07 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module DiscourseAi
|
|
|
|
module AiBot
|
|
|
|
module Tools
|
|
|
|
class Option
|
|
|
|
attr_reader :tool, :name, :type
|
|
|
|
|
|
|
|
def initialize(tool:, name:, type:)
|
|
|
|
@tool = tool
|
|
|
|
@name = name.to_s
|
|
|
|
@type = type
|
|
|
|
end
|
|
|
|
|
|
|
|
def localized_name
|
2024-06-11 04:14:14 -04:00
|
|
|
I18n.t("discourse_ai.ai_bot.tool_options.#{tool.signature[:name]}.#{name}.name")
|
2024-01-04 08:44:07 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def localized_description
|
2024-06-11 04:14:14 -04:00
|
|
|
I18n.t("discourse_ai.ai_bot.tool_options.#{tool.signature[:name]}.#{name}.description")
|
2024-01-04 08:44:07 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|