Class: Boxcars::AgentEvent
- Inherits:
-
Object
- Object
- Boxcars::AgentEvent
- Defined in:
- lib/boxcars/agent_event.rb
Overview
Lightweight immutable event emitted during agent execution. Captures what the agent is doing at each step without affecting execution.
Constant Summary collapse
- TYPES =
%i[ agent_start llm_call_start llm_response tool_call_start tool_call_blocked tool_call_end handoff agent_complete agent_error ].freeze
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#iteration ⇒ Object
readonly
Returns the value of attribute iteration.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type:, data: {}, iteration: 0) ⇒ AgentEvent
constructor
A new instance of AgentEvent.
Constructor Details
#initialize(type:, data: {}, iteration: 0) ⇒ AgentEvent
Returns a new instance of AgentEvent.
24 25 26 27 28 29 30 31 |
# File 'lib/boxcars/agent_event.rb', line 24 def initialize(type:, data: {}, iteration: 0) raise ::ArgumentError, "Unknown event type: #{type}" unless TYPES.include?(type) @type = type @data = data.freeze @timestamp = Time.now @iteration = iteration end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
19 20 21 |
# File 'lib/boxcars/agent_event.rb', line 19 def data @data end |
#iteration ⇒ Object (readonly)
Returns the value of attribute iteration.
19 20 21 |
# File 'lib/boxcars/agent_event.rb', line 19 def iteration @iteration end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
19 20 21 |
# File 'lib/boxcars/agent_event.rb', line 19 def @timestamp end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
19 20 21 |
# File 'lib/boxcars/agent_event.rb', line 19 def type @type end |