fix(azure): remove unnecessary model parameter and require azure deployment #2123
+12
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses the reported issue with the Azure Realtime API URL generation (Issue #2120) by ensuring that the correct deployment value is used and by removing the unnecessary model query parameter. Previously, both the synchronous and asynchronous _configure_realtime methods included a model parameter that is not required by Azure, which could lead to confusion. With this update, only the deployment parameter is used, resulting in a cleaner and more accurate URL construction:
Key Changes:
The code now raises a
ValueError
if an azure_deployment is not provided, preventing misconfigurations.The model parameter has been removed from the query dictionary in both _configure_realtime methods. Only the deployment parameter, taken from
self._azure_deployment
, is now used.Both synchronous and asynchronous methods now generate the URL consistently, matching the expected format for Azure realtime connections.
Tests confirm that the URL is correctly generated when an azure_deployment is provided and that an error is raised if it is missing.
All tests have passed, so the fix is verified to work as intended. Please review the changes and let me know if you have any further feedback!