Class: Vellum::WorkflowExecutionActualJsonRequest
- Inherits:
-
Object
- Object
- Vellum::WorkflowExecutionActualJsonRequest
- Defined in:
- lib/vellum_ai/types/workflow_execution_actual_json_request.rb
Instance Attribute Summary collapse
-
#additional_properties ⇒ Object
readonly
Returns the value of attribute additional_properties.
-
#desired_output_value ⇒ Object
readonly
Returns the value of attribute desired_output_value.
-
#output_id ⇒ Object
readonly
Returns the value of attribute output_id.
-
#output_key ⇒ Object
readonly
Returns the value of attribute output_key.
-
#quality ⇒ Object
readonly
Returns the value of attribute quality.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ WorkflowExecutionActualJsonRequest
Deserialize a JSON object to an instance of WorkflowExecutionActualJsonRequest.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(output_id: nil, output_key: nil, quality: nil, timestamp: nil, desired_output_value: nil, additional_properties: nil) ⇒ WorkflowExecutionActualJsonRequest constructor
-
#to_json(*_args) ⇒ JSON
Serialize an instance of WorkflowExecutionActualJsonRequest to a JSON object.
Constructor Details
#initialize(output_id: nil, output_key: nil, quality: nil, timestamp: nil, desired_output_value: nil, additional_properties: nil) ⇒ WorkflowExecutionActualJsonRequest
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/vellum_ai/types/workflow_execution_actual_json_request.rb', line 16 def initialize(output_id: nil, output_key: nil, quality: nil, timestamp: nil, desired_output_value: nil, additional_properties: nil) # @type [String] The Vellum-generated ID of a workflow output. Must provide either this or output_key. output_key is typically preferred. @output_id = output_id # @type [String] The user-defined name of a workflow output. Must provide either this or output_id. Should correspond to the `Name` specified in a Final Output Node. Generally preferred over output_id. @output_key = output_key # @type [Float] Optionally provide a decimal number between 0.0 and 1.0 (inclusive) representing the quality of the output. 0 is the worst, 1 is the best. @quality = quality # @type [Float] Optionally provide the timestamp representing when this feedback was collected. Used for reporting purposes. @timestamp = # @type [Hash{String => String}] Optionally provide the value that the output ideally should have been. @desired_output_value = desired_output_value # @type [OpenStruct] Additional properties unmapped to the current class definition @additional_properties = additional_properties end |
Instance Attribute Details
#additional_properties ⇒ Object (readonly)
Returns the value of attribute additional_properties.
7 8 9 |
# File 'lib/vellum_ai/types/workflow_execution_actual_json_request.rb', line 7 def additional_properties @additional_properties end |
#desired_output_value ⇒ Object (readonly)
Returns the value of attribute desired_output_value.
7 8 9 |
# File 'lib/vellum_ai/types/workflow_execution_actual_json_request.rb', line 7 def desired_output_value @desired_output_value end |
#output_id ⇒ Object (readonly)
Returns the value of attribute output_id.
7 8 9 |
# File 'lib/vellum_ai/types/workflow_execution_actual_json_request.rb', line 7 def output_id @output_id end |
#output_key ⇒ Object (readonly)
Returns the value of attribute output_key.
7 8 9 |
# File 'lib/vellum_ai/types/workflow_execution_actual_json_request.rb', line 7 def output_key @output_key end |
#quality ⇒ Object (readonly)
Returns the value of attribute quality.
7 8 9 |
# File 'lib/vellum_ai/types/workflow_execution_actual_json_request.rb', line 7 def quality @quality end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
7 8 9 |
# File 'lib/vellum_ai/types/workflow_execution_actual_json_request.rb', line 7 def @timestamp end |
Class Method Details
.from_json(json_object:) ⇒ WorkflowExecutionActualJsonRequest
Deserialize a JSON object to an instance of WorkflowExecutionActualJsonRequest
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/vellum_ai/types/workflow_execution_actual_json_request.rb', line 36 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) JSON.parse(json_object) output_id = struct.output_id output_key = struct.output_key quality = struct.quality = struct. desired_output_value = struct.desired_output_value new(output_id: output_id, output_key: output_key, quality: quality, timestamp: , desired_output_value: desired_output_value, additional_properties: struct) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
65 66 67 68 69 70 71 |
# File 'lib/vellum_ai/types/workflow_execution_actual_json_request.rb', line 65 def self.validate_raw(obj:) obj.output_id&.is_a?(String) != false || raise("Passed value for field obj.output_id is not the expected type, validation failed.") obj.output_key&.is_a?(String) != false || raise("Passed value for field obj.output_key is not the expected type, validation failed.") obj.quality&.is_a?(Float) != false || raise("Passed value for field obj.quality is not the expected type, validation failed.") obj.&.is_a?(Float) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.") obj.desired_output_value&.is_a?(Hash) != false || raise("Passed value for field obj.desired_output_value is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ JSON
Serialize an instance of WorkflowExecutionActualJsonRequest to a JSON object
51 52 53 54 55 56 57 58 59 |
# File 'lib/vellum_ai/types/workflow_execution_actual_json_request.rb', line 51 def to_json(*_args) { "output_id": @output_id, "output_key": @output_key, "quality": @quality, "timestamp": @timestamp, "desired_output_value": @desired_output_value }.to_json end |