Class: OpenAI::Models::Live::Error

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/live/error.rb,
sig/openai/models/live/error.rbs

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, #inspect, inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, coerce_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(code:, message:, type:, client_event_id: nil, param: nil) ⇒ Error

Returns a new instance of Error.

Parameters:

  • code —

    A machine-readable code identifying the Live error, such as unknown_parameter.

  • message —

    A human-readable explanation of the Live error.

  • type —

    The category of error, such as invalid_request_error for an invalid Live client command.

  • client_event_id (defaults to: nil) —

    The event_id of the client command that caused the error, when supplied.

  • param (defaults to: nil) —

    The parameter that caused the error, when applicable, such as session.voice.

  • code: (String)
  • message: (String)
  • type: (String)
  • client_event_id: (String) (defaults to: nil)
  • param: (String) (defaults to: nil)


# File 'lib/openai/models/live/error.rb', line 38

Instance Attribute Details

#client_event_id ⇒ String?

The event_id of the client command that caused the error, when supplied.

Returns:

  • (String, nil)


30
# File 'lib/openai/models/live/error.rb', line 30

optional :client_event_id, String

#code ⇒ String

A machine-readable code identifying the Live error, such as unknown_parameter.

Returns:

  • (String)


11
# File 'lib/openai/models/live/error.rb', line 11

required :code, String

#message ⇒ String

A human-readable explanation of the Live error.

Returns:

  • (String)


17
# File 'lib/openai/models/live/error.rb', line 17

required :message, String

#param ⇒ String?

The parameter that caused the error, when applicable, such as session.voice.

Returns:

  • (String, nil)


36
# File 'lib/openai/models/live/error.rb', line 36

optional :param, String

#type ⇒ String

The category of error, such as invalid_request_error for an invalid Live client command.

Returns:

  • (String)


24
# File 'lib/openai/models/live/error.rb', line 24

required :type, String

Instance Method Details

#to_hash ⇒ { code: String, message: String, type: String, ?client_event_id: String, ?param: String }

Returns:

  • ({ code: String, message: String, type: String, ?client_event_id: String, ?param: String })


55
56
57
58
59
60
61
# File 'sig/openai/models/live/error.rbs', line 55

def to_hash: -> {
  code: String,
  message: String,
  type: String,
  ?client_event_id: String,
  ?param: String
}