From c2f93e18c1a4cbc770e38fa4cd9ca691abf5f93d Mon Sep 17 00:00:00 2001 From: awstools Date: Thu, 30 May 2024 18:17:15 +0000 Subject: [PATCH] feat(client-bedrock-agent): With this release, Knowledge bases for Bedrock adds support for Titan Text Embedding v2. --- .../commands/CreateKnowledgeBaseCommand.ts | 10 +++++ .../src/commands/GetKnowledgeBaseCommand.ts | 5 +++ .../commands/UpdateKnowledgeBaseCommand.ts | 10 +++++ .../src/models/models_0.ts | 30 +++++++++++++ .../src/protocols/Aws_restJson1.ts | 10 +++++ .../sdk-codegen/aws-models/bedrock-agent.json | 43 +++++++++++++++++++ 6 files changed, 108 insertions(+) diff --git a/clients/client-bedrock-agent/src/commands/CreateKnowledgeBaseCommand.ts b/clients/client-bedrock-agent/src/commands/CreateKnowledgeBaseCommand.ts index 5c079eaf04af..e8d13d7e2570 100644 --- a/clients/client-bedrock-agent/src/commands/CreateKnowledgeBaseCommand.ts +++ b/clients/client-bedrock-agent/src/commands/CreateKnowledgeBaseCommand.ts @@ -74,6 +74,11 @@ export interface CreateKnowledgeBaseCommandOutput extends CreateKnowledgeBaseRes * type: "VECTOR", // required * vectorKnowledgeBaseConfiguration: { // VectorKnowledgeBaseConfiguration * embeddingModelArn: "STRING_VALUE", // required + * embeddingModelConfiguration: { // EmbeddingModelConfiguration + * bedrockEmbeddingModelConfiguration: { // BedrockEmbeddingModelConfiguration + * dimensions: Number("int"), + * }, + * }, * }, * }, * storageConfiguration: { // StorageConfiguration @@ -149,6 +154,11 @@ export interface CreateKnowledgeBaseCommandOutput extends CreateKnowledgeBaseRes * // type: "VECTOR", // required * // vectorKnowledgeBaseConfiguration: { // VectorKnowledgeBaseConfiguration * // embeddingModelArn: "STRING_VALUE", // required + * // embeddingModelConfiguration: { // EmbeddingModelConfiguration + * // bedrockEmbeddingModelConfiguration: { // BedrockEmbeddingModelConfiguration + * // dimensions: Number("int"), + * // }, + * // }, * // }, * // }, * // storageConfiguration: { // StorageConfiguration diff --git a/clients/client-bedrock-agent/src/commands/GetKnowledgeBaseCommand.ts b/clients/client-bedrock-agent/src/commands/GetKnowledgeBaseCommand.ts index a4a0cc42b0f3..fdebe3b273b1 100644 --- a/clients/client-bedrock-agent/src/commands/GetKnowledgeBaseCommand.ts +++ b/clients/client-bedrock-agent/src/commands/GetKnowledgeBaseCommand.ts @@ -50,6 +50,11 @@ export interface GetKnowledgeBaseCommandOutput extends GetKnowledgeBaseResponse, * // type: "VECTOR", // required * // vectorKnowledgeBaseConfiguration: { // VectorKnowledgeBaseConfiguration * // embeddingModelArn: "STRING_VALUE", // required + * // embeddingModelConfiguration: { // EmbeddingModelConfiguration + * // bedrockEmbeddingModelConfiguration: { // BedrockEmbeddingModelConfiguration + * // dimensions: Number("int"), + * // }, + * // }, * // }, * // }, * // storageConfiguration: { // StorageConfiguration diff --git a/clients/client-bedrock-agent/src/commands/UpdateKnowledgeBaseCommand.ts b/clients/client-bedrock-agent/src/commands/UpdateKnowledgeBaseCommand.ts index 8ba50a31fb0d..6fa9776273de 100644 --- a/clients/client-bedrock-agent/src/commands/UpdateKnowledgeBaseCommand.ts +++ b/clients/client-bedrock-agent/src/commands/UpdateKnowledgeBaseCommand.ts @@ -62,6 +62,11 @@ export interface UpdateKnowledgeBaseCommandOutput extends UpdateKnowledgeBaseRes * type: "VECTOR", // required * vectorKnowledgeBaseConfiguration: { // VectorKnowledgeBaseConfiguration * embeddingModelArn: "STRING_VALUE", // required + * embeddingModelConfiguration: { // EmbeddingModelConfiguration + * bedrockEmbeddingModelConfiguration: { // BedrockEmbeddingModelConfiguration + * dimensions: Number("int"), + * }, + * }, * }, * }, * storageConfiguration: { // StorageConfiguration @@ -134,6 +139,11 @@ export interface UpdateKnowledgeBaseCommandOutput extends UpdateKnowledgeBaseRes * // type: "VECTOR", // required * // vectorKnowledgeBaseConfiguration: { // VectorKnowledgeBaseConfiguration * // embeddingModelArn: "STRING_VALUE", // required + * // embeddingModelConfiguration: { // EmbeddingModelConfiguration + * // bedrockEmbeddingModelConfiguration: { // BedrockEmbeddingModelConfiguration + * // dimensions: Number("int"), + * // }, + * // }, * // }, * // }, * // storageConfiguration: { // StorageConfiguration diff --git a/clients/client-bedrock-agent/src/models/models_0.ts b/clients/client-bedrock-agent/src/models/models_0.ts index de42118d2bb9..9a55897998df 100644 --- a/clients/client-bedrock-agent/src/models/models_0.ts +++ b/clients/client-bedrock-agent/src/models/models_0.ts @@ -3275,6 +3275,30 @@ export const KnowledgeBaseType = { */ export type KnowledgeBaseType = (typeof KnowledgeBaseType)[keyof typeof KnowledgeBaseType]; +/** + *

The vector configuration details for the Bedrock embeddings model.

+ * @public + */ +export interface BedrockEmbeddingModelConfiguration { + /** + *

The dimensions details for the vector configuration used on the Bedrock embeddings model.

+ * @public + */ + dimensions?: number; +} + +/** + *

The configuration details for the embeddings model.

+ * @public + */ +export interface EmbeddingModelConfiguration { + /** + *

The vector configuration details on the Bedrock embeddings model.

+ * @public + */ + bedrockEmbeddingModelConfiguration?: BedrockEmbeddingModelConfiguration; +} + /** *

Contains details about the model used to create vector embeddings for the knowledge base.

* @public @@ -3285,6 +3309,12 @@ export interface VectorKnowledgeBaseConfiguration { * @public */ embeddingModelArn: string | undefined; + + /** + *

The embeddings model configuration details for the vector model used in Knowledge Base.

+ * @public + */ + embeddingModelConfiguration?: EmbeddingModelConfiguration; } /** diff --git a/clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts b/clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts index 4895779b95ae..d1cab66e5da8 100644 --- a/clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts +++ b/clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts @@ -130,11 +130,13 @@ import { AgentVersion, AgentVersionSummary, APISchema, + BedrockEmbeddingModelConfiguration, ChunkingConfiguration, ConflictException, DataSource, DataSourceConfiguration, DataSourceSummary, + EmbeddingModelConfiguration, FixedSizeChunkingConfiguration, Function, FunctionSchema, @@ -2103,10 +2105,14 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_APISchema omitted. +// se_BedrockEmbeddingModelConfiguration omitted. + // se_ChunkingConfiguration omitted. // se_DataSourceConfiguration omitted. +// se_EmbeddingModelConfiguration omitted. + // se_FixedSizeChunkingConfiguration omitted. // se_Function omitted. @@ -2486,6 +2492,8 @@ const de_AgentVersionSummary = (output: any, context: __SerdeContext): AgentVers // de_APISchema omitted. +// de_BedrockEmbeddingModelConfiguration omitted. + // de_ChunkingConfiguration omitted. /** @@ -2536,6 +2544,8 @@ const de_DataSourceSummary = (output: any, context: __SerdeContext): DataSourceS }) as any; }; +// de_EmbeddingModelConfiguration omitted. + // de_FailureReasons omitted. // de_FixedSizeChunkingConfiguration omitted. diff --git a/codegen/sdk-codegen/aws-models/bedrock-agent.json b/codegen/sdk-codegen/aws-models/bedrock-agent.json index 2171aa8c5ffb..0aecb1206b97 100644 --- a/codegen/sdk-codegen/aws-models/bedrock-agent.json +++ b/codegen/sdk-codegen/aws-models/bedrock-agent.json @@ -1962,6 +1962,20 @@ "smithy.api#pattern": "^(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)$" } }, + "com.amazonaws.bedrockagent#BedrockEmbeddingModelConfiguration": { + "type": "structure", + "members": { + "dimensions": { + "target": "com.amazonaws.bedrockagent#Dimensions", + "traits": { + "smithy.api#documentation": "

The dimensions details for the vector configuration used on the Bedrock embeddings model.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The vector configuration details for the Bedrock embeddings model.

" + } + }, "com.amazonaws.bedrockagent#BucketOwnerAccountId": { "type": "string", "traits": { @@ -3441,6 +3455,15 @@ } } }, + "com.amazonaws.bedrockagent#Dimensions": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 0, + "max": 4096 + } + } + }, "com.amazonaws.bedrockagent#DisassociateAgentKnowledgeBase": { "type": "operation", "input": { @@ -3529,6 +3552,20 @@ "smithy.api#pattern": "^DRAFT$" } }, + "com.amazonaws.bedrockagent#EmbeddingModelConfiguration": { + "type": "structure", + "members": { + "bedrockEmbeddingModelConfiguration": { + "target": "com.amazonaws.bedrockagent#BedrockEmbeddingModelConfiguration", + "traits": { + "smithy.api#documentation": "

The vector configuration details on the Bedrock embeddings model.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The configuration details for the embeddings model.

" + } + }, "com.amazonaws.bedrockagent#FailureReason": { "type": "string", "traits": { @@ -8012,6 +8049,12 @@ "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the model used to create vector embeddings for the knowledge base.

", "smithy.api#required": {} } + }, + "embeddingModelConfiguration": { + "target": "com.amazonaws.bedrockagent#EmbeddingModelConfiguration", + "traits": { + "smithy.api#documentation": "

The embeddings model configuration details for the vector model used in Knowledge Base.

" + } } }, "traits": {