fix(ai-gateway-provider): support Azure OpenAI v1 responses routing#604
Open
hith3sh wants to merge 1 commit into
Open
fix(ai-gateway-provider): support Azure OpenAI v1 responses routing#604hith3sh wants to merge 1 commit into
hith3sh wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: c0b4038 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Azure Responses API models created with useDeploymentBasedUrls: false
generate URLs like https://<resource>.openai.azure.com/openai/v1/responses,
which the shared gateway provider matcher did not recognize, so wrapped
Azure responses models failed with 'provider "azure.responses" is
currently not supported'.
Map /openai/v1/responses... to the gateway's azure-openai endpoint shape
({resource}/openai/responses..., Azure's non-deployment Responses route)
while keeping deployment-based routing unchanged. The match is deliberately
scoped to responses: other v1 paths (chat, embeddings) have no
non-deployment Azure route, so they stay unmatched with a clear error
instead of routing to an endpoint that 404s at Azure.
Changeset covers ai-gateway-provider and workers-ai-provider, which share
the matcher via gateway-core.
Closes cloudflare#399
ac9416b to
c0b4038
Compare
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.
Summary
/openai/v1/responses...requests to the gateway'sazure-openaiendpoint shape ({resource}/openai/responses..., Azure's non-deployment Responses route)responses: other v1 paths (chat, embeddings) have no non-deployment Azure route to map to, so they stay unmatched (clear "provider not supported" error) instead of routing to an endpoint that 404s at Azure — a negative test locks this increateAzure(...).responses(...)ai-gateway-providerandworkers-ai-provider, which share the matcher viagateway-coreWhy
ai-gateway-providercould already route deployment-based Azure URLsuseDeploymentBasedUrls: falsegenerate URLs likehttps://<resource>.openai.azure.com/openai/v1/responses?...provider "azure.responses" is currently not supportedValidation
pnpm exec vitest run packages/ai-gateway-provider/test/endpoint.test.ts packages/ai-gateway-provider/test/request-shaping.test.ts packages/gateway-core/test/gateway-providers.test.ts packages/workers-ai-provider/test/gateway-providers.test.tsCloses #399