Class: Vellum::WorkflowExecutionActualChatHistoryRequest
- Inherits:
-
Object
- Object
- Vellum::WorkflowExecutionActualChatHistoryRequest
- Defined in:
- lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#desired_output_value ⇒ Array<Vellum::ChatMessageRequest>
readonly
Optionally provide the value that the output ideally should have been.
-
#metadata ⇒ Hash{String => Object}
readonly
Optionally provide additional metadata about the feedback submission.
-
#output_id ⇒ Object
readonly
output_key.
-
#output_key ⇒ Object
readonly
Generally preferred over output_id.
- #output_type ⇒ String readonly
-
#quality ⇒ Object
readonly
the quality of the output.
-
#timestamp ⇒ Object
readonly
Used for reporting purposes.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Vellum::WorkflowExecutionActualChatHistoryRequest
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(output_id: OMIT, output_key: OMIT, quality: OMIT, metadata: OMIT, timestamp: OMIT, output_type:, desired_output_value: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowExecutionActualChatHistoryRequest constructor
- #to_json ⇒ String
Constructor Details
#initialize(output_id: OMIT, output_key: OMIT, quality: OMIT, metadata: OMIT, timestamp: OMIT, output_type:, desired_output_value: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowExecutionActualChatHistoryRequest
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 49 def initialize(output_id: OMIT, output_key: OMIT, quality: OMIT, metadata: OMIT, timestamp: OMIT, output_type:, desired_output_value: OMIT, additional_properties: nil) @output_id = output_id if output_id != OMIT @output_key = output_key if output_key != OMIT @quality = quality if quality != OMIT @metadata = if != OMIT @timestamp = if != OMIT @output_type = output_type @desired_output_value = desired_output_value if desired_output_value != OMIT @additional_properties = additional_properties @_field_set = { "output_id": output_id, "output_key": output_key, "quality": quality, "metadata": , "timestamp": , "output_type": output_type, "desired_output_value": desired_output_value }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
28 29 30 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 28 def additional_properties @additional_properties end |
#desired_output_value ⇒ Array<Vellum::ChatMessageRequest> (readonly)
Returns Optionally provide the value that the output ideally should have been.
26 27 28 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 26 def desired_output_value @desired_output_value end |
#metadata ⇒ Hash{String => Object} (readonly)
Returns Optionally provide additional metadata about the feedback submission.
19 20 21 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 19 def @metadata end |
#output_id ⇒ Object (readonly)
output_key. output_key is typically preferred.
10 11 12 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 10 def output_id @output_id end |
#output_key ⇒ Object (readonly)
Generally preferred over output_id.
14 15 16 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 14 def output_key @output_key end |
#output_type ⇒ String (readonly)
24 25 26 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 24 def output_type @output_type end |
#quality ⇒ Object (readonly)
the quality of the output. 0 is the worst, 1 is the best.
17 18 19 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 17 def quality @quality end |
#timestamp ⇒ Object (readonly)
Used for reporting purposes.
22 23 24 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 22 def @timestamp end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::WorkflowExecutionActualChatHistoryRequest
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 67 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) output_id = parsed_json["output_id"] output_key = parsed_json["output_key"] quality = parsed_json["quality"] = parsed_json["metadata"] = parsed_json["timestamp"] output_type = parsed_json["output_type"] desired_output_value = parsed_json["desired_output_value"]&.map do | item | item = item.to_json Vellum::ChatMessageRequest.from_json(json_object: item) end new( output_id: output_id, output_key: output_key, quality: quality, metadata: , timestamp: , output_type: output_type, desired_output_value: desired_output_value, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
104 105 106 107 108 109 110 111 112 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 104 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?(Hash) != false || raise("Passed value for field obj.metadata 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.output_type.is_a?(String) != false || raise("Passed value for field obj.output_type 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 ⇒ String
95 96 97 |
# File 'lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb', line 95 def to_json @_field_set&.to_json end |