Skip to content

Commit

Permalink
feat(client-bedrock-agent): With this release, Knowledge bases for Be…
Browse files Browse the repository at this point in the history
…drock adds support for Titan Text Embedding v2.
  • Loading branch information
awstools committed May 30, 2024
1 parent b46048a commit c2f93e1
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
30 changes: 30 additions & 0 deletions clients/client-bedrock-agent/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3275,6 +3275,30 @@ export const KnowledgeBaseType = {
*/
export type KnowledgeBaseType = (typeof KnowledgeBaseType)[keyof typeof KnowledgeBaseType];

/**
* <p>The vector configuration details for the Bedrock embeddings model.</p>
* @public
*/
export interface BedrockEmbeddingModelConfiguration {
/**
* <p>The dimensions details for the vector configuration used on the Bedrock embeddings model.</p>
* @public
*/
dimensions?: number;
}

/**
* <p>The configuration details for the embeddings model.</p>
* @public
*/
export interface EmbeddingModelConfiguration {
/**
* <p>The vector configuration details on the Bedrock embeddings model.</p>
* @public
*/
bedrockEmbeddingModelConfiguration?: BedrockEmbeddingModelConfiguration;
}

/**
* <p>Contains details about the model used to create vector embeddings for the knowledge base.</p>
* @public
Expand All @@ -3285,6 +3309,12 @@ export interface VectorKnowledgeBaseConfiguration {
* @public
*/
embeddingModelArn: string | undefined;

/**
* <p>The embeddings model configuration details for the vector model used in Knowledge Base.</p>
* @public
*/
embeddingModelConfiguration?: EmbeddingModelConfiguration;
}

/**
Expand Down
10 changes: 10 additions & 0 deletions clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,13 @@ import {
AgentVersion,
AgentVersionSummary,
APISchema,
BedrockEmbeddingModelConfiguration,
ChunkingConfiguration,
ConflictException,
DataSource,
DataSourceConfiguration,
DataSourceSummary,
EmbeddingModelConfiguration,
FixedSizeChunkingConfiguration,
Function,
FunctionSchema,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -2486,6 +2492,8 @@ const de_AgentVersionSummary = (output: any, context: __SerdeContext): AgentVers

// de_APISchema omitted.

// de_BedrockEmbeddingModelConfiguration omitted.

// de_ChunkingConfiguration omitted.

/**
Expand Down Expand Up @@ -2536,6 +2544,8 @@ const de_DataSourceSummary = (output: any, context: __SerdeContext): DataSourceS
}) as any;
};

// de_EmbeddingModelConfiguration omitted.

// de_FailureReasons omitted.

// de_FixedSizeChunkingConfiguration omitted.
Expand Down
43 changes: 43 additions & 0 deletions codegen/sdk-codegen/aws-models/bedrock-agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "<p>The dimensions details for the vector configuration used on the Bedrock embeddings model.</p>"
}
}
},
"traits": {
"smithy.api#documentation": "<p>The vector configuration details for the Bedrock embeddings model.</p>"
}
},
"com.amazonaws.bedrockagent#BucketOwnerAccountId": {
"type": "string",
"traits": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": "<p>The vector configuration details on the Bedrock embeddings model.</p>"
}
}
},
"traits": {
"smithy.api#documentation": "<p>The configuration details for the embeddings model.</p>"
}
},
"com.amazonaws.bedrockagent#FailureReason": {
"type": "string",
"traits": {
Expand Down Expand Up @@ -8012,6 +8049,12 @@
"smithy.api#documentation": "<p>The Amazon Resource Name (ARN) of the model used to create vector embeddings for the knowledge base.</p>",
"smithy.api#required": {}
}
},
"embeddingModelConfiguration": {
"target": "com.amazonaws.bedrockagent#EmbeddingModelConfiguration",
"traits": {
"smithy.api#documentation": "<p>The embeddings model configuration details for the vector model used in Knowledge Base.</p>"
}
}
},
"traits": {
Expand Down

0 comments on commit c2f93e1

Please sign in to comment.