Class: Vellum::MetricDefinitionHistoryItem
- Inherits:
-
Object
- Object
- Vellum::MetricDefinitionHistoryItem
- Defined in:
- lib/vellum_ai/types/metric_definition_history_item.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #description ⇒ String readonly
- #id ⇒ String readonly
- #input_variables ⇒ Array<Vellum::VellumVariable> readonly
-
#label ⇒ String
readonly
A human-readable label for the metric.
-
#name ⇒ String
readonly
A name that uniquely identifies this metric within its workspace.
- #output_variables ⇒ Array<Vellum::VellumVariable> readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(id:, label:, name:, description:, input_variables:, output_variables:, additional_properties: nil) ⇒ Vellum::MetricDefinitionHistoryItem constructor
- #to_json ⇒ String
Constructor Details
#initialize(id:, label:, name:, description:, input_variables:, output_variables:, additional_properties: nil) ⇒ Vellum::MetricDefinitionHistoryItem
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/vellum_ai/types/metric_definition_history_item.rb', line 36 def initialize(id:, label:, name:, description:, input_variables:, output_variables:, additional_properties: nil) @id = id @label = label @name = name @description = description @input_variables = input_variables @output_variables = output_variables @additional_properties = additional_properties @_field_set = { "id": id, "label": label, "name": name, "description": description, "input_variables": input_variables, "output_variables": output_variables } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
21 22 23 |
# File 'lib/vellum_ai/types/metric_definition_history_item.rb', line 21 def additional_properties @additional_properties end |
#description ⇒ String (readonly)
15 16 17 |
# File 'lib/vellum_ai/types/metric_definition_history_item.rb', line 15 def description @description end |
#id ⇒ String (readonly)
9 10 11 |
# File 'lib/vellum_ai/types/metric_definition_history_item.rb', line 9 def id @id end |
#input_variables ⇒ Array<Vellum::VellumVariable> (readonly)
17 18 19 |
# File 'lib/vellum_ai/types/metric_definition_history_item.rb', line 17 def input_variables @input_variables end |
#label ⇒ String (readonly)
Returns A human-readable label for the metric.
11 12 13 |
# File 'lib/vellum_ai/types/metric_definition_history_item.rb', line 11 def label @label end |
#name ⇒ String (readonly)
Returns A name that uniquely identifies this metric within its workspace.
13 14 15 |
# File 'lib/vellum_ai/types/metric_definition_history_item.rb', line 13 def name @name end |
#output_variables ⇒ Array<Vellum::VellumVariable> (readonly)
19 20 21 |
# File 'lib/vellum_ai/types/metric_definition_history_item.rb', line 19 def output_variables @output_variables end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::MetricDefinitionHistoryItem
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/vellum_ai/types/metric_definition_history_item.rb', line 50 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] label = parsed_json["label"] name = parsed_json["name"] description = parsed_json["description"] input_variables = parsed_json["input_variables"]&.map do | item | item = item.to_json Vellum::VellumVariable.from_json(json_object: item) end output_variables = parsed_json["output_variables"]&.map do | item | item = item.to_json Vellum::VellumVariable.from_json(json_object: item) end new( id: id, label: label, name: name, description: description, input_variables: input_variables, output_variables: output_variables, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
87 88 89 90 91 92 93 94 |
# File 'lib/vellum_ai/types/metric_definition_history_item.rb', line 87 def self.validate_raw(obj:) obj.id.is_a?(String) != false || raise("Passed value for field obj.id 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.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.description.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.") obj.input_variables.is_a?(Array) != false || raise("Passed value for field obj.input_variables is not the expected type, validation failed.") obj.output_variables.is_a?(Array) != false || raise("Passed value for field obj.output_variables is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
78 79 80 |
# File 'lib/vellum_ai/types/metric_definition_history_item.rb', line 78 def to_json @_field_set&.to_json end |