class Vellum::RejectedExecutePromptEvent

The final data returned indicating an error occurred during the stream.

def self.from_json(json_object:)

Returns:
  • (RejectedExecutePromptEvent) -

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["error"].nil?
    error = nil
  else
    error = parsed_json["error"].to_json
    error = VellumError.from_json(json_object: error)
  end
  execution_id = struct.execution_id
  if parsed_json["meta"].nil?
    meta = nil
  else
    meta = parsed_json["meta"].to_json
    meta = RejectedPromptExecutionMeta.from_json(json_object: meta)
  end
  new(error: error, execution_id: execution_id, meta: meta, additional_properties: struct)
end

def self.validate_raw(obj:)

Returns:
  • (Void) -

Parameters:
  • obj (Object) --
def self.validate_raw(obj:)
  VellumError.validate_raw(obj: obj.error)
  obj.execution_id.is_a?(String) != false || raise("Passed value for field obj.execution_id is not the expected type, validation failed.")
  obj.meta.nil? || RejectedPromptExecutionMeta.validate_raw(obj: obj.meta)
end

def initialize(error:, execution_id:, meta: nil, additional_properties: nil)

Returns:
  • (RejectedExecutePromptEvent) -

Parameters:
  • additional_properties (OpenStruct) -- Additional properties unmapped to the current class definition
  • meta (RejectedPromptExecutionMeta) --
  • execution_id (String) --
  • error (VellumError) --
def initialize(error:, execution_id:, meta: nil, additional_properties: nil)
  # @type [VellumError]
  @error = error
  # @type [String]
  @execution_id = execution_id
  # @type [RejectedPromptExecutionMeta]
  @meta = meta
  # @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)
  { "error": @error, "execution_id": @execution_id, "meta": @meta }.to_json
end