Skip to content

Commit 9199ed2

Browse files
committed
Fix merge
1 parent e54d699 commit 9199ed2

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

packages/types/src/providers/bedrock.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@ export const BEDROCK_DEFAULT_TEMPERATURE = 0.3
355355

356356
export const BEDROCK_MAX_TOKENS = 4096
357357

358+
export const BEDROCK_DEFAULT_CONTEXT = 128_000
359+
358360
export const BEDROCK_REGION_INFO: Record<
359361
string,
360362
{

src/api/providers/bedrock.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
bedrockDefaultPromptRouterModelId,
2020
BEDROCK_DEFAULT_TEMPERATURE,
2121
BEDROCK_MAX_TOKENS,
22+
BEDROCK_DEFAULT_CONTEXT,
2223
BEDROCK_REGION_INFO,
2324
} from "@roo-code/types"
2425

@@ -30,10 +31,6 @@ import { ModelInfo as CacheModelInfo } from "../transform/cache-strategy/types"
3031
import { convertToBedrockConverseMessages as sharedConverter } from "../transform/bedrock-converse-format"
3132
import type { SingleCompletionHandler, ApiHandlerCreateMessageMetadata } from "../index"
3233

33-
const BEDROCK_DEFAULT_TEMPERATURE = 0.3
34-
const BEDROCK_MAX_TOKENS = 4096
35-
const BEDROCK_DEFAULT_CONTEXT = 128_000 // PATCH: used for unknown custom ARNs
36-
3734
/************************************************************************************
3835
*
3936
* TYPES
@@ -196,7 +193,7 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
196193
this.client = new BedrockRuntimeClient(clientConfig)
197194
}
198195

199-
// PATCH: Helper to guess model info from custom modelId string if not in bedrockModels
196+
// Helper to guess model info from custom modelId string if not in bedrockModels
200197
private guessModelInfoFromId(modelId: string): Partial<ModelInfo> {
201198
// Define a mapping for model ID patterns and their configurations
202199
const modelConfigMap: Record<string, Partial<ModelInfo>> = {
@@ -245,7 +242,6 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
245242
return config
246243
}
247244
}
248-
// PATCH: Add more heuristics as needed here
249245

250246
// Default fallback
251247
return {
@@ -704,7 +700,7 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
704700
info: JSON.parse(JSON.stringify(bedrockModels[bedrockDefaultPromptRouterModelId])),
705701
}
706702
} else {
707-
// PATCH: Use heuristics for model info, then allow overrides from ProviderSettings
703+
// Use heuristics for model info, then allow overrides from ProviderSettings
708704
const guessed = this.guessModelInfoFromId(modelId)
709705
model = {
710706
id: bedrockDefaultModelId,
@@ -715,7 +711,7 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
715711
}
716712
}
717713

718-
// PATCH: Always allow user to override detected/guessed maxTokens and contextWindow
714+
// Always allow user to override detected/guessed maxTokens and contextWindow
719715
if (this.options.modelMaxTokens && this.options.modelMaxTokens > 0) {
720716
model.info.maxTokens = this.options.modelMaxTokens
721717
}
@@ -756,7 +752,7 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
756752
}
757753
}
758754

759-
// PATCH: Don't override maxTokens/contextWindow here; handled in getModelById (and includes user overrides)
755+
// Don't override maxTokens/contextWindow here; handled in getModelById (and includes user overrides)
760756
return modelConfig as { id: BedrockModelId | string; info: ModelInfo }
761757
}
762758

0 commit comments

Comments
 (0)