Class: OpenAI::Models::Realtime::Connection

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
sig/openai/helpers/realtime/connection.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Connection

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 Connection.



22
23
24
25
26
# File 'sig/openai/helpers/realtime/connection.rbs', line 22

def initialize: (
  socket: untyped,
  url: URI::Generic,
  ?recovery: untyped
) -> void

Instance Attribute Details

#conversation ⇒ OpenAI::Realtime::ConnectionResources::Conversation (readonly)

Returns the value of attribute conversation.



18
19
20
# File 'sig/openai/helpers/realtime/connection.rbs', line 18

def conversation
  @conversation
end

#input_audio_buffer ⇒ OpenAI::Realtime::ConnectionResources::InputAudioBuffer (readonly)

Returns the value of attribute input_audio_buffer.



19
20
21
# File 'sig/openai/helpers/realtime/connection.rbs', line 19

def input_audio_buffer
  @input_audio_buffer
end

#response ⇒ OpenAI::Realtime::ConnectionResources::Response (readonly)

Returns the value of attribute response.



17
18
19
# File 'sig/openai/helpers/realtime/connection.rbs', line 17

def response
  @response
end

#session ⇒ OpenAI::Realtime::ConnectionResources::Session (readonly)

Returns the value of attribute session.



16
17
18
# File 'sig/openai/helpers/realtime/connection.rbs', line 16

def session
  @session
end

#url ⇒ URI::Generic (readonly)

Returns the value of attribute url.



15
16
17
# File 'sig/openai/helpers/realtime/connection.rbs', line 15

def url
  @url
end

Instance Method Details

#abort ⇒ nil

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.



44
# File 'sig/openai/helpers/realtime/connection.rbs', line 44

def abort: -> nil

#close ⇒ nil



41
# File 'sig/openai/helpers/realtime/connection.rbs', line 41

def close: (?code: Integer, ?reason: String) -> nil

#closed? ⇒ Boolean



48
# File 'sig/openai/helpers/realtime/connection.rbs', line 48

def closed?: -> bool

#each ⇒ Enumerator[OpenAI::Models::Realtime::connection_server_event, self] #each ⇒ self

Yields:

Yield Parameters:

  • event (OpenAI::Models::Realtime::connection_server_event)

Yield Returns:

  • (void)


27
28
29
30
31
# File 'sig/openai/helpers/realtime/connection.rbs', line 27

def each:
-> Enumerator[OpenAI::Models::Realtime::connection_server_event, self]
| {
  (OpenAI::Models::Realtime::connection_server_event event) -> void
} -> self

#enable_no_status_recovery ⇒ nil

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.



47
# File 'sig/openai/helpers/realtime/connection.rbs', line 47

def enable_no_status_recovery: -> nil

#flush_pending ⇒ nil



52
# File 'sig/openai/helpers/realtime/connection.rbs', line 52

def flush_pending: -> nil

#parse_event ⇒ OpenAI::Models::Realtime::connection_server_event



34
35
36
# File 'sig/openai/helpers/realtime/connection.rbs', line 34

def parse_event: (
  String data
) -> OpenAI::Models::Realtime::connection_server_event

#pending_messages ⇒ Array[String]



50
# File 'sig/openai/helpers/realtime/connection.rbs', line 50

def pending_messages: -> Array[String]

#receive ⇒ OpenAI::Models::Realtime::connection_server_event?



32
# File 'sig/openai/helpers/realtime/connection.rbs', line 32

def receive: -> OpenAI::Models::Realtime::connection_server_event?

#receive_raw ⇒ String?



33
# File 'sig/openai/helpers/realtime/connection.rbs', line 33

def receive_raw: -> String?

#reconnecting? ⇒ Boolean



49
# File 'sig/openai/helpers/realtime/connection.rbs', line 49

def reconnecting?: -> bool

#send_event ⇒ nil



37
38
39
# File 'sig/openai/helpers/realtime/connection.rbs', line 37

def send_event: (
  OpenAI::Models::Realtime::connection_client_event event
) -> nil

#send_raw ⇒ nil



40
# File 'sig/openai/helpers/realtime/connection.rbs', line 40

def send_raw: (String data) -> nil

#take_pending_messages ⇒ Array[String]



51
# File 'sig/openai/helpers/realtime/connection.rbs', line 51

def take_pending_messages: -> Array[String]