Skip to content

Commit b7c258c

Browse files
committed
Modification of AWS Bedrock to Amazon Bedrock
1 parent 255a158 commit b7c258c

File tree

25 files changed

+54
-54
lines changed

25 files changed

+54
-54
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ body:
2424
- OpenAI
2525
- OpenAI Compatible
2626
- GCP Vertex AI
27-
- AWS Bedrock
27+
- Amazon Bedrock
2828
- Requesty
2929
- Glama
3030
- VS Code LM API

cline_docs/bedrock/bedrock-cache-strategy-documentation.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Cache Strategy Documentation
22

3-
This document provides an overview of the cache strategy implementation for AWS Bedrock in the Roo-Code project, including class relationships and sequence diagrams.
3+
This document provides an overview of the cache strategy implementation for Amazon Bedrock in the Roo-Code project, including class relationships and sequence diagrams.
44

55
## Class Relationship Diagram
66

@@ -89,7 +89,7 @@ sequenceDiagram
8989
participant Client as Client Code
9090
participant Bedrock as AwsBedrockHandler
9191
participant Strategy as MultiPointStrategy
92-
participant AWS as AWS Bedrock Service
92+
participant AWS as Amazon Bedrock Service
9393
9494
Client->>Bedrock: createMessage(systemPrompt, messages)
9595
Note over Bedrock: Generate conversationId to track cache points
@@ -143,7 +143,7 @@ sequenceDiagram
143143

144144
### Cache Strategy
145145

146-
The cache strategy system is designed to optimize the placement of cache points in AWS Bedrock API requests. Cache points allow the service to reuse previously processed parts of the prompt, reducing token usage and improving response times.
146+
The cache strategy system is designed to optimize the placement of cache points in Amazon Bedrock API requests. Cache points allow the service to reuse previously processed parts of the prompt, reducing token usage and improving response times.
147147

148148
- **MultiPointStrategy**: Upon first MR of Bedrock caching, this strategy is used for all cache point placement scenarios. It distributes cache points throughout the conversation to maximize caching efficiency, whether the model supports one or multiple cache points.
149149

@@ -180,14 +180,14 @@ The simplified approach ensures that:
180180

181181
The examples in this document reflect this optimized implementation.
182182

183-
### Integration with AWS Bedrock
183+
### Integration with Amazon Bedrock
184184

185185
The AwsBedrockHandler class integrates with the cache strategies by:
186186

187187
1. Determining if the model supports prompt caching
188188
2. Creating the appropriate strategy based on model capabilities
189189
3. Applying the strategy to format messages with optimal cache points
190-
4. Sending the formatted request to AWS Bedrock
190+
4. Sending the formatted request to Amazon Bedrock
191191
5. Processing and returning the response
192192

193193
## Usage Considerations

cline_docs/bedrock/model-identification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Bedrock Model Identification
22

3-
This document explains how model information is identified and managed in the AWS Bedrock provider implementation (`bedrock.ts`). It focuses on the sequence of operations that determine the `costModelConfig` property, which is crucial for token counting, pricing, and other features.
3+
This document explains how model information is identified and managed in the Amazon Bedrock provider implementation (`bedrock.ts`). It focuses on the sequence of operations that determine the `costModelConfig` property, which is crucial for token counting, pricing, and other features.
44

55
## Model Identification Flow
66

evals/packages/types/src/roo-code.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ export const providerSettingsSchema = z.object({
312312
openRouterBaseUrl: z.string().optional(),
313313
openRouterSpecificProvider: z.string().optional(),
314314
openRouterUseMiddleOutTransform: z.boolean().optional(),
315-
// AWS Bedrock
315+
// Amazon Bedrock
316316
awsAccessKey: z.string().optional(),
317317
awsSecretKey: z.string().optional(),
318318
awsSessionToken: z.string().optional(),
@@ -403,7 +403,7 @@ const providerSettingsRecord: ProviderSettingsRecord = {
403403
openRouterBaseUrl: undefined,
404404
openRouterSpecificProvider: undefined,
405405
openRouterUseMiddleOutTransform: undefined,
406-
// AWS Bedrock
406+
// Amazon Bedrock
407407
awsAccessKey: undefined,
408408
awsSecretKey: undefined,
409409
awsSessionToken: undefined,

src/api/providers/bedrock.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { Message, SystemContentBlock } from "@aws-sdk/client-bedrock-runtime"
2222
// New cache-related imports
2323
import { MultiPointStrategy } from "../transform/cache-strategy/multi-point-strategy"
2424
import { ModelInfo as CacheModelInfo } from "../transform/cache-strategy/types"
25-
import { AWS_BEDROCK_REGION_INFO } from "../../shared/aws_regions"
25+
import { AMAZON_BEDROCK_REGION_INFO } from "../../shared/aws_regions"
2626

2727
const BEDROCK_DEFAULT_TEMPERATURE = 0.3
2828
const BEDROCK_MAX_TOKENS = 4096
@@ -495,7 +495,7 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
495495

496496
private parseArn(arn: string, region?: string) {
497497
/*
498-
* VIA Roo analysis: platform-independent Regex. It's designed to parse AWS Bedrock ARNs and doesn't rely on any platform-specific features
498+
* VIA Roo analysis: platform-independent Regex. It's designed to parse Amazon Bedrock ARNs and doesn't rely on any platform-specific features
499499
* like file path separators, line endings, or case sensitivity behaviors. The forward slashes in the regex are properly escaped and
500500
* represent literal characters in the AWS ARN format, not filesystem paths. This regex will function consistently across Windows,
501501
* macOS, Linux, and any other operating system where JavaScript runs.
@@ -562,7 +562,7 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
562562
region: undefined,
563563
modelType: undefined,
564564
modelId: undefined,
565-
errorMessage: "Invalid ARN format. ARN should follow the AWS Bedrock ARN pattern.",
565+
errorMessage: "Invalid ARN format. ARN should follow the Amazon Bedrock ARN pattern.",
566566
crossRegionInference: false,
567567
}
568568
}
@@ -700,16 +700,16 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
700700

701701
/************************************************************************************
702702
*
703-
* AWS REGIONS
703+
* AMAZON REGIONS
704704
*
705705
*************************************************************************************/
706706

707707
private static getPrefixList(): string[] {
708-
return Object.keys(AWS_BEDROCK_REGION_INFO)
708+
return Object.keys(AMAZON_BEDROCK_REGION_INFO)
709709
}
710710

711711
private static getPrefixForRegion(region: string): string | undefined {
712-
for (const [prefix, info] of Object.entries(AWS_BEDROCK_REGION_INFO)) {
712+
for (const [prefix, info] of Object.entries(AMAZON_BEDROCK_REGION_INFO)) {
713713
if (info.pattern && region.startsWith(info.pattern)) {
714714
return prefix
715715
}
@@ -718,7 +718,7 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
718718
}
719719

720720
private static prefixIsMultiRegion(arnPrefix: string): boolean {
721-
for (const [prefix, info] of Object.entries(AWS_BEDROCK_REGION_INFO)) {
721+
for (const [prefix, info] of Object.entries(AMAZON_BEDROCK_REGION_INFO)) {
722722
if (arnPrefix === prefix) {
723723
if (info?.multiRegion) return info.multiRegion
724724
else return false
@@ -791,7 +791,7 @@ Suggestions:
791791
2. Split your request into smaller chunks
792792
3. Use a model with a larger context window
793793
4. If rate limited, reduce request frequency
794-
5. Check your AWS Bedrock quotas and limits`,
794+
5. Check your Amazon Bedrock quotas and limits`,
795795
logLevel: "error",
796796
},
797797
ON_DEMAND_NOT_SUPPORTED: {

src/schemas/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ export const providerSettingsSchema = z.object({
319319
openRouterBaseUrl: z.string().optional(),
320320
openRouterSpecificProvider: z.string().optional(),
321321
openRouterUseMiddleOutTransform: z.boolean().optional(),
322-
// AWS Bedrock
322+
// Amazon Bedrock
323323
awsAccessKey: z.string().optional(),
324324
awsSecretKey: z.string().optional(),
325325
awsSessionToken: z.string().optional(),
@@ -414,7 +414,7 @@ const providerSettingsRecord: ProviderSettingsRecord = {
414414
openRouterBaseUrl: undefined,
415415
openRouterSpecificProvider: undefined,
416416
openRouterUseMiddleOutTransform: undefined,
417-
// AWS Bedrock
417+
// Amazon Bedrock
418418
awsAccessKey: undefined,
419419
awsSecretKey: undefined,
420420
awsSessionToken: undefined,

src/shared/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ export const anthropicModels = {
7777
cacheReadsPrice: 0.03,
7878
},
7979
} as const satisfies Record<string, ModelInfo> // as const assertion makes the object deeply readonly
80-
81-
// AWS Bedrock
80+
// Amazon Bedrock
81+
// https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html
8282
// https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html
8383
export interface MessageContent {
8484
type: "text" | "image" | "video" | "tool_use" | "tool_result"

src/shared/aws_regions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* AWS Region information mapping
33
* Maps region prefixes to their full region IDs and descriptions
44
*/
5-
export const AWS_BEDROCK_REGION_INFO: Record<
5+
export const AMAZON_BEDROCK_REGION_INFO: Record<
66
string,
77
{
88
regionId: string
@@ -69,7 +69,7 @@ export const AWS_BEDROCK_REGION_INFO: Record<
6969
}
7070

7171
// Extract unique region IDs from REGION_INFO and create the AWS_REGIONS array
72-
export const AWS_REGIONS = Object.values(AWS_BEDROCK_REGION_INFO)
72+
export const AWS_REGIONS = Object.values(AMAZON_BEDROCK_REGION_INFO)
7373
// Extract all region IDs
7474
.map((info) => ({ value: info.regionId, label: info.regionId }))
7575
// Filter to unique region IDs (remove duplicates)

webview-ui/src/components/settings/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const PROVIDERS = [
2828
{ value: "openai-native", label: "OpenAI" },
2929
{ value: "openai", label: "OpenAI Compatible" },
3030
{ value: "vertex", label: "GCP Vertex AI" },
31-
{ value: "bedrock", label: "AWS Bedrock" },
31+
{ value: "bedrock", label: "Amazon Bedrock" },
3232
{ value: "glama", label: "Glama" },
3333
{ value: "vscode-lm", label: "VS Code LM API" },
3434
{ value: "mistral", label: "Mistral" },

webview-ui/src/i18n/locales/ca/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"searchPlaceholder": "Cerca perfils",
102102
"noMatchFound": "No s'han trobat perfils coincidents",
103103
"vscodeLmDescription": "L'API del model de llenguatge de VS Code us permet executar models proporcionats per altres extensions de VS Code (incloent-hi, però no limitat a, GitHub Copilot). La manera més senzilla de començar és instal·lar les extensions Copilot i Copilot Chat des del VS Code Marketplace.",
104-
"awsCustomArnUse": "Introduïu un ARN vàlid d'AWS Bedrock per al model que voleu utilitzar. Exemples de format:",
104+
"awsCustomArnUse": "Introduïu un ARN vàlid d'Amazon Bedrock per al model que voleu utilitzar. Exemples de format:",
105105
"awsCustomArnDesc": "Assegureu-vos que la regió a l'ARN coincideix amb la regió d'AWS seleccionada anteriorment.",
106106
"apiKeyStorageNotice": "Les claus API s'emmagatzemen de forma segura a l'Emmagatzematge Secret de VSCode",
107107
"useCustomBaseUrl": "Utilitzar URL base personalitzada",
@@ -403,7 +403,7 @@
403403
},
404404
"validation": {
405405
"apiKey": "Heu de proporcionar una clau API vàlida.",
406-
"awsRegion": "Heu de triar una regió per utilitzar AWS Bedrock.",
406+
"awsRegion": "Heu de triar una regió per utilitzar Amazon Bedrock.",
407407
"googleCloud": "Heu de proporcionar un ID de projecte i regió de Google Cloud vàlids.",
408408
"modelId": "Heu de proporcionar un ID de model vàlid.",
409409
"modelSelector": "Heu de proporcionar un selector de model vàlid.",

0 commit comments

Comments
 (0)