Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ body:
- OpenAI
- OpenAI Compatible
- GCP Vertex AI
- AWS Bedrock
- Amazon Bedrock
- Requesty
- Glama
- VS Code LM API
Expand Down
10 changes: 5 additions & 5 deletions cline_docs/bedrock/bedrock-cache-strategy-documentation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cache Strategy Documentation

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

## Class Relationship Diagram

Expand Down Expand Up @@ -89,7 +89,7 @@ sequenceDiagram
participant Client as Client Code
participant Bedrock as AwsBedrockHandler
participant Strategy as MultiPointStrategy
participant AWS as AWS Bedrock Service
participant AWS as Amazon Bedrock Service
Client->>Bedrock: createMessage(systemPrompt, messages)
Note over Bedrock: Generate conversationId to track cache points
Expand Down Expand Up @@ -143,7 +143,7 @@ sequenceDiagram

### Cache Strategy

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.
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.

- **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.

Expand Down Expand Up @@ -180,14 +180,14 @@ The simplified approach ensures that:

The examples in this document reflect this optimized implementation.

### Integration with AWS Bedrock
### Integration with Amazon Bedrock

The AwsBedrockHandler class integrates with the cache strategies by:

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

## Usage Considerations
Expand Down
2 changes: 1 addition & 1 deletion cline_docs/bedrock/model-identification.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Bedrock Model Identification

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.
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.

## Model Identification Flow

Expand Down
4 changes: 2 additions & 2 deletions evals/packages/types/src/roo-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export const providerSettingsSchema = z.object({
openRouterBaseUrl: z.string().optional(),
openRouterSpecificProvider: z.string().optional(),
openRouterUseMiddleOutTransform: z.boolean().optional(),
// AWS Bedrock
// Amazon Bedrock
awsAccessKey: z.string().optional(),
awsSecretKey: z.string().optional(),
awsSessionToken: z.string().optional(),
Expand Down Expand Up @@ -403,7 +403,7 @@ const providerSettingsRecord: ProviderSettingsRecord = {
openRouterBaseUrl: undefined,
openRouterSpecificProvider: undefined,
openRouterUseMiddleOutTransform: undefined,
// AWS Bedrock
// Amazon Bedrock
awsAccessKey: undefined,
awsSecretKey: undefined,
awsSessionToken: undefined,
Expand Down
16 changes: 8 additions & 8 deletions src/api/providers/bedrock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { Message, SystemContentBlock } from "@aws-sdk/client-bedrock-runtime"
// New cache-related imports
import { MultiPointStrategy } from "../transform/cache-strategy/multi-point-strategy"
import { ModelInfo as CacheModelInfo } from "../transform/cache-strategy/types"
import { AWS_BEDROCK_REGION_INFO } from "../../shared/aws_regions"
import { AMAZON_BEDROCK_REGION_INFO } from "../../shared/aws_regions"

const BEDROCK_DEFAULT_TEMPERATURE = 0.3
const BEDROCK_MAX_TOKENS = 4096
Expand Down Expand Up @@ -495,7 +495,7 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH

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

/************************************************************************************
*
* AWS REGIONS
* AMAZON REGIONS
*
*************************************************************************************/

private static getPrefixList(): string[] {
return Object.keys(AWS_BEDROCK_REGION_INFO)
return Object.keys(AMAZON_BEDROCK_REGION_INFO)
}

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

private static prefixIsMultiRegion(arnPrefix: string): boolean {
for (const [prefix, info] of Object.entries(AWS_BEDROCK_REGION_INFO)) {
for (const [prefix, info] of Object.entries(AMAZON_BEDROCK_REGION_INFO)) {
if (arnPrefix === prefix) {
if (info?.multiRegion) return info.multiRegion
else return false
Expand Down Expand Up @@ -791,7 +791,7 @@ Suggestions:
2. Split your request into smaller chunks
3. Use a model with a larger context window
4. If rate limited, reduce request frequency
5. Check your AWS Bedrock quotas and limits`,
5. Check your Amazon Bedrock quotas and limits`,
logLevel: "error",
},
ON_DEMAND_NOT_SUPPORTED: {
Expand Down
4 changes: 2 additions & 2 deletions src/schemas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export const providerSettingsSchema = z.object({
openRouterBaseUrl: z.string().optional(),
openRouterSpecificProvider: z.string().optional(),
openRouterUseMiddleOutTransform: z.boolean().optional(),
// AWS Bedrock
// Amazon Bedrock
awsAccessKey: z.string().optional(),
awsSecretKey: z.string().optional(),
awsSessionToken: z.string().optional(),
Expand Down Expand Up @@ -414,7 +414,7 @@ const providerSettingsRecord: ProviderSettingsRecord = {
openRouterBaseUrl: undefined,
openRouterSpecificProvider: undefined,
openRouterUseMiddleOutTransform: undefined,
// AWS Bedrock
// Amazon Bedrock
awsAccessKey: undefined,
awsSecretKey: undefined,
awsSessionToken: undefined,
Expand Down
3 changes: 1 addition & 2 deletions src/shared/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ export const anthropicModels = {
cacheReadsPrice: 0.03,
},
} as const satisfies Record<string, ModelInfo> // as const assertion makes the object deeply readonly

// AWS Bedrock
// Amazon Bedrock
// https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html
export interface MessageContent {
type: "text" | "image" | "video" | "tool_use" | "tool_result"
Expand Down
4 changes: 2 additions & 2 deletions src/shared/aws_regions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* AWS Region information mapping
* Maps region prefixes to their full region IDs and descriptions
*/
export const AWS_BEDROCK_REGION_INFO: Record<
export const AMAZON_BEDROCK_REGION_INFO: Record<
string,
{
regionId: string
Expand Down Expand Up @@ -69,7 +69,7 @@ export const AWS_BEDROCK_REGION_INFO: Record<
}

// Extract unique region IDs from REGION_INFO and create the AWS_REGIONS array
export const AWS_REGIONS = Object.values(AWS_BEDROCK_REGION_INFO)
export const AWS_REGIONS = Object.values(AMAZON_BEDROCK_REGION_INFO)
// Extract all region IDs
.map((info) => ({ value: info.regionId, label: info.regionId }))
// Filter to unique region IDs (remove duplicates)
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/components/settings/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const PROVIDERS = [
{ value: "openai-native", label: "OpenAI" },
{ value: "openai", label: "OpenAI Compatible" },
{ value: "vertex", label: "GCP Vertex AI" },
{ value: "bedrock", label: "AWS Bedrock" },
{ value: "bedrock", label: "Amazon Bedrock" },
{ value: "glama", label: "Glama" },
{ value: "vscode-lm", label: "VS Code LM API" },
{ value: "mistral", label: "Mistral" },
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/ca/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"searchPlaceholder": "Cerca perfils",
"noMatchFound": "No s'han trobat perfils coincidents",
"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.",
"awsCustomArnUse": "Introduïu un ARN vàlid d'AWS Bedrock per al model que voleu utilitzar. Exemples de format:",
"awsCustomArnUse": "Introduïu un ARN vàlid d'Amazon Bedrock per al model que voleu utilitzar. Exemples de format:",
"awsCustomArnDesc": "Assegureu-vos que la regió a l'ARN coincideix amb la regió d'AWS seleccionada anteriorment.",
"apiKeyStorageNotice": "Les claus API s'emmagatzemen de forma segura a l'Emmagatzematge Secret de VSCode",
"useCustomBaseUrl": "Utilitzar URL base personalitzada",
Expand Down Expand Up @@ -403,7 +403,7 @@
},
"validation": {
"apiKey": "Heu de proporcionar una clau API vàlida.",
"awsRegion": "Heu de triar una regió per utilitzar AWS Bedrock.",
"awsRegion": "Heu de triar una regió per utilitzar Amazon Bedrock.",
"googleCloud": "Heu de proporcionar un ID de projecte i regió de Google Cloud vàlids.",
"modelId": "Heu de proporcionar un ID de model vàlid.",
"modelSelector": "Heu de proporcionar un selector de model vàlid.",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/de/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"searchPlaceholder": "Profile durchsuchen",
"noMatchFound": "Keine passenden Profile gefunden",
"vscodeLmDescription": "Die VS Code Language Model API ermöglicht das Ausführen von Modellen, die von anderen VS Code-Erweiterungen bereitgestellt werden (einschließlich, aber nicht beschränkt auf GitHub Copilot). Der einfachste Weg, um zu starten, besteht darin, die Erweiterungen Copilot und Copilot Chat aus dem VS Code Marketplace zu installieren.",
"awsCustomArnUse": "Geben Sie eine gültige AWS Bedrock ARN für das Modell ein, das Sie verwenden möchten. Formatbeispiele:",
"awsCustomArnUse": "Geben Sie eine gültige Amazon Bedrock ARN für das Modell ein, das Sie verwenden möchten. Formatbeispiele:",
"awsCustomArnDesc": "Stellen Sie sicher, dass die Region in der ARN mit Ihrer oben ausgewählten AWS-Region übereinstimmt.",
"openRouterApiKey": "OpenRouter API-Schlüssel",
"getOpenRouterApiKey": "OpenRouter API-Schlüssel erhalten",
Expand Down Expand Up @@ -403,7 +403,7 @@
},
"validation": {
"apiKey": "Du musst einen gültigen API-Schlüssel angeben.",
"awsRegion": "Du musst eine Region für AWS Bedrock auswählen.",
"awsRegion": "Du musst eine Region für Amazon Bedrock auswählen.",
"googleCloud": "Du musst eine gültige Google Cloud Projekt-ID und Region angeben.",
"modelId": "Du musst eine gültige Modell-ID angeben.",
"modelSelector": "Du musst einen gültigen Modell-Selektor angeben.",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"searchPlaceholder": "Search profiles",
"noMatchFound": "No matching profiles found",
"vscodeLmDescription": " The VS Code Language Model API allows you to run models provided by other VS Code extensions (including but not limited to GitHub Copilot). The easiest way to get started is to install the Copilot and Copilot Chat extensions from the VS Code Marketplace.",
"awsCustomArnUse": "Enter a valid AWS Bedrock ARN for the model you want to use. Format examples:",
"awsCustomArnUse": "Enter a valid Amazon Bedrock ARN for the model you want to use. Format examples:",
"awsCustomArnDesc": "Make sure the region in the ARN matches your selected AWS Region above.",
"openRouterApiKey": "OpenRouter API Key",
"getOpenRouterApiKey": "Get OpenRouter API Key",
Expand Down Expand Up @@ -402,7 +402,7 @@
},
"validation": {
"apiKey": "You must provide a valid API key.",
"awsRegion": "You must choose a region to use with AWS Bedrock.",
"awsRegion": "You must choose a region to use with Amazon Bedrock.",
"googleCloud": "You must provide a valid Google Cloud Project ID and Region.",
"modelId": "You must provide a valid model ID.",
"modelSelector": "You must provide a valid model selector.",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/es/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"searchPlaceholder": "Buscar perfiles",
"noMatchFound": "No se encontraron perfiles coincidentes",
"vscodeLmDescription": "La API del Modelo de Lenguaje de VS Code le permite ejecutar modelos proporcionados por otras extensiones de VS Code (incluido, entre otros, GitHub Copilot). La forma más sencilla de empezar es instalar las extensiones Copilot y Copilot Chat desde el VS Code Marketplace.",
"awsCustomArnUse": "Ingrese un ARN de AWS Bedrock válido para el modelo que desea utilizar. Ejemplos de formato:",
"awsCustomArnUse": "Ingrese un ARN de Amazon Bedrock válido para el modelo que desea utilizar. Ejemplos de formato:",
"awsCustomArnDesc": "Asegúrese de que la región en el ARN coincida con la región de AWS seleccionada anteriormente.",
"openRouterApiKey": "Clave API de OpenRouter",
"getOpenRouterApiKey": "Obtener clave API de OpenRouter",
Expand Down Expand Up @@ -403,7 +403,7 @@
},
"validation": {
"apiKey": "Debe proporcionar una clave API válida.",
"awsRegion": "Debe elegir una región para usar con AWS Bedrock.",
"awsRegion": "Debe elegir una región para usar con Amazon Bedrock.",
"googleCloud": "Debe proporcionar un ID de proyecto y región de Google Cloud válidos.",
"modelId": "Debe proporcionar un ID de modelo válido.",
"modelSelector": "Debe proporcionar un selector de modelo válido.",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/fr/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"searchPlaceholder": "Rechercher des profils",
"noMatchFound": "Aucun profil correspondant trouvé",
"vscodeLmDescription": "L'API du modèle de langage VS Code vous permet d'exécuter des modèles fournis par d'autres extensions VS Code (y compris, mais sans s'y limiter, GitHub Copilot). Le moyen le plus simple de commencer est d'installer les extensions Copilot et Copilot Chat depuis le VS Code Marketplace.",
"awsCustomArnUse": "Entrez un ARN AWS Bedrock valide pour le modèle que vous souhaitez utiliser. Exemples de format :",
"awsCustomArnUse": "Entrez un ARN Amazon Bedrock valide pour le modèle que vous souhaitez utiliser. Exemples de format :",
"awsCustomArnDesc": "Assurez-vous que la région dans l'ARN correspond à la région AWS sélectionnée ci-dessus.",
"openRouterApiKey": "Clé API OpenRouter",
"getOpenRouterApiKey": "Obtenir la clé API OpenRouter",
Expand Down Expand Up @@ -403,7 +403,7 @@
},
"validation": {
"apiKey": "Vous devez fournir une clé API valide.",
"awsRegion": "Vous devez choisir une région pour utiliser AWS Bedrock.",
"awsRegion": "Vous devez choisir une région pour utiliser Amazon Bedrock.",
"googleCloud": "Vous devez fournir un ID de projet et une région Google Cloud valides.",
"modelId": "Vous devez fournir un ID de modèle valide.",
"modelSelector": "Vous devez fournir un sélecteur de modèle valide.",
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/src/i18n/locales/hi/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
},
"validation": {
"apiKey": "आपको एक मान्य API कुंजी प्रदान करनी होगी।",
"awsRegion": "AWS Bedrock का उपयोग करने के लिए आपको एक क्षेत्र चुनना होगा।",
"awsRegion": "Amazon Bedrock का उपयोग करने के लिए आपको एक क्षेत्र चुनना होगा।",
"googleCloud": "आपको एक मान्य Google Cloud प्रोजेक्ट ID और क्षेत्र प्रदान करना होगा।",
"modelId": "आपको एक मान्य मॉडल ID प्रदान करनी होगी।",
"modelSelector": "आपको एक मान्य मॉडल चयनकर्ता प्रदान करना होगा।",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/it/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"searchPlaceholder": "Cerca profili",
"noMatchFound": "Nessun profilo corrispondente trovato",
"vscodeLmDescription": "L'API del Modello di Linguaggio di VS Code consente di eseguire modelli forniti da altre estensioni di VS Code (incluso, ma non limitato a, GitHub Copilot). Il modo più semplice per iniziare è installare le estensioni Copilot e Copilot Chat dal VS Code Marketplace.",
"awsCustomArnUse": "Inserisci un ARN AWS Bedrock valido per il modello che desideri utilizzare. Esempi di formato:",
"awsCustomArnUse": "Inserisci un ARN Amazon Bedrock valido per il modello che desideri utilizzare. Esempi di formato:",
"awsCustomArnDesc": "Assicurati che la regione nell'ARN corrisponda alla regione AWS selezionata sopra.",
"openRouterApiKey": "Chiave API OpenRouter",
"getOpenRouterApiKey": "Ottieni chiave API OpenRouter",
Expand Down Expand Up @@ -403,7 +403,7 @@
},
"validation": {
"apiKey": "È necessario fornire una chiave API valida.",
"awsRegion": "È necessario scegliere una regione per utilizzare AWS Bedrock.",
"awsRegion": "È necessario scegliere una regione per utilizzare Amazon Bedrock.",
"googleCloud": "È necessario fornire un ID progetto e una regione Google Cloud validi.",
"modelId": "È necessario fornire un ID modello valido.",
"modelSelector": "È necessario fornire un selettore di modello valido.",
Expand Down
4 changes: 2 additions & 2 deletions webview-ui/src/i18n/locales/ja/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"searchPlaceholder": "プロファイルを検索",
"noMatchFound": "一致するプロファイルが見つかりません",
"vscodeLmDescription": "VS Code言語モデルAPIを使用すると、他のVS Code拡張機能(GitHub Copilotなど)が提供するモデルを実行できます。最も簡単な方法は、VS Code MarketplaceからCopilotおよびCopilot Chat拡張機能をインストールすることです。",
"awsCustomArnUse": "使用したいモデルの有効なAWS Bedrock ARNを入力してください。形式の例:",
"awsCustomArnUse": "使用したいモデルの有効なAmazon Bedrock ARNを入力してください。形式の例:",
"awsCustomArnDesc": "ARN内のリージョンが上で選択したAWSリージョンと一致していることを確認してください。",
"openRouterApiKey": "OpenRouter APIキー",
"getOpenRouterApiKey": "OpenRouter APIキーを取得",
Expand Down Expand Up @@ -403,7 +403,7 @@
},
"validation": {
"apiKey": "有効なAPIキーを入力してください。",
"awsRegion": "AWS Bedrockを使用するにはリージョンを選択してください。",
"awsRegion": "Amazon Bedrockを使用するにはリージョンを選択してください。",
"googleCloud": "有効なGoogle CloudプロジェクトIDとリージョンを入力してください。",
"modelId": "有効なモデルIDを入力してください。",
"modelSelector": "有効なモデルセレクターを入力してください。",
Expand Down
Loading