Skip to content

Conversation

@deyaaeldeen
Copy link
Contributor

Support Azure Realtime API

In order to do so, this PR refactors the OpenAIRealtimeWebSocket and OpenAIRealtimeWS classes to improve the handling of asynchronous operations required during WebSocket connection setup.

Key Changes

1. New open Method

  • Previously, the WebSocket connection was established in the class constructor, which could not handle async operations like fetching Azure AD tokens.
  • The new open method enables asynchronous fetching of the Azure AD token and establishes the WebSocket connection afterward.

2. New getAzureADToken Method in AzureOpenAI

  • Adds a getAzureADToken method in the AzureOpenAI class to provide refreshed Azure AD tokens.
  • The OpenAIRealtimeWebSocket class now uses the AzureOpenAI instance to retrieve the necessary Azure AD token for establishing the WebSocket connection.

@deyaaeldeen
Copy link
Contributor Author

Closing in favor of #1283

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant