This is a rather huge refactor with 1 new feature (tool details can be suppressed) Previously we use the name "Command" to describe "Tools", this unifies all the internal language and simplifies the code. We also amended the persona UI to use less DToggles which aligns with our design guidelines. Co-authored-by: Martin Brennan <[email protected]>
26 lines
576 B
Ruby
26 lines
576 B
Ruby
# 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
|
|
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
|