Class: LangGraphRB::Observers::StepEvent
- Inherits:
-
Object
- Object
- LangGraphRB::Observers::StepEvent
- Defined in:
- lib/langgraph_rb/observers/base.rb
Instance Attribute Summary collapse
-
#active_nodes ⇒ Object
readonly
Returns the value of attribute active_nodes.
-
#completed_nodes ⇒ Object
readonly
Returns the value of attribute completed_nodes.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#step_number ⇒ Object
readonly
Returns the value of attribute step_number.
-
#thread_id ⇒ Object
readonly
Returns the value of attribute thread_id.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type:, step_number:, active_nodes: [], completed_nodes: [], thread_id: nil, state: nil, duration: nil) ⇒ StepEvent
constructor
A new instance of StepEvent.
- #to_h ⇒ Object
Constructor Details
#initialize(type:, step_number:, active_nodes: [], completed_nodes: [], thread_id: nil, state: nil, duration: nil) ⇒ StepEvent
Returns a new instance of StepEvent.
162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/langgraph_rb/observers/base.rb', line 162 def initialize(type:, step_number:, active_nodes: [], completed_nodes: [], thread_id: nil, state: nil, duration: nil) @type = type @step_number = step_number @active_nodes = active_nodes @completed_nodes = completed_nodes @thread_id = thread_id @state = state @duration = duration @timestamp = Time.now.utc end |
Instance Attribute Details
#active_nodes ⇒ Object (readonly)
Returns the value of attribute active_nodes.
159 160 161 |
# File 'lib/langgraph_rb/observers/base.rb', line 159 def active_nodes @active_nodes end |
#completed_nodes ⇒ Object (readonly)
Returns the value of attribute completed_nodes.
159 160 161 |
# File 'lib/langgraph_rb/observers/base.rb', line 159 def completed_nodes @completed_nodes end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
159 160 161 |
# File 'lib/langgraph_rb/observers/base.rb', line 159 def duration @duration end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
159 160 161 |
# File 'lib/langgraph_rb/observers/base.rb', line 159 def state @state end |
#step_number ⇒ Object (readonly)
Returns the value of attribute step_number.
159 160 161 |
# File 'lib/langgraph_rb/observers/base.rb', line 159 def step_number @step_number end |
#thread_id ⇒ Object (readonly)
Returns the value of attribute thread_id.
159 160 161 |
# File 'lib/langgraph_rb/observers/base.rb', line 159 def thread_id @thread_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
159 160 161 |
# File 'lib/langgraph_rb/observers/base.rb', line 159 def @timestamp end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
159 160 161 |
# File 'lib/langgraph_rb/observers/base.rb', line 159 def type @type end |
Instance Method Details
#to_h ⇒ Object
174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/langgraph_rb/observers/base.rb', line 174 def to_h { type: @type, step_number: @step_number, active_nodes: @active_nodes, completed_nodes: @completed_nodes, thread_id: @thread_id, state: @state, duration_ms: @duration ? (@duration * 1000).round(2) : nil, timestamp: @timestamp.iso8601 } end |