Class: Vellum::WorkflowExecutionActualChatHistoryRequest
- Inherits:
-
Object
- Object
- Vellum::WorkflowExecutionActualChatHistoryRequest
- Defined in:
- lib/vellum_ai/types/workflow_execution_actual_chat_history_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:) ⇒ WorkflowExecutionActualChatHistoryRequest
Deserialize a JSON object to an instance of WorkflowExecutionActualChatHistoryRequest.
-
.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) ⇒ WorkflowExecutionActualChatHistoryRequest constructor
-
#to_json(*_args) ⇒ JSON
Serialize an instance of WorkflowExecutionActualChatHistoryRequest to a JSON object.
Constructor Details
#initialize(output_id: nil, output_key: nil, quality: nil, timestamp: nil, desired_output_value: nil, additional_properties: nil) ⇒ WorkflowExecutionActualChatHistoryRequest
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 17 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 [Array<ChatMessageRequest>] 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.
8 9 10 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 8 def additional_properties @additional_properties end |
#desired_output_value ⇒ Object (readonly)
Returns the value of attribute desired_output_value.
8 9 10 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 8 def desired_output_value @desired_output_value end |
#output_id ⇒ Object (readonly)
Returns the value of attribute output_id.
8 9 10 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 8 def output_id @output_id end |
#output_key ⇒ Object (readonly)
Returns the value of attribute output_key.
8 9 10 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 8 def output_key @output_key end |
#quality ⇒ Object (readonly)
Returns the value of attribute quality.
8 9 10 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 8 def quality @quality end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
8 9 10 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 8 def @timestamp end |
Class Method Details
.from_json(json_object:) ⇒ WorkflowExecutionActualChatHistoryRequest
Deserialize a JSON object to an instance of WorkflowExecutionActualChatHistoryRequest
37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 37 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) output_id = struct.output_id output_key = struct.output_key quality = struct.quality = struct. desired_output_value = parsed_json["desired_output_value"].map do |v| v = v.to_json ChatMessageRequest.from_json(json_object: v) end 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.
69 70 71 72 73 74 75 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 69 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?(Array) != 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 WorkflowExecutionActualChatHistoryRequest to a JSON object
55 56 57 58 59 60 61 62 63 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 55 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 |