Class: Events::ToolExecuted
- Inherits:
-
Object
- Object
- Events::ToolExecuted
- Defined in:
- lib/events/tool_executed.rb
Overview
Emitted by ToolExecutionJob after a tool finishes running. Carries the tool result so the response subscriber can create a tool_response PendingMessage and release the session back to idle — which in turn wakes the drain loop for the next LLM round.
Constant Summary collapse
- TYPE =
"session.tool_executed"
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#session_id ⇒ Object
readonly
Returns the value of attribute session_id.
-
#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.
Instance Method Summary collapse
- #event_name ⇒ Object
-
#initialize(session_id:, tool_use_id:, tool_name:, content:, success:) ⇒ ToolExecuted
constructor
A new instance of ToolExecuted.
- #to_h ⇒ Object
Constructor Details
#initialize(session_id:, tool_use_id:, tool_name:, content:, success:) ⇒ ToolExecuted
Returns a new instance of ToolExecuted.
18 19 20 21 22 23 24 |
# File 'lib/events/tool_executed.rb', line 18 def initialize(session_id:, tool_use_id:, tool_name:, content:, success:) @session_id = session_id @tool_use_id = tool_use_id @tool_name = tool_name @content = content @success = success end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
11 12 13 |
# File 'lib/events/tool_executed.rb', line 11 def content @content end |
#session_id ⇒ Object (readonly)
Returns the value of attribute session_id.
11 12 13 |
# File 'lib/events/tool_executed.rb', line 11 def session_id @session_id end |
#success ⇒ Object (readonly)
Returns the value of attribute success.
11 12 13 |
# File 'lib/events/tool_executed.rb', line 11 def success @success end |
#tool_name ⇒ Object (readonly)
Returns the value of attribute tool_name.
11 12 13 |
# File 'lib/events/tool_executed.rb', line 11 def tool_name @tool_name end |
#tool_use_id ⇒ Object (readonly)
Returns the value of attribute tool_use_id.
11 12 13 |
# File 'lib/events/tool_executed.rb', line 11 def tool_use_id @tool_use_id end |
Instance Method Details
#event_name ⇒ Object
26 27 28 |
# File 'lib/events/tool_executed.rb', line 26 def event_name "#{Bus::NAMESPACE}.#{TYPE}" end |
#to_h ⇒ Object
30 31 32 |
# File 'lib/events/tool_executed.rb', line 30 def to_h {type: TYPE, session_id:, tool_use_id:, tool_name:, content:, success:} end |