feat(azure): support for the Realtime API#1963
Conversation
RobertCraigie
left a comment
There was a problem hiding this comment.
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.
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.
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 |
|
It looks like the "Create releases / release (push)" action failed when this was merged, so the release was never published to PyPI. |
Thanks for calling that out. It should be released now: https://pypi.org/project/openai/1.59.2/ |
Changes being requested
Ensure we configure the websocket connection with the right configuration for Azure.
Additional context & links