Class: Events::ToolCall
Constant Summary collapse
- TYPE =
"tool_call"
Instance Attribute Summary collapse
-
#tool_input ⇒ Object
readonly
Returns the value of attribute tool_input.
-
#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:, tool_input: {}, tool_use_id: nil, session_id: nil) ⇒ ToolCall
constructor
A new instance of ToolCall.
- #to_h ⇒ Object
- #type ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(content:, tool_name:, tool_input: {}, tool_use_id: nil, session_id: nil) ⇒ ToolCall
Returns a new instance of ToolCall.
14 15 16 17 18 19 |
# File 'lib/events/tool_call.rb', line 14 def initialize(content:, tool_name:, tool_input: {}, tool_use_id: nil, session_id: nil) super(content: content, session_id: session_id) @tool_name = tool_name @tool_input = tool_input @tool_use_id = tool_use_id end |
Instance Attribute Details
#tool_input ⇒ Object (readonly)
Returns the value of attribute tool_input.
7 8 9 |
# File 'lib/events/tool_call.rb', line 7 def tool_input @tool_input end |
#tool_name ⇒ Object (readonly)
Returns the value of attribute tool_name.
7 8 9 |
# File 'lib/events/tool_call.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_call.rb', line 7 def tool_use_id @tool_use_id end |
Instance Method Details
#to_h ⇒ Object
25 26 27 |
# File 'lib/events/tool_call.rb', line 25 def to_h super.merge(tool_name: tool_name, tool_input: tool_input, tool_use_id: tool_use_id) end |
#type ⇒ Object
21 22 23 |
# File 'lib/events/tool_call.rb', line 21 def type TYPE end |