Class: Vellum::WorkflowExecutionViewOnlineEvalMetricResult

Inherits:
Object
  • Object
show all
Defined in:
lib/vellum_ai/types/workflow_execution_view_online_eval_metric_result.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(outputs:, label:, metric_id:, additional_properties: nil) ⇒ Vellum::WorkflowExecutionViewOnlineEvalMetricResult

Parameters:

  • outputs (Array<Vellum::ExecutionVellumValue>)
  • label (String)
  • metric_id (String)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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

#labelString (readonly)

Returns:

  • (String)


11
12
13
# File 'lib/vellum_ai/types/workflow_execution_view_online_eval_metric_result.rb', line 11

def label
  @label
end

#metric_idString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/vellum_ai/types/workflow_execution_view_online_eval_metric_result.rb', line 13

def metric_id
  @metric_id
end

#outputsArray<Vellum::ExecutionVellumValue> (readonly)

Returns:



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

Parameters:

  • json_object (String)

Returns:



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

Parameters:

  • obj (Object)

Returns:

  • (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_jsonString

Returns:

  • (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