-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(azure): support for the Realtime API #1963
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after the configure_azure_realtime
change!
src/openai/_utils/_utils.py
Outdated
return isinstance(client, AsyncAzureOpenAI) | ||
|
||
|
||
def configure_azure_realtime(client: AzureOpenAI, model: str, extra_query: Query) -> tuple[Query, dict[str, str]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: is the reason the configure_azure_realtime
and configure_azure_realtime_async
functions are in _utils.py
because of circular imports?
I think it'd be cleaner to define these as private methods on the client classes themselves, then the __aenter__
method changes are just
if is_async_azure_client(self.__client):
extra_query, auth_headers = await self.__client._configure_realtime(self.__model, extra_query)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, that's a lot cleaner. Updated!
Would probably be a good idea to add an Azure specific example script as well? |
Sorry I just saw this. Added a simple example here: #1967 |
Changes being requested
Ensure we configure the websocket connection with the right configuration for Azure.
Additional context & links