Class: SmartAgent::ToolContext
- Inherits:
-
Object
- Object
- SmartAgent::ToolContext
- Defined in:
- lib/smart_agent/tool.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#input_params ⇒ Object
Returns the value of attribute input_params.
-
#proc ⇒ Object
Returns the value of attribute proc.
Instance Method Summary collapse
- #call_worker(name, params) ⇒ Object
- #desc(description) ⇒ Object
-
#initialize(tool) ⇒ ToolContext
constructor
A new instance of ToolContext.
- #param_define(name, description, type) ⇒ Object
- #params ⇒ Object
- #tool_proc(&block) ⇒ Object
Constructor Details
#initialize(tool) ⇒ ToolContext
Returns a new instance of ToolContext.
59 60 61 |
# File 'lib/smart_agent/tool.rb', line 59 def initialize(tool) @tool = tool end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
57 58 59 |
# File 'lib/smart_agent/tool.rb', line 57 def description @description end |
#input_params ⇒ Object
Returns the value of attribute input_params.
57 58 59 |
# File 'lib/smart_agent/tool.rb', line 57 def input_params @input_params end |
#proc ⇒ Object
Returns the value of attribute proc.
57 58 59 |
# File 'lib/smart_agent/tool.rb', line 57 def proc @proc end |
Instance Method Details
#call_worker(name, params) ⇒ Object
75 76 77 78 |
# File 'lib/smart_agent/tool.rb', line 75 def call_worker(name, params) params[:with_history] = false SmartAgent.prompt_engine.call_worker(name, params) end |
#desc(description) ⇒ Object
71 72 73 |
# File 'lib/smart_agent/tool.rb', line 71 def desc(description) @description = description end |
#param_define(name, description, type) ⇒ Object
67 68 69 |
# File 'lib/smart_agent/tool.rb', line 67 def param_define(name, description, type) params[name] = { description: description, type: type } end |
#params ⇒ Object
63 64 65 |
# File 'lib/smart_agent/tool.rb', line 63 def params @params ||= {} end |
#tool_proc(&block) ⇒ Object
80 81 82 |
# File 'lib/smart_agent/tool.rb', line 80 def tool_proc(&block) @proc = block end |