Class: OpenAI::Responses::Transports::AsyncWebSocket Private

Inherits:
WebSocket::AsyncWebSocketTransport show all
Defined in:
lib/openai/helpers/responses_websocket/transports/async_websocket.rb

Overview

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

Responses facade for the shared optional async WebSocket transport.

Instance Method Summary collapse

Methods inherited from WebSocket::AsyncWebSocketTransport

#open

Constructor Details

#initializeAsyncWebSocket

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



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/openai/helpers/responses_websocket/transports/async_websocket.rb', line 10

def initialize
  error_factory = lambda do |url:, message: nil, http_status: nil, **_options|
    OpenAI::Errors::ResponsesConnectionError.new(
      url: url,
      message: message,
      http_status: http_status
    )
  end

  super(
    product_name: "Responses",
    error_class: OpenAI::Errors::ResponsesConnectionError,
    error_factory: error_factory,
    dependency_message: "Responses WebSockets require the async-websocket gem. Add it to your Gemfile."
  )
end