Skip to content

Commit ced0222

Browse files
remove duplicative logic to add a region to the arn when cross-region is selected
1 parent 1aa4396 commit ced0222

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/api/providers/bedrock.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,6 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
160160
this.options.modelTemperature ?? BEDROCK_DEFAULT_TEMPERATURE
161161
this.costModelConfig = this.getModel()
162162

163-
if (this.options.awsUseCrossRegionInference) {
164-
// Get the current region
165-
const region = this.options.awsRegion || ""
166-
// Use the helper method to get the appropriate prefix for this region
167-
const prefix = AwsBedrockHandler.getPrefixForRegion(region)
168-
169-
// Apply the prefix if one was found, otherwise use the model ID as is
170-
this.costModelConfig.id = prefix ? `${prefix}${this.costModelConfig.id}` : this.costModelConfig.id
171-
}
172-
173163
const clientConfig: BedrockRuntimeClientConfig = {
174164
region: this.options.awsRegion,
175165
}
@@ -307,7 +297,7 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
307297
if (streamEvent?.trace?.promptRouter?.invokedModelId) {
308298
try {
309299
let invokedModelArn = this.parseArn(streamEvent.trace.promptRouter.invokedModelId)
310-
if (invokedModelArn.modelId) {
300+
if (invokedModelArn?.modelId) {
311301
//update the in-use model info to be based on the invoked Model Id for the router
312302
//so that pricing, context window, caching etc have values that can be used
313303
//However, we want to keep the id of the model to be the ID for the router for

0 commit comments

Comments
 (0)