Migrate AzureOpenAiProvider from Prism to dedicated gateway#404
Merged
taylorotwell merged 13 commits into0.xfrom Apr 16, 2026
Merged
Migrate AzureOpenAiProvider from Prism to dedicated gateway#404taylorotwell merged 13 commits into0.xfrom
taylorotwell merged 13 commits into0.xfrom
Conversation
84d9ca7 to
6da0703
Compare
Drops all Azure-specific Chat Completions concerns and reuses the OpenAI gateway concerns directly. Keeps only the Azure-specific HTTP client (api-key header auth, /openai base path with api-version query param). Embeddings continue to use the deployment-specific path. Updates all Azure tests and helpers to match the Responses API format.
The cognitiveservices.azure.com endpoint uses /openai/v1/responses and /openai/v1/embeddings (OpenAI-compatible v1 path, no api-version param). This matches how Prism was wiring Azure — buildAzureBaseUrl() appended /openai/v1 to the resource URL before passing it through as the base URL. Also simplifies embeddingsClient back into client since both text and embeddings share the same /openai/v1 base path.
Azure rejects tool schemas with strict: true when not all properties are required. Override mapTool to send parameters without strict or additionalProperties, matching Prism's previous behaviour.
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.
Replaces
PrismGatewaywith a dedicatedAzureOpenAiGatewayfor the Azure OpenAI provider, continuing the ongoing migration away from the Prism abstraction layer. This brings Azure in line with Groq, Mistral, and other providers that already have individual gateways.Approach
AzureOpenAiGatewayimplementingTextGatewayandEmbeddingGatewayusing the Chat Completions API formatapi-keyheader authentication andapi-versionquery parameterGatewayabstractionazuremapping fromPrismGateway::toPrismProvider()