Class: RobotLab::ToolCallHookContext
- Inherits:
-
HookContext
- Object
- HookContext
- RobotLab::ToolCallHookContext
- Defined in:
- lib/robot_lab/hook_context.rb
Instance Attribute Summary collapse
-
#robot ⇒ Object
readonly
Returns the value of attribute robot.
-
#tool ⇒ Object
readonly
Returns the value of attribute tool.
-
#tool_args ⇒ Object
readonly
Returns the value of attribute tool_args.
-
#tool_error ⇒ Object
Returns the value of attribute tool_error.
-
#tool_name ⇒ Object
readonly
Returns the value of attribute tool_name.
-
#tool_result ⇒ Object
Returns the value of attribute tool_result.
Attributes inherited from HookContext
Instance Method Summary collapse
-
#initialize(tool:, tool_args:, robot: nil, tool_result: nil, tool_error: nil) ⇒ ToolCallHookContext
constructor
A new instance of ToolCallHookContext.
Methods inherited from HookContext
#ext, #local, #to_h, #with_namespace
Constructor Details
#initialize(tool:, tool_args:, robot: nil, tool_result: nil, tool_error: nil) ⇒ ToolCallHookContext
Returns a new instance of ToolCallHookContext.
77 78 79 80 81 82 83 84 85 |
# File 'lib/robot_lab/hook_context.rb', line 77 def initialize(tool:, tool_args:, robot: nil, tool_result: nil, tool_error: nil, **) super(event: :tool_call, **) @tool = tool @tool_name = tool.respond_to?(:name) ? tool.name : tool.class.name @tool_args = tool_args @robot = robot @tool_result = tool_result @tool_error = tool_error end |
Instance Attribute Details
#robot ⇒ Object (readonly)
Returns the value of attribute robot.
74 75 76 |
# File 'lib/robot_lab/hook_context.rb', line 74 def robot @robot end |
#tool ⇒ Object (readonly)
Returns the value of attribute tool.
74 75 76 |
# File 'lib/robot_lab/hook_context.rb', line 74 def tool @tool end |
#tool_args ⇒ Object (readonly)
Returns the value of attribute tool_args.
74 75 76 |
# File 'lib/robot_lab/hook_context.rb', line 74 def tool_args @tool_args end |
#tool_error ⇒ Object
Returns the value of attribute tool_error.
75 76 77 |
# File 'lib/robot_lab/hook_context.rb', line 75 def tool_error @tool_error end |
#tool_name ⇒ Object (readonly)
Returns the value of attribute tool_name.
74 75 76 |
# File 'lib/robot_lab/hook_context.rb', line 74 def tool_name @tool_name end |
#tool_result ⇒ Object
Returns the value of attribute tool_result.
75 76 77 |
# File 'lib/robot_lab/hook_context.rb', line 75 def tool_result @tool_result end |