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
178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/langgraph_rb/observers/base.rb', line 178 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 = Time.now.utc end |
Instance Attribute Details
#active_nodes ⇒ Object (readonly)
Returns the value of attribute active_nodes.
175 176 177 |
# File 'lib/langgraph_rb/observers/base.rb', line 175 def active_nodes @active_nodes end |
#completed_nodes ⇒ Object (readonly)
Returns the value of attribute completed_nodes.
175 176 177 |
# File 'lib/langgraph_rb/observers/base.rb', line 175 def completed_nodes @completed_nodes end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
175 176 177 |
# File 'lib/langgraph_rb/observers/base.rb', line 175 def duration @duration end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
175 176 177 |
# File 'lib/langgraph_rb/observers/base.rb', line 175 def state @state end |
#step_number ⇒ Object (readonly)
Returns the value of attribute step_number.
175 176 177 |
# File 'lib/langgraph_rb/observers/base.rb', line 175 def step_number @step_number end |
#thread_id ⇒ Object (readonly)
Returns the value of attribute thread_id.
175 176 177 |
# File 'lib/langgraph_rb/observers/base.rb', line 175 def thread_id @thread_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
175 176 177 |
# File 'lib/langgraph_rb/observers/base.rb', line 175 def end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
175 176 177 |
# File 'lib/langgraph_rb/observers/base.rb', line 175 def type @type end |
Instance Method Details
#to_h ⇒ Object
190 191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/langgraph_rb/observers/base.rb', line 190 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: .iso8601 } end |