Uh oh!
There was an error while loading. Please reload this page.
fix(app): support anthropic models on azure cognitive services - #9000
fix(app): support anthropic models on azure cognitive services#9000uanandaraja wants to merge 2 commits into
Conversation
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR: Related PR:
The PR #8566 could be worth reviewing to ensure there's no overlap with your current fix. The other results returned were the current PR itself (#9000) or unrelated feature PRs. |
rekram1-node
commented
Jan 17, 2026
/review |
lgtm |
a6e242d to
d1f8fc0Compareuanandaraja
commented
Jan 19, 2026
are we good here? @rekram1-node |
rekram1-node
commented
Jan 19, 2026
I actually have a simpler solution if u wanna test it |
rekram1-node
commented
Jan 19, 2026
@uanandaraja try this? |
it says RESOURCE NOT FOUND, different env variable? ![]() |
rekram1-node
commented
Jan 19, 2026
Hm may need a tweak but do you see what I'm trying to do? everything should live in that one module it shouldnt require edits outside of it |
| }, | ||
| ) | ||
| // Azure Cognitive Services with Claude models uses Anthropic SDK |
There was a problem hiding this comment.
this change shouldnt be needed
| export function providerOptions(model: Provider.Model, options: { [x: string]: any }) { | ||
| // Azure Cognitive Services with Claude models uses Anthropic provider options | ||
| const isAzureClaude = model.providerID === "azure-cognitive-services" && model.api.id.includes("claude") |
There was a problem hiding this comment.
this change shouldnt be needed
| // Anthropic rejects messages with empty content - filter out empty string messages | ||
| // and remove empty text/reasoning parts from array content | ||
| if (model.api.npm === "@ai-sdk/anthropic") { | ||
| const isAzureClaude = model.providerID === "azure-cognitive-services" && model.api.id.includes("claude") |
| if (id.includes("deepseek") || id.includes("minimax") || id.includes("glm") || id.includes("mistral")) return {} | ||
| // Azure Cognitive Services with Claude models uses Anthropic thinking config | ||
| const isAzureClaude = model.providerID === "azure-cognitive-services" && model.api.id.includes("claude") |
There was a problem hiding this comment.
i dont think this should be needed
| // Special case: google-vertex-anthropic uses a subpath import | ||
| const bundledKey = | ||
| model.providerID === "google-vertex-anthropic" ? "@ai-sdk/google-vertex/anthropic" : model.api.npm | ||
| model.providerID === "google-vertex-anthropic" |
| } | ||
| // Special case: Azure Cognitive Services with Anthropic models uses @ai-sdk/anthropic | ||
| const isAzureClaude = model.providerID === "azure-cognitive-services" && model.api.id.includes("claude") |
There was a problem hiding this comment.
you would also need to handle if the resourceName is being passed as a provider option for the provider
f1ae801 to
08fa7f7Compare
When using Anthropic models (like claude-opus-4.5) via Azure Cognitive Services, the code was using
@ai-sdk/azureSDK which tries to callsdk.responses(modelID). But@ai-sdk/azuredoesn't support Anthropic models - Azure's Anthropic endpoint uses a different API structure that requires@ai-sdk/anthropic.