Add chat_azure_anthropic() for Azure Foundry Anthropic Models#960
Open
dareneiri wants to merge 7 commits intotidyverse:mainfrom
Open
Add chat_azure_anthropic() for Azure Foundry Anthropic Models#960dareneiri wants to merge 7 commits intotidyverse:mainfrom
chat_azure_anthropic() for Azure Foundry Anthropic Models#960dareneiri wants to merge 7 commits intotidyverse:mainfrom
Conversation
… that concerns Mistral access through Foundry, which this new functionality does not directly address
Author
|
I previously wrote that this addresses #585 but that specifically mentions the ability to call Mistral models through Azure Foundry. This new function only concerns Anthropic models. Mistral models will call |
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
A new function
chat_azure_anthropic()allows users to access Anthropic models made available through Azure Foundry, which has a different access point from the existing Azure OpenAI implementation inchat_azure_openai()Azure AI Foundry exposes Anthropic models via a different endpoint format than
chat_azure_openai(), which targets*.openai.azure.comand uses the OpenAI chat completions format. This new function targets the Foundry endpoint and uses the standard Anthropic Messages API format (x-api-key,anthropic-version: 2023-06-01), meaning it inherits all existingProviderAnthropicbehaviour — streaming, tool calling, structured data extraction, prompt caching, batch chat, and image/PDF support — with no additional implementation required.Changes
chat_azure_anthropic()which connects to Anthropic models hosted at*.services.ai.azure.com/anthropicImplementation details
ProviderAzureAnthropicinherits fromProviderAnthropicwith no additional properties — the Foundry Anthropic endpoint uses the same API format as api.anthropic.commodelis required with no default, since the value is a user-specific Azure deployment name rather than a canonical model identifier, similar to Azure Open AIdefault_azure_anthropic_credentials()mirrorsdefault_azure_credentials()with the same priority orderTesting
tests/testthat/test-provider-azure-anthropic.R