Class: OpenAI::Models::Realtime::RealtimeError

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/realtime/realtime_error.rb,
sig/openai/models/realtime/realtime_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(message:, type:, code: nil, event_id: nil, param: nil) ⇒ RealtimeError

Returns a new instance of RealtimeError.

Parameters:

  • message —

    A human-readable error message.

  • type —

    The type of error (e.g., "invalid_request_error", "server_error").

  • code (defaults to: nil) —

    Error code, if any.

  • event_id (defaults to: nil) —

    The event_id of the client event that caused the error, if applicable.

  • param (defaults to: nil) —

    Parameter related to the error, if any.

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


# File 'lib/openai/models/realtime/realtime_error.rb', line 37

Instance Attribute Details

#code ⇒ String?

Error code, if any.

Returns:

  • (String, nil)


23
# File 'lib/openai/models/realtime/realtime_error.rb', line 23

optional :code, String, nil?: true

#event_id ⇒ String?

The event_id of the client event that caused the error, if applicable.

Returns:

  • (String, nil)


29
# File 'lib/openai/models/realtime/realtime_error.rb', line 29

optional :event_id, String, nil?: true

#message ⇒ String

A human-readable error message.

Returns:

  • (String)


11
# File 'lib/openai/models/realtime/realtime_error.rb', line 11

required :message, String

#param ⇒ String?

Parameter related to the error, if any.

Returns:

  • (String, nil)


35
# File 'lib/openai/models/realtime/realtime_error.rb', line 35

optional :param, String, nil?: true

#type ⇒ String

The type of error (e.g., "invalid_request_error", "server_error").

Returns:

  • (String)


17
# File 'lib/openai/models/realtime/realtime_error.rb', line 17

required :type, String

Instance Method Details

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

Returns:

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


47
48
49
50
51
52
53
# File 'sig/openai/models/realtime/realtime_error.rbs', line 47

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