Class: OpenAI::Responses::ConnectionManager Private
- Inherits:
-
WebSocket::ConnectionManager
- Object
- WebSocket::ConnectionManager
- OpenAI::Responses::ConnectionManager
- Defined in:
- lib/openai/helpers/responses_websocket/connection_manager.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.
Internal block-scoped lifecycle manager for Responses WebSocket connections.
Constant Summary
Constants inherited from WebSocket::ConnectionManager
WebSocket::ConnectionManager::RESERVED_TRANSPORT_OPTIONS
Instance Method Summary collapse
-
#initialize(client:, websocket_base_url:, transport:, request_options:, transport_options:) ⇒ ConnectionManager
constructor
private
A new instance of ConnectionManager.
Methods inherited from WebSocket::ConnectionManager
Constructor Details
#initialize(client:, websocket_base_url:, transport:, request_options:, transport_options:) ⇒ ConnectionManager
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 ConnectionManager.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/openai/helpers/responses_websocket/connection_manager.rb', line 10 def initialize(client:, websocket_base_url:, transport:, request_options:, transport_options:) base_url = websocket_base_url&.to_s&.dup&.freeze request = lambda do |&request_block| client.with_responses_websocket_connection_request( websocket_base_url: base_url, options: , &request_block ) end super( client: client, transport: transport, transport_options: , default_transport: -> { OpenAI::Responses::Transports::AsyncWebSocket.new }, connection_class: OpenAI::Responses::Connection, request: request, block_error_message: "A block is required to open a Responses WebSocket.", abort_after_block: lambda do |connection, pending_error| !pending_error.nil? || connection.poisoned? end ) end |