feat: add Azure Foundry as dedicated provider #10837
Draft
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.
Related GitHub Issue
Closes: #10782
Description
This PR attempts to address Issue #10782 by adding Azure Foundry as a dedicated provider, addressing the request from @NWessel to have a standalone provider that supports:
?api-version=2024-06-01-preview)The dedicated provider avoids Azure-specific parameter incompatibilities (such as
prompt_cache_retention) that cause issues when using Azure Foundry through the generic OpenAI provider.Implementation details:
packages/types/src/provider-settings.tsAzureFoundryHandlerAPI handler insrc/api/providers/azure-foundry.tsAzureFoundrysettings UI component inwebview-ui/src/components/settings/providers/AzureFoundry.tsxuseSelectedModelhook for azure-foundry providerTest Procedure
cd src && npx vitest run api/providers/__tests__/azure-foundry.spec.ts- all 22 tests passcd src && npx tsc --noEmitandcd webview-ui && npx tsc --noEmitpasspnpm lintpasses with no warningsManual testing steps:
https://your-endpoint.openai.azure.com/openai/deployments/your-model/chat/completions?api-version=2024-06-01-preview)Pre-Submission Checklist
Documentation Updates
Additional Notes
Feedback and guidance are welcome! This is a first attempt at implementing the dedicated Azure Foundry provider as requested.
Important
Adds Azure Foundry as a dedicated provider with full URL configuration, API key authentication, and model ID configuration, avoiding Azure-specific parameter incompatibilities.
prompt_cache_retention.azure-foundryto provider types and schema inprovider-settings.ts.AzureFoundryHandlerinazure-foundry.ts.buildApiHandler()inindex.ts.AzureFoundrycomponent inAzureFoundry.tsxfor settings UI.ApiOptions.tsxto include Azure Foundry in provider selection.settings.json.AzureFoundryHandlerinazure-foundry.spec.ts.This description was created by
for 94c2792. You can customize this summary. It will automatically update as commits are pushed.