Class: OpenAI::Realtime::UnknownServerEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/openai/helpers/realtime/unknown_server_event.rb

Overview

A valid JSON event whose discriminator is newer than this SDK version.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data:) ⇒ UnknownServerEvent

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of UnknownServerEvent.



14
15
16
17
18
19
20
21
22
23
# File 'lib/openai/helpers/realtime/unknown_server_event.rb', line 14

def initialize(data:)
  value = data.fetch(:type)
  unless value.is_a?(String) || value.is_a?(Symbol)
    raise ArgumentError, "Realtime server event type must be a string or symbol"
  end

  @type = value.to_sym
  @data = freeze_json(data)
  freeze
end

Instance Attribute Details

#dataHash{Symbol=>Object} (readonly)

Returns:

  • (Hash{Symbol=>Object})


11
12
13
# File 'lib/openai/helpers/realtime/unknown_server_event.rb', line 11

def data
  @data
end

#typeSymbol (readonly)

Returns:

  • (Symbol)


8
9
10
# File 'lib/openai/helpers/realtime/unknown_server_event.rb', line 8

def type
  @type
end

Instance Method Details

#to_hHash{Symbol=>Object}

Returns:

  • (Hash{Symbol=>Object})


26
# File 'lib/openai/helpers/realtime/unknown_server_event.rb', line 26

def to_h = @data