mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
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:
1 parent
1d3b0ba916
commit
c976afac31
3 files changed
+6
-6
No files matched your search
@@ -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
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
Reference in new issue
Block a user