Class: LanggraphPlatform::Models::Run
- Inherits:
-
Object
- Object
- LanggraphPlatform::Models::Run
- Defined in:
- lib/langgraph_platform/models/run.rb
Instance Attribute Summary collapse
-
#assistant_id ⇒ Object
readonly
Returns the value of attribute assistant_id.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#kwargs ⇒ Object
readonly
Returns the value of attribute kwargs.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#multitask_strategy ⇒ Object
readonly
Returns the value of attribute multitask_strategy.
-
#run_id ⇒ Object
readonly
Returns the value of attribute run_id.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#thread_id ⇒ Object
readonly
Returns the value of attribute thread_id.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(attributes) ⇒ Run
constructor
A new instance of Run.
- #interrupted? ⇒ Boolean
- #pending? ⇒ Boolean
- #running? ⇒ Boolean
- #success? ⇒ Boolean
- #timeout? ⇒ Boolean
- #to_h ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Run
Returns a new instance of Run.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/langgraph_platform/models/run.rb', line 7 def initialize(attributes) @run_id = attributes['run_id'] @thread_id = attributes['thread_id'] @assistant_id = attributes['assistant_id'] @created_at = parse_time(attributes['created_at']) @updated_at = parse_time(attributes['updated_at']) @status = attributes['status'] @metadata = attributes['metadata'] || {} @kwargs = attributes['kwargs'] @multitask_strategy = attributes['multitask_strategy'] end |
Instance Attribute Details
#assistant_id ⇒ Object (readonly)
Returns the value of attribute assistant_id.
4 5 6 |
# File 'lib/langgraph_platform/models/run.rb', line 4 def assistant_id @assistant_id end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/langgraph_platform/models/run.rb', line 4 def created_at @created_at end |
#kwargs ⇒ Object (readonly)
Returns the value of attribute kwargs.
4 5 6 |
# File 'lib/langgraph_platform/models/run.rb', line 4 def kwargs @kwargs end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
4 5 6 |
# File 'lib/langgraph_platform/models/run.rb', line 4 def @metadata end |
#multitask_strategy ⇒ Object (readonly)
Returns the value of attribute multitask_strategy.
4 5 6 |
# File 'lib/langgraph_platform/models/run.rb', line 4 def multitask_strategy @multitask_strategy end |
#run_id ⇒ Object (readonly)
Returns the value of attribute run_id.
4 5 6 |
# File 'lib/langgraph_platform/models/run.rb', line 4 def run_id @run_id end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/langgraph_platform/models/run.rb', line 4 def status @status end |
#thread_id ⇒ Object (readonly)
Returns the value of attribute thread_id.
4 5 6 |
# File 'lib/langgraph_platform/models/run.rb', line 4 def thread_id @thread_id end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
4 5 6 |
# File 'lib/langgraph_platform/models/run.rb', line 4 def updated_at @updated_at end |
Instance Method Details
#error? ⇒ Boolean
31 32 33 |
# File 'lib/langgraph_platform/models/run.rb', line 31 def error? @status == 'error' end |
#interrupted? ⇒ Boolean
39 40 41 |
# File 'lib/langgraph_platform/models/run.rb', line 39 def interrupted? @status == 'interrupted' end |
#pending? ⇒ Boolean
19 20 21 |
# File 'lib/langgraph_platform/models/run.rb', line 19 def pending? @status == 'pending' end |
#running? ⇒ Boolean
23 24 25 |
# File 'lib/langgraph_platform/models/run.rb', line 23 def running? @status == 'running' end |
#success? ⇒ Boolean
27 28 29 |
# File 'lib/langgraph_platform/models/run.rb', line 27 def success? @status == 'success' end |
#timeout? ⇒ Boolean
35 36 37 |
# File 'lib/langgraph_platform/models/run.rb', line 35 def timeout? @status == 'timeout' end |
#to_h ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/langgraph_platform/models/run.rb', line 43 def to_h { run_id: @run_id, thread_id: @thread_id, assistant_id: @assistant_id, created_at: @created_at, updated_at: @updated_at, status: @status, metadata: @metadata, kwargs: @kwargs, multitask_strategy: @multitask_strategy } end |
#to_json(*args) ⇒ Object
57 58 59 |
# File 'lib/langgraph_platform/models/run.rb', line 57 def to_json(*args) to_h.to_json(*args) end |