@@ -58,6 +58,7 @@ import {
5858 BEDROCK_1M_CONTEXT_MODEL_IDS ,
5959 BEDROCK_SERVICE_TIER_MODEL_IDS ,
6060 bedrockModels ,
61+ SERVICE_TIER_KEY ,
6162 ApiProviderError ,
6263} from "@roo-code/types"
6364
@@ -1233,10 +1234,10 @@ describe("AwsBedrockHandler", () => {
12331234 const commandArg = mockConverseStreamCommand . mock . calls [ 0 ] [ 0 ] as any
12341235
12351236 // service_tier should be at the top level of the payload
1236- expect ( commandArg . service_tier ) . toBe ( "PRIORITY" )
1237+ expect ( commandArg [ SERVICE_TIER_KEY ] ) . toBe ( "PRIORITY" )
12371238 // service_tier should NOT be in additionalModelRequestFields
12381239 if ( commandArg . additionalModelRequestFields ) {
1239- expect ( commandArg . additionalModelRequestFields . service_tier ) . toBeUndefined ( )
1240+ expect ( commandArg . additionalModelRequestFields [ SERVICE_TIER_KEY ] ) . toBeUndefined ( )
12401241 }
12411242 } )
12421243
@@ -1263,10 +1264,10 @@ describe("AwsBedrockHandler", () => {
12631264 const commandArg = mockConverseStreamCommand . mock . calls [ 0 ] [ 0 ] as any
12641265
12651266 // service_tier should be at the top level of the payload
1266- expect ( commandArg . service_tier ) . toBe ( "FLEX" )
1267+ expect ( commandArg [ SERVICE_TIER_KEY ] ) . toBe ( "FLEX" )
12671268 // service_tier should NOT be in additionalModelRequestFields
12681269 if ( commandArg . additionalModelRequestFields ) {
1269- expect ( commandArg . additionalModelRequestFields . service_tier ) . toBeUndefined ( )
1270+ expect ( commandArg . additionalModelRequestFields [ SERVICE_TIER_KEY ] ) . toBeUndefined ( )
12701271 }
12711272 } )
12721273
@@ -1294,9 +1295,9 @@ describe("AwsBedrockHandler", () => {
12941295 const commandArg = mockConverseStreamCommand . mock . calls [ 0 ] [ 0 ] as any
12951296
12961297 // Service tier should NOT be included for unsupported models (at top level or in additionalModelRequestFields)
1297- expect ( commandArg . service_tier ) . toBeUndefined ( )
1298+ expect ( commandArg [ SERVICE_TIER_KEY ] ) . toBeUndefined ( )
12981299 if ( commandArg . additionalModelRequestFields ) {
1299- expect ( commandArg . additionalModelRequestFields . service_tier ) . toBeUndefined ( )
1300+ expect ( commandArg . additionalModelRequestFields [ SERVICE_TIER_KEY ] ) . toBeUndefined ( )
13001301 }
13011302 } )
13021303
@@ -1323,9 +1324,9 @@ describe("AwsBedrockHandler", () => {
13231324 const commandArg = mockConverseStreamCommand . mock . calls [ 0 ] [ 0 ] as any
13241325
13251326 // Service tier should NOT be included when not specified (at top level or in additionalModelRequestFields)
1326- expect ( commandArg . service_tier ) . toBeUndefined ( )
1327+ expect ( commandArg [ SERVICE_TIER_KEY ] ) . toBeUndefined ( )
13271328 if ( commandArg . additionalModelRequestFields ) {
1328- expect ( commandArg . additionalModelRequestFields . service_tier ) . toBeUndefined ( )
1329+ expect ( commandArg . additionalModelRequestFields [ SERVICE_TIER_KEY ] ) . toBeUndefined ( )
13291330 }
13301331 } )
13311332 } )
0 commit comments