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 intoanomalyco:devfrom
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. |
|
/review |
|
lgtm |
a6e242d to
d1f8fc0
Compare
|
are we good here? @rekram1-node |
|
I actually have a simpler solution if u wanna test it |
|
@uanandaraja try this? |
it says RESOURCE NOT FOUND, different env variable?
|
|
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") |
There was a problem hiding this comment.
this shouldnt be needed
| 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" |
There was a problem hiding this comment.
This shouldnt be needed
| } | ||
|
|
||
| // 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
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare

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.