feat: allow azure openai to pass custom uri #920
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.
Title:
feat: allow azure openai to pass custom uri
Description: (optional)
This pull request introduces support for a custom Azure URI for OpenAI requests. The following changes have been made:
Header Handling:
Updated constructConfigFromRequestHeaders to extract the azureCustomUri from the incoming request headers. This enables the passing of a custom URI from the client.
Provider Configuration:
Modified AzureOpenAIAPIConfig in src/providers/azure-openai/api.ts to use the azureCustomUri when constructing the base URL for API requests.
Updated the endpoint resolution logic so that if a custom URI is provided, the URL structure is adapted accordingly (e.g., DeepSeek-R1 on Azure uses {resourceName}.services.ai.azure.com/models).
Type Definitions:
Extended the Options interface in src/types/requestBody.ts to include the azureCustomUri field.
Motivation: (optional)
This enhancement is necessary to support scenarios where a non-standard Azure endpoint is required (such as DeepSeek-R1). By allowing users to pass a custom URI, we provide greater flexibility and ensure compatibility with alternative endpoint configurations.
Related Issues: (optional)