Class: Vellum::SlimWorkflowExecutionRead
- Inherits:
-
Object
- Object
- Vellum::SlimWorkflowExecutionRead
- Defined in:
- lib/vellum_ai/types/slim_workflow_execution_read.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #end_ ⇒ DateTime readonly
- #error ⇒ Vellum::WorkflowError readonly
- #inputs ⇒ Array<Vellum::ExecutionVellumValue> readonly
- #latest_actual ⇒ Vellum::WorkflowExecutionActual readonly
- #metric_results ⇒ Array<Vellum::WorkflowExecutionViewOnlineEvalMetricResult> readonly
- #outputs ⇒ Array<Vellum::ExecutionVellumValue> readonly
- #parent_context ⇒ Vellum::WorkflowDeploymentParentContext readonly
- #span_id ⇒ String readonly
- #start ⇒ DateTime readonly
- #usage_results ⇒ Array<Vellum::WorkflowExecutionUsageResult> readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(span_id:, parent_context: OMIT, start:, end_: OMIT, inputs:, outputs:, error: OMIT, latest_actual: OMIT, metric_results:, usage_results: OMIT, additional_properties: nil) ⇒ Vellum::SlimWorkflowExecutionRead constructor
- #to_json ⇒ String
Constructor Details
#initialize(span_id:, parent_context: OMIT, start:, end_: OMIT, inputs:, outputs:, error: OMIT, latest_actual: OMIT, metric_results:, usage_results: OMIT, additional_properties: nil) ⇒ Vellum::SlimWorkflowExecutionRead
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/vellum_ai/types/slim_workflow_execution_read.rb', line 55 def initialize(span_id:, parent_context: OMIT, start:, end_: OMIT, inputs:, outputs:, error: OMIT, latest_actual: OMIT, metric_results:, usage_results: OMIT, additional_properties: nil) @span_id = span_id @parent_context = parent_context if parent_context != OMIT @start = start @end_ = end_ if end_ != OMIT @inputs = inputs @outputs = outputs @error = error if error != OMIT @latest_actual = latest_actual if latest_actual != OMIT @metric_results = metric_results @usage_results = usage_results if usage_results != OMIT @additional_properties = additional_properties @_field_set = { "span_id": span_id, "parent_context": parent_context, "start": start, "end": end_, "inputs": inputs, "outputs": outputs, "error": error, "latest_actual": latest_actual, "metric_results": metric_results, "usage_results": usage_results }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
36 37 38 |
# File 'lib/vellum_ai/types/slim_workflow_execution_read.rb', line 36 def additional_properties @additional_properties end |
#end_ ⇒ DateTime (readonly)
22 23 24 |
# File 'lib/vellum_ai/types/slim_workflow_execution_read.rb', line 22 def end_ @end_ end |
#error ⇒ Vellum::WorkflowError (readonly)
28 29 30 |
# File 'lib/vellum_ai/types/slim_workflow_execution_read.rb', line 28 def error @error end |
#inputs ⇒ Array<Vellum::ExecutionVellumValue> (readonly)
24 25 26 |
# File 'lib/vellum_ai/types/slim_workflow_execution_read.rb', line 24 def inputs @inputs end |
#latest_actual ⇒ Vellum::WorkflowExecutionActual (readonly)
30 31 32 |
# File 'lib/vellum_ai/types/slim_workflow_execution_read.rb', line 30 def latest_actual @latest_actual end |
#metric_results ⇒ Array<Vellum::WorkflowExecutionViewOnlineEvalMetricResult> (readonly)
32 33 34 |
# File 'lib/vellum_ai/types/slim_workflow_execution_read.rb', line 32 def metric_results @metric_results end |
#outputs ⇒ Array<Vellum::ExecutionVellumValue> (readonly)
26 27 28 |
# File 'lib/vellum_ai/types/slim_workflow_execution_read.rb', line 26 def outputs @outputs end |
#parent_context ⇒ Vellum::WorkflowDeploymentParentContext (readonly)
18 19 20 |
# File 'lib/vellum_ai/types/slim_workflow_execution_read.rb', line 18 def parent_context @parent_context end |
#span_id ⇒ String (readonly)
16 17 18 |
# File 'lib/vellum_ai/types/slim_workflow_execution_read.rb', line 16 def span_id @span_id end |
#start ⇒ DateTime (readonly)
20 21 22 |
# File 'lib/vellum_ai/types/slim_workflow_execution_read.rb', line 20 def start @start end |
#usage_results ⇒ Array<Vellum::WorkflowExecutionUsageResult> (readonly)
34 35 36 |
# File 'lib/vellum_ai/types/slim_workflow_execution_read.rb', line 34 def usage_results @usage_results end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::SlimWorkflowExecutionRead
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/vellum_ai/types/slim_workflow_execution_read.rb', line 75 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) span_id = parsed_json["span_id"] unless parsed_json["parent_context"].nil? parent_context = parsed_json["parent_context"].to_json parent_context = Vellum::WorkflowDeploymentParentContext.from_json(json_object: parent_context) else parent_context = nil end start = unless parsed_json["start"].nil? DateTime.parse(parsed_json["start"]) else nil end end_ = unless parsed_json["end"].nil? DateTime.parse(parsed_json["end"]) else nil end inputs = parsed_json["inputs"]&.map do | item | item = item.to_json Vellum::ExecutionVellumValue.from_json(json_object: item) end outputs = parsed_json["outputs"]&.map do | item | item = item.to_json Vellum::ExecutionVellumValue.from_json(json_object: item) end unless parsed_json["error"].nil? error = parsed_json["error"].to_json error = Vellum::WorkflowError.from_json(json_object: error) else error = nil end unless parsed_json["latest_actual"].nil? latest_actual = parsed_json["latest_actual"].to_json latest_actual = Vellum::WorkflowExecutionActual.from_json(json_object: latest_actual) else latest_actual = nil end metric_results = parsed_json["metric_results"]&.map do | item | item = item.to_json Vellum::WorkflowExecutionViewOnlineEvalMetricResult.from_json(json_object: item) end usage_results = parsed_json["usage_results"]&.map do | item | item = item.to_json Vellum::WorkflowExecutionUsageResult.from_json(json_object: item) end new( span_id: span_id, parent_context: parent_context, start: start, end_: end_, inputs: inputs, outputs: outputs, error: error, latest_actual: latest_actual, metric_results: metric_results, usage_results: usage_results, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/vellum_ai/types/slim_workflow_execution_read.rb', line 149 def self.validate_raw(obj:) obj.span_id.is_a?(String) != false || raise("Passed value for field obj.span_id is not the expected type, validation failed.") obj.parent_context.nil? || Vellum::WorkflowDeploymentParentContext.validate_raw(obj: obj.parent_context) obj.start.is_a?(DateTime) != false || raise("Passed value for field obj.start is not the expected type, validation failed.") obj.end_&.is_a?(DateTime) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.") obj.inputs.is_a?(Array) != false || raise("Passed value for field obj.inputs is not the expected type, validation failed.") obj.outputs.is_a?(Array) != false || raise("Passed value for field obj.outputs is not the expected type, validation failed.") obj.error.nil? || Vellum::WorkflowError.validate_raw(obj: obj.error) obj.latest_actual.nil? || Vellum::WorkflowExecutionActual.validate_raw(obj: obj.latest_actual) obj.metric_results.is_a?(Array) != false || raise("Passed value for field obj.metric_results is not the expected type, validation failed.") obj.usage_results&.is_a?(Array) != false || raise("Passed value for field obj.usage_results is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
140 141 142 |
# File 'lib/vellum_ai/types/slim_workflow_execution_read.rb', line 140 def to_json @_field_set&.to_json end |