Class: Vellum::WorkflowExecutionViewOnlineEvalMetricResult
- Inherits:
-
Object
- Object
- Vellum::WorkflowExecutionViewOnlineEvalMetricResult
- Defined in:
- lib/vellum_ai/types/workflow_execution_view_online_eval_metric_result.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #label ⇒ String readonly
- #metric_id ⇒ String readonly
- #outputs ⇒ Array<Vellum::ExecutionVellumValue> readonly
Class Method Summary collapse
- .from_json(json_object:) ⇒ Vellum::WorkflowExecutionViewOnlineEvalMetricResult
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(outputs:, label:, metric_id:, additional_properties: nil) ⇒ Vellum::WorkflowExecutionViewOnlineEvalMetricResult constructor
- #to_json ⇒ String
Constructor Details
#initialize(outputs:, label:, metric_id:, additional_properties: nil) ⇒ Vellum::WorkflowExecutionViewOnlineEvalMetricResult
27 28 29 30 31 32 33 |
# File 'lib/vellum_ai/types/workflow_execution_view_online_eval_metric_result.rb', line 27 def initialize(outputs:, label:, metric_id:, additional_properties: nil) @outputs = outputs @label = label @metric_id = metric_id @additional_properties = additional_properties @_field_set = { "outputs": outputs, "label": label, "metric_id": metric_id } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
15 16 17 |
# File 'lib/vellum_ai/types/workflow_execution_view_online_eval_metric_result.rb', line 15 def additional_properties @additional_properties end |
#label ⇒ String (readonly)
11 12 13 |
# File 'lib/vellum_ai/types/workflow_execution_view_online_eval_metric_result.rb', line 11 def label @label end |
#metric_id ⇒ String (readonly)
13 14 15 |
# File 'lib/vellum_ai/types/workflow_execution_view_online_eval_metric_result.rb', line 13 def metric_id @metric_id end |
#outputs ⇒ Array<Vellum::ExecutionVellumValue> (readonly)
9 10 11 |
# File 'lib/vellum_ai/types/workflow_execution_view_online_eval_metric_result.rb', line 9 def outputs @outputs end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::WorkflowExecutionViewOnlineEvalMetricResult
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/vellum_ai/types/workflow_execution_view_online_eval_metric_result.rb', line 39 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) outputs = parsed_json["outputs"]&.map do | item | item = item.to_json Vellum::ExecutionVellumValue.from_json(json_object: item) end label = parsed_json["label"] metric_id = parsed_json["metric_id"] new( outputs: outputs, label: label, metric_id: metric_id, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
68 69 70 71 72 |
# File 'lib/vellum_ai/types/workflow_execution_view_online_eval_metric_result.rb', line 68 def self.validate_raw(obj:) obj.outputs.is_a?(Array) != false || raise("Passed value for field obj.outputs is not the expected type, validation failed.") obj.label.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.") obj.metric_id.is_a?(String) != false || raise("Passed value for field obj.metric_id is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
59 60 61 |
# File 'lib/vellum_ai/types/workflow_execution_view_online_eval_metric_result.rb', line 59 def to_json @_field_set&.to_json end |