Class: Tools::Enabler
- Inherits:
-
RubyLLM::Tool
- Object
- RubyLLM::Tool
- Tools::Enabler
- Defined in:
- lib/shared_tools/tools/enabler.rb
Overview
A tool for reading the contents of a file.
Instance Attribute Summary collapse
-
#agent ⇒ Object
readonly
Returns the value of attribute agent.
Instance Method Summary collapse
- #execute(tool:, params: '') ⇒ Object
-
#initialize(agent) ⇒ Enabler
constructor
param :params, desc: ‘JSON formatted parameters’.
Constructor Details
#initialize(agent) ⇒ Enabler
param :params, desc: ‘JSON formatted parameters’
30 31 32 |
# File 'lib/shared_tools/tools/enabler.rb', line 30 def initialize(agent) @agent = agent end |
Instance Attribute Details
#agent ⇒ Object (readonly)
Returns the value of attribute agent.
22 23 24 |
# File 'lib/shared_tools/tools/enabler.rb', line 22 def agent @agent end |
Instance Method Details
#execute(tool:, params: '') ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/shared_tools/tools/enabler.rb', line 34 def execute(tool:, params: '') agent.add_tool(tool) # TODO: call the tool with the params and return the result. { success: true } rescue StandardError => e { error: e. } end |