fix: remove apac bedrock region and add us region (#36881)

* fix: remove apac bedrock region and add us region

* fix: update test
This commit is contained in:
divit authored and GitHub committed 2025-07-07 09:53:08 +05:30
1 parent 1d3b0ba916
commit c976afac31
3 files changed
+6 -6

No files matched your search

+2 -2
View File
@@ -35,9 +35,9 @@ async function vercelOidcProvider() {
}
export const bedrockRegionMap = {
us: 'us-east-1',
us1: 'us-east-1',
us2: 'us-east-2',
eu: 'eu-central-1',
apac: 'ap-southeast-1',
} as const
export type BedrockRegion = keyof typeof bedrockRegionMap
+1 -1
View File
@@ -32,7 +32,7 @@ describe('getModel', () => {
console.log('Model:', model)
expect(model).toEqual('bedrock-model')
expect(bedrockModule.bedrockForRegion).toHaveBeenCalledWith('us')
expect(bedrockModule.bedrockForRegion).toHaveBeenCalledWith('us1')
expect(error).toBeUndefined()
})
+3 -3
View File
@@ -9,9 +9,9 @@ import {
export const modelsByProvider = {
bedrock: {
us: 'us.anthropic.claude-3-7-sonnet-20250219-v1:0',
us1: 'us.anthropic.claude-3-7-sonnet-20250219-v1:0',
us2: 'us.anthropic.claude-3-7-sonnet-20250219-v1:0',
eu: 'eu.anthropic.claude-3-7-sonnet-20250219-v1:0',
apac: 'apac.anthropic.claude-3-7-sonnet-20250219-v1:0',
},
openai: 'gpt-4.1-2025-04-14',
}
@@ -43,7 +43,7 @@ export async function getModel(routingKey?: string): Promise<ModelResponse> {
if (hasAwsCredentials) {
// Select the Bedrock region based on the routing key
const bedrockRegion: BedrockRegion = routingKey ? await selectBedrockRegion(routingKey) : 'us'
const bedrockRegion: BedrockRegion = routingKey ? await selectBedrockRegion(routingKey) : 'us1'
const bedrock = bedrockForRegion(bedrockRegion)
const modelName = modelsByProvider.bedrock[bedrockRegion]