class Vellum::WorkflowExecutionActualChatHistoryRequest

def self.from_json(json_object:)

Returns:
  • (WorkflowExecutionActualChatHistoryRequest) -

Parameters:
  • json_object (JSON) --
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
  timestamp = struct.timestamp
  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: timestamp,
      desired_output_value: desired_output_value, additional_properties: struct)
end

def self.validate_raw(obj:)

Returns:
  • (Void) -

Parameters:
  • obj (Object) --
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.timestamp&.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

def initialize(output_id: nil, output_key: nil, quality: nil, timestamp: nil, desired_output_value: nil,

Returns:
  • (WorkflowExecutionActualChatHistoryRequest) -

Parameters:
  • additional_properties (OpenStruct) -- Additional properties unmapped to the current class definition
  • desired_output_value (Array) -- Optionally provide the value that the output ideally should have been.
  • timestamp (Float) -- Optionally provide the timestamp representing when this feedback was collected. Used for reporting purposes.
  • quality (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.
  • output_key (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_id (String) -- The Vellum-generated ID of a workflow output. Must provide either this or output_key. output_key is typically preferred.
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 = 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

def to_json(*_args)

Returns:
  • (JSON) -
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