Class: LangGraphRB::Observers::GraphEvent
- Inherits:
-
Object
- Object
- LangGraphRB::Observers::GraphEvent
- Defined in:
- lib/langgraph_rb/observers/base.rb
Overview
Event data structures
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
-
#initial_state ⇒ Object
readonly
Returns the value of attribute initial_state.
-
#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:, graph:, initial_state: nil, context: nil, thread_id: nil) ⇒ GraphEvent
constructor
A new instance of GraphEvent.
- #to_h ⇒ Object
Constructor Details
#initialize(type:, graph:, initial_state: nil, context: nil, thread_id: nil) ⇒ GraphEvent
Returns a new instance of GraphEvent.
95 96 97 98 99 100 101 102 |
# File 'lib/langgraph_rb/observers/base.rb', line 95 def initialize(type:, graph:, initial_state: nil, context: nil, thread_id: nil) @type = type @graph = graph @initial_state = initial_state @context = context @thread_id = thread_id @timestamp = Time.now.utc end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
93 94 95 |
# File 'lib/langgraph_rb/observers/base.rb', line 93 def context @context end |
#graph ⇒ Object (readonly)
Returns the value of attribute graph.
93 94 95 |
# File 'lib/langgraph_rb/observers/base.rb', line 93 def graph @graph end |
#initial_state ⇒ Object (readonly)
Returns the value of attribute initial_state.
93 94 95 |
# File 'lib/langgraph_rb/observers/base.rb', line 93 def initial_state @initial_state end |
#thread_id ⇒ Object (readonly)
Returns the value of attribute thread_id.
93 94 95 |
# File 'lib/langgraph_rb/observers/base.rb', line 93 def thread_id @thread_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
93 94 95 |
# File 'lib/langgraph_rb/observers/base.rb', line 93 def @timestamp end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
93 94 95 |
# File 'lib/langgraph_rb/observers/base.rb', line 93 def type @type end |
Instance Method Details
#to_h ⇒ Object
104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/langgraph_rb/observers/base.rb', line 104 def to_h { type: @type, graph_class: @graph.class.name, node_count: @graph.nodes.size, edge_count: @graph.edges.size, initial_state: @initial_state, context: @context, thread_id: @thread_id, timestamp: @timestamp.iso8601 } end |