Class: Vellum::WorkflowResolvedState
- Inherits:
-
Object
- Object
- Vellum::WorkflowResolvedState
- Defined in:
- lib/vellum_ai/types/workflow_resolved_state.rb
Overview
The latest execution state of a given Workflow Execution
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #previous_span_id ⇒ String readonly
- #previous_trace_id ⇒ String readonly
- #root_span_id ⇒ String readonly
- #root_trace_id ⇒ String readonly
- #span_id ⇒ String readonly
- #state ⇒ Hash{String => Object} readonly
- #timestamp ⇒ DateTime readonly
- #trace_id ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(trace_id:, timestamp:, span_id:, state:, previous_span_id: OMIT, previous_trace_id: OMIT, root_span_id: OMIT, root_trace_id: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowResolvedState constructor
- #to_json ⇒ String
Constructor Details
#initialize(trace_id:, timestamp:, span_id:, state:, previous_span_id: OMIT, previous_trace_id: OMIT, root_span_id: OMIT, root_trace_id: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowResolvedState
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/vellum_ai/types/workflow_resolved_state.rb', line 43 def initialize(trace_id:, timestamp:, span_id:, state:, previous_span_id: OMIT, previous_trace_id: OMIT, root_span_id: OMIT, root_trace_id: OMIT, additional_properties: nil) @trace_id = trace_id @timestamp = @span_id = span_id @state = state @previous_span_id = previous_span_id if previous_span_id != OMIT @previous_trace_id = previous_trace_id if previous_trace_id != OMIT @root_span_id = root_span_id if root_span_id != OMIT @root_trace_id = root_trace_id if root_trace_id != OMIT @additional_properties = additional_properties @_field_set = { "trace_id": trace_id, "timestamp": , "span_id": span_id, "state": state, "previous_span_id": previous_span_id, "previous_trace_id": previous_trace_id, "root_span_id": root_span_id, "root_trace_id": root_trace_id }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
26 27 28 |
# File 'lib/vellum_ai/types/workflow_resolved_state.rb', line 26 def additional_properties @additional_properties end |
#previous_span_id ⇒ String (readonly)
18 19 20 |
# File 'lib/vellum_ai/types/workflow_resolved_state.rb', line 18 def previous_span_id @previous_span_id end |
#previous_trace_id ⇒ String (readonly)
20 21 22 |
# File 'lib/vellum_ai/types/workflow_resolved_state.rb', line 20 def previous_trace_id @previous_trace_id end |
#root_span_id ⇒ String (readonly)
22 23 24 |
# File 'lib/vellum_ai/types/workflow_resolved_state.rb', line 22 def root_span_id @root_span_id end |
#root_trace_id ⇒ String (readonly)
24 25 26 |
# File 'lib/vellum_ai/types/workflow_resolved_state.rb', line 24 def root_trace_id @root_trace_id end |
#span_id ⇒ String (readonly)
14 15 16 |
# File 'lib/vellum_ai/types/workflow_resolved_state.rb', line 14 def span_id @span_id end |
#state ⇒ Hash{String => Object} (readonly)
16 17 18 |
# File 'lib/vellum_ai/types/workflow_resolved_state.rb', line 16 def state @state end |
#timestamp ⇒ DateTime (readonly)
12 13 14 |
# File 'lib/vellum_ai/types/workflow_resolved_state.rb', line 12 def @timestamp end |
#trace_id ⇒ String (readonly)
10 11 12 |
# File 'lib/vellum_ai/types/workflow_resolved_state.rb', line 10 def trace_id @trace_id end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::WorkflowResolvedState
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/vellum_ai/types/workflow_resolved_state.rb', line 61 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) trace_id = parsed_json["trace_id"] = unless parsed_json["timestamp"].nil? DateTime.parse(parsed_json["timestamp"]) else nil end span_id = parsed_json["span_id"] state = parsed_json["state"] previous_span_id = parsed_json["previous_span_id"] previous_trace_id = parsed_json["previous_trace_id"] root_span_id = parsed_json["root_span_id"] root_trace_id = parsed_json["root_trace_id"] new( trace_id: trace_id, timestamp: , span_id: span_id, state: state, previous_span_id: previous_span_id, previous_trace_id: previous_trace_id, root_span_id: root_span_id, root_trace_id: root_trace_id, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
100 101 102 103 104 105 106 107 108 109 |
# File 'lib/vellum_ai/types/workflow_resolved_state.rb', line 100 def self.validate_raw(obj:) obj.trace_id.is_a?(String) != false || raise("Passed value for field obj.trace_id is not the expected type, validation failed.") obj..is_a?(DateTime) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.") obj.span_id.is_a?(String) != false || raise("Passed value for field obj.span_id is not the expected type, validation failed.") obj.state.is_a?(Hash) != false || raise("Passed value for field obj.state is not the expected type, validation failed.") obj.previous_span_id&.is_a?(String) != false || raise("Passed value for field obj.previous_span_id is not the expected type, validation failed.") obj.previous_trace_id&.is_a?(String) != false || raise("Passed value for field obj.previous_trace_id is not the expected type, validation failed.") obj.root_span_id&.is_a?(String) != false || raise("Passed value for field obj.root_span_id is not the expected type, validation failed.") obj.root_trace_id&.is_a?(String) != false || raise("Passed value for field obj.root_trace_id is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
91 92 93 |
# File 'lib/vellum_ai/types/workflow_resolved_state.rb', line 91 def to_json @_field_set&.to_json end |