class Vellum::FulfilledExecutePromptResponse
The successful response from the model containing all of the resolved values generated by the prompt.
def self.from_json(json_object:)
-
(FulfilledExecutePromptResponse)-
Parameters:
-
json_object(JSON) --
def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) if parsed_json["meta"].nil? meta = nil else meta = parsed_json["meta"].to_json meta = PromptExecutionMeta.from_json(json_object: meta) end raw = struct.raw execution_id = struct.execution_id outputs = parsed_json["outputs"].map do |v| v = v.to_json PromptOutput.from_json(json_object: v) end new(meta: meta, raw: raw, execution_id: execution_id, outputs: outputs, additional_properties: struct) end
def self.validate_raw(obj:)
-
(Void)-
Parameters:
-
obj(Object) --
def self.validate_raw(obj:) obj.meta.nil? || PromptExecutionMeta.validate_raw(obj: obj.meta) obj.raw&.is_a?(Hash) != false || raise("Passed value for field obj.raw is not the expected type, validation failed.") obj.execution_id.is_a?(String) != false || raise("Passed value for field obj.execution_id is not the expected type, validation failed.") obj.outputs.is_a?(Array) != false || raise("Passed value for field obj.outputs is not the expected type, validation failed.") end
def initialize(execution_id:, outputs:, meta: nil, raw: nil, additional_properties: nil)
-
(FulfilledExecutePromptResponse)-
Parameters:
-
additional_properties(OpenStruct) -- Additional properties unmapped to the current class definition -
outputs(Array) -- -
execution_id(String) -- The ID of the execution. -
raw(Hash{String => String}) -- The subset of the raw response from the model that the request opted into with `expand_raw`. -
meta(PromptExecutionMeta) --
def initialize(execution_id:, outputs:, meta: nil, raw: nil, additional_properties: nil) # @type [PromptExecutionMeta] @meta = meta # @type [Hash{String => String}] The subset of the raw response from the model that the request opted into with `expand_raw`. @raw = raw # @type [String] The ID of the execution. @execution_id = execution_id # @type [Array<PromptOutput>] @outputs = outputs # @type [OpenStruct] Additional properties unmapped to the current class definition @additional_properties = additional_properties end
def to_json(*_args)
-
(JSON)-
def to_json(*_args) { "meta": @meta, "raw": @raw, "execution_id": @execution_id, "outputs": @outputs }.to_json end