Class: SolidAgent::Generators::ToolGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- SolidAgent::Generators::ToolGenerator
- Defined in:
- lib/generators/solid_agent/tool/tool_generator.rb
Instance Method Summary collapse
Instance Method Details
#create_tool_template ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/generators/solid_agent/tool/tool_generator.rb', line 24 def create_tool_template if [:inline] say "Inline tool definition for #{agent_name}:", :green say "" say inline_tool_definition say "" else @tool_description = [:description].presence || "#{name.humanize} tool" @parameters = parse_parameters template "tool.json.erb", tool_template_path say "Created tool template: #{tool_template_path}", :green end end |
#show_method_stub ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/generators/solid_agent/tool/tool_generator.rb', line 39 def show_method_stub say "" say "Add this method to your #{agent_name}:", :yellow say "" say tool_method_stub say "" if [:inline] say "Add this to your agent class:", :yellow say "" say inline_tool_definition say "" else say "Don't forget to register the tool in your agent:", :yellow say "" say " has_tools :#{name}" say "" end end |