Class: Events::ToolResponse
Constant Summary collapse
- TYPE =
"tool_response"
Instance Attribute Summary collapse
-
#success ⇒ Object
readonly
Returns the value of attribute success.
-
#tool_name ⇒ Object
readonly
Returns the value of attribute tool_name.
-
#tool_use_id ⇒ Object
readonly
Returns the value of attribute tool_use_id.
Attributes inherited from Base
#content, #session_id, #timestamp
Instance Method Summary collapse
-
#initialize(content:, tool_name:, success: true, tool_use_id: nil, session_id: nil) ⇒ ToolResponse
constructor
A new instance of ToolResponse.
- #success? ⇒ Boolean
- #to_h ⇒ Object
- #type ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(content:, tool_name:, success: true, tool_use_id: nil, session_id: nil) ⇒ ToolResponse
Returns a new instance of ToolResponse.
14 15 16 17 18 19 |
# File 'lib/events/tool_response.rb', line 14 def initialize(content:, tool_name:, success: true, tool_use_id: nil, session_id: nil) super(content: content, session_id: session_id) @tool_name = tool_name @success = success @tool_use_id = tool_use_id end |
Instance Attribute Details
#success ⇒ Object (readonly)
Returns the value of attribute success.
7 8 9 |
# File 'lib/events/tool_response.rb', line 7 def success @success end |
#tool_name ⇒ Object (readonly)
Returns the value of attribute tool_name.
7 8 9 |
# File 'lib/events/tool_response.rb', line 7 def tool_name @tool_name end |
#tool_use_id ⇒ Object (readonly)
Returns the value of attribute tool_use_id.
7 8 9 |
# File 'lib/events/tool_response.rb', line 7 def tool_use_id @tool_use_id end |
Instance Method Details
#success? ⇒ Boolean
25 26 27 |
# File 'lib/events/tool_response.rb', line 25 def success? @success end |
#to_h ⇒ Object
29 30 31 |
# File 'lib/events/tool_response.rb', line 29 def to_h super.merge(tool_name: tool_name, success: success, tool_use_id: tool_use_id) end |
#type ⇒ Object
21 22 23 |
# File 'lib/events/tool_response.rb', line 21 def type TYPE end |