Skip to content

Commit 9592010

Browse files
committed
fix(azure): make anthropic-version configurable for azure-anthropic provider
1 parent 571360c commit 9592010

File tree

5 files changed

+8
-12
lines changed

5 files changed

+8
-12
lines changed

apps/sim/blocks/blocks/agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ Return ONLY the JSON array.`,
337337
connectionDroppable: false,
338338
condition: {
339339
field: 'model',
340-
value: providers['azure-openai'].models,
340+
value: [...providers['azure-openai'].models, ...providers['azure-anthropic'].models],
341341
},
342342
},
343343
{

apps/sim/blocks/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export function getProviderCredentialSubBlocks(): SubBlockConfig[] {
129129
connectionDroppable: false,
130130
condition: {
131131
field: 'model',
132-
value: providers['azure-openai'].models,
132+
value: [...providers['azure-openai'].models, ...providers['azure-anthropic'].models],
133133
},
134134
},
135135
{

apps/sim/executor/handlers/evaluator/evaluator-handler.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,7 @@ export class EvaluatorBlockHandler implements BlockHandler {
132132

133133
if (providerId === 'azure-openai' || providerId === 'azure-anthropic') {
134134
providerRequest.azureEndpoint = inputs.azureEndpoint
135-
if (providerId === 'azure-openai') {
136-
providerRequest.azureApiVersion = inputs.azureApiVersion
137-
}
135+
providerRequest.azureApiVersion = inputs.azureApiVersion
138136
}
139137

140138
if (providerId === 'bedrock') {

apps/sim/executor/handlers/router/router-handler.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@ export class RouterBlockHandler implements BlockHandler {
107107

108108
if (providerId === 'azure-openai' || providerId === 'azure-anthropic') {
109109
providerRequest.azureEndpoint = inputs.azureEndpoint
110-
if (providerId === 'azure-openai') {
111-
providerRequest.azureApiVersion = inputs.azureApiVersion
112-
}
110+
providerRequest.azureApiVersion = inputs.azureApiVersion
113111
}
114112

115113
if (providerId === 'bedrock') {
@@ -266,9 +264,7 @@ export class RouterBlockHandler implements BlockHandler {
266264

267265
if (providerId === 'azure-openai' || providerId === 'azure-anthropic') {
268266
providerRequest.azureEndpoint = inputs.azureEndpoint
269-
if (providerId === 'azure-openai') {
270-
providerRequest.azureApiVersion = inputs.azureApiVersion
271-
}
267+
providerRequest.azureApiVersion = inputs.azureApiVersion
272268
}
273269

274270
if (providerId === 'bedrock') {

apps/sim/providers/azure-anthropic/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export const azureAnthropicProvider: ProviderConfig = {
3535
// The SDK appends /v1/messages automatically
3636
const baseURL = `${request.azureEndpoint.replace(/\/$/, '')}/anthropic`
3737

38+
const anthropicVersion = request.azureApiVersion || '2023-06-01'
39+
3840
return executeAnthropicProviderRequest(
3941
{
4042
...request,
@@ -49,7 +51,7 @@ export const azureAnthropicProvider: ProviderConfig = {
4951
apiKey,
5052
defaultHeaders: {
5153
'api-key': apiKey,
52-
'anthropic-version': '2023-06-01',
54+
'anthropic-version': anthropicVersion,
5355
...(useNativeStructuredOutputs
5456
? { 'anthropic-beta': 'structured-outputs-2025-11-13' }
5557
: {}),

0 commit comments

Comments
 (0)