Sam 52a7dd2a4b
FEATURE: optional tool detail blocks (#662)
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 <martin@discourse.org>
2024-06-11 18:14:14 +10:00

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