Fix parse_azure_endpoint passing query string to AsyncAzureOpenAI#231
Merged
gvanrossum merged 2 commits intomicrosoft:mainfrom Apr 10, 2026
Merged
Fix parse_azure_endpoint passing query string to AsyncAzureOpenAI#231gvanrossum merged 2 commits intomicrosoft:mainfrom
gvanrossum merged 2 commits intomicrosoft:mainfrom
Conversation
uv 0.10.x is current; the <0.10.0 constraint caused build warnings.
parse_azure_endpoint returned the raw URL including ?api-version=... which AsyncAzureOpenAI then mangled into invalid paths like ...?api-version=2024-06-01/openai/. Strip the query string before returning — api_version is already returned as a separate value and passed to the SDK independently.
This was referenced Apr 10, 2026
Collaborator
|
this break current setup, e.g. .env files containing URLs with api version information (which is the default in Azure Foundry setup). |
bmerkle
added a commit
to bmerkle/typeagent-py
that referenced
this pull request
Apr 13, 2026
Updated parse_azure_endpoint in utils.py:200 to strip the /openai/deployments/... path from the endpoint URL. Previously it only removed the query string, leaving the full deployment path — which AsyncAzureOpenAI then duplicated, causing the 404. Updated test_online.py to use create_chat_model() → model._model.request() — the same _make_azure_provider → AzureProvider(openai_client=AsyncAzureOpenAI(...)) code path used by the rest of the codebase.
gvanrossum
pushed a commit
that referenced
this pull request
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stack: 1/4 — merge this first, then #229, #230, #232.
parse_azure_endpointreturned the full URL including?api-version=...AsyncAzureOpenAIappends/openai/toazure_endpoint, producing a mangled URL with the query string in the pathstr.split("?", 1)[0]before returningBenchmark
No performance impact — this is a correctness fix.
Generated by codeflash optimization agent