Class: LanggraphPlatform::Models::ThreadState

Inherits:
Object
  • Object
show all
Defined in:
lib/langgraph_platform/models/thread_state.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ ThreadState

Returns a new instance of ThreadState.



6
7
8
9
10
11
12
13
# File 'lib/langgraph_platform/models/thread_state.rb', line 6

def initialize(attributes)
  @values = attributes['values']
  @next = attributes['next']
  @checkpoint = attributes['checkpoint']
  @metadata = attributes['metadata'] || {}
  @created_at = parse_time(attributes['created_at'])
  @parent_checkpoint = attributes['parent_checkpoint']
end

Instance Attribute Details

#checkpoint ⇒ Object (readonly)

Returns the value of attribute checkpoint.



4
5
6
# File 'lib/langgraph_platform/models/thread_state.rb', line 4

def checkpoint
  @checkpoint
end

#created_at ⇒ Object (readonly)

Returns the value of attribute created_at.



4
5
6
# File 'lib/langgraph_platform/models/thread_state.rb', line 4

def created_at
  @created_at
end

#metadata ⇒ Object (readonly)

Returns the value of attribute metadata.



4
5
6
# File 'lib/langgraph_platform/models/thread_state.rb', line 4

def 
  @metadata
end

#next ⇒ Object (readonly)

Returns the value of attribute next.



4
5
6
# File 'lib/langgraph_platform/models/thread_state.rb', line 4

def next
  @next
end

#parent_checkpoint ⇒ Object (readonly)

Returns the value of attribute parent_checkpoint.



4
5
6
# File 'lib/langgraph_platform/models/thread_state.rb', line 4

def parent_checkpoint
  @parent_checkpoint
end

#values ⇒ Object (readonly)

Returns the value of attribute values.



4
5
6
# File 'lib/langgraph_platform/models/thread_state.rb', line 4

def values
  @values
end

Instance Method Details

#to_h ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/langgraph_platform/models/thread_state.rb', line 15

def to_h
  {
    values: @values,
    next: @next,
    checkpoint: @checkpoint,
    metadata: @metadata,
    created_at: @created_at,
    parent_checkpoint: @parent_checkpoint
  }
end

#to_json(*args) ⇒ Object



26
27
28
# File 'lib/langgraph_platform/models/thread_state.rb', line 26

def to_json(*args)
  to_h.to_json(*args)
end