From 908a3951fa3837b050c9a0830b6b4bbe01106202 Mon Sep 17 00:00:00 2001 From: awstools Date: Mon, 2 Dec 2024 03:56:58 +0000 Subject: [PATCH] feat(client-bedrock-agent): This release introduces APIs to upload documents directly into a Knowledge Base --- clients/client-bedrock-agent/README.md | 32 + .../client-bedrock-agent/src/BedrockAgent.ts | 92 ++ .../src/BedrockAgentClient.ts | 24 + .../AssociateAgentKnowledgeBaseCommand.ts | 2 +- .../src/commands/CreateDataSourceCommand.ts | 6 +- .../commands/CreateKnowledgeBaseCommand.ts | 2 +- .../commands/DeleteKnowledgeBaseCommand.ts | 2 +- .../DeleteKnowledgeBaseDocumentsCommand.ts | 145 +++ .../DisassociateAgentKnowledgeBaseCommand.ts | 2 +- .../src/commands/GetDataSourceCommand.ts | 2 +- .../GetKnowledgeBaseDocumentsCommand.ts | 139 ++ .../IngestKnowledgeBaseDocumentsCommand.ts | 191 +++ .../ListKnowledgeBaseDocumentsCommand.ts | 131 ++ .../src/commands/UpdateDataSourceCommand.ts | 4 +- .../src/commands/index.ts | 4 + .../src/models/models_0.ts | 796 ++++++------ .../src/models/models_1.ts | 716 ++++++++++- .../ListKnowledgeBaseDocumentsPaginator.ts | 24 + .../src/pagination/index.ts | 1 + .../src/protocols/Aws_restJson1.ts | 400 +++++- .../sdk-codegen/aws-models/bedrock-agent.json | 1122 ++++++++++++++++- 21 files changed, 3390 insertions(+), 447 deletions(-) create mode 100644 clients/client-bedrock-agent/src/commands/DeleteKnowledgeBaseDocumentsCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/GetKnowledgeBaseDocumentsCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/IngestKnowledgeBaseDocumentsCommand.ts create mode 100644 clients/client-bedrock-agent/src/commands/ListKnowledgeBaseDocumentsCommand.ts create mode 100644 clients/client-bedrock-agent/src/pagination/ListKnowledgeBaseDocumentsPaginator.ts diff --git a/clients/client-bedrock-agent/README.md b/clients/client-bedrock-agent/README.md index fb4b955e6ec0..73a494d44930 100644 --- a/clients/client-bedrock-agent/README.md +++ b/clients/client-bedrock-agent/README.md @@ -362,6 +362,14 @@ DeleteKnowledgeBase [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/DeleteKnowledgeBaseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/DeleteKnowledgeBaseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/DeleteKnowledgeBaseCommandOutput/) + +
+ +DeleteKnowledgeBaseDocuments + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/DeleteKnowledgeBaseDocumentsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/DeleteKnowledgeBaseDocumentsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/DeleteKnowledgeBaseDocumentsCommandOutput/) +
@@ -466,6 +474,14 @@ GetKnowledgeBase [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/GetKnowledgeBaseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetKnowledgeBaseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetKnowledgeBaseCommandOutput/) +
+
+ +GetKnowledgeBaseDocuments + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/GetKnowledgeBaseDocumentsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetKnowledgeBaseDocumentsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetKnowledgeBaseDocumentsCommandOutput/) +
@@ -474,6 +490,14 @@ GetPrompt [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/GetPromptCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetPromptCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/GetPromptCommandOutput/) +
+
+ +IngestKnowledgeBaseDocuments + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/IngestKnowledgeBaseDocumentsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/IngestKnowledgeBaseDocumentsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/IngestKnowledgeBaseDocumentsCommandOutput/) +
@@ -554,6 +578,14 @@ ListIngestionJobs [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/ListIngestionJobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListIngestionJobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListIngestionJobsCommandOutput/) +
+
+ +ListKnowledgeBaseDocuments + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agent/command/ListKnowledgeBaseDocumentsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListKnowledgeBaseDocumentsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agent/Interface/ListKnowledgeBaseDocumentsCommandOutput/) +
diff --git a/clients/client-bedrock-agent/src/BedrockAgent.ts b/clients/client-bedrock-agent/src/BedrockAgent.ts index b594039b0b16..a15a68fdf0dc 100644 --- a/clients/client-bedrock-agent/src/BedrockAgent.ts +++ b/clients/client-bedrock-agent/src/BedrockAgent.ts @@ -87,6 +87,11 @@ import { DeleteKnowledgeBaseCommandInput, DeleteKnowledgeBaseCommandOutput, } from "./commands/DeleteKnowledgeBaseCommand"; +import { + DeleteKnowledgeBaseDocumentsCommand, + DeleteKnowledgeBaseDocumentsCommandInput, + DeleteKnowledgeBaseDocumentsCommandOutput, +} from "./commands/DeleteKnowledgeBaseDocumentsCommand"; import { DeletePromptCommand, DeletePromptCommandInput, @@ -144,7 +149,17 @@ import { GetKnowledgeBaseCommandInput, GetKnowledgeBaseCommandOutput, } from "./commands/GetKnowledgeBaseCommand"; +import { + GetKnowledgeBaseDocumentsCommand, + GetKnowledgeBaseDocumentsCommandInput, + GetKnowledgeBaseDocumentsCommandOutput, +} from "./commands/GetKnowledgeBaseDocumentsCommand"; import { GetPromptCommand, GetPromptCommandInput, GetPromptCommandOutput } from "./commands/GetPromptCommand"; +import { + IngestKnowledgeBaseDocumentsCommand, + IngestKnowledgeBaseDocumentsCommandInput, + IngestKnowledgeBaseDocumentsCommandOutput, +} from "./commands/IngestKnowledgeBaseDocumentsCommand"; import { ListAgentActionGroupsCommand, ListAgentActionGroupsCommandInput, @@ -187,6 +202,11 @@ import { ListIngestionJobsCommandInput, ListIngestionJobsCommandOutput, } from "./commands/ListIngestionJobsCommand"; +import { + ListKnowledgeBaseDocumentsCommand, + ListKnowledgeBaseDocumentsCommandInput, + ListKnowledgeBaseDocumentsCommandOutput, +} from "./commands/ListKnowledgeBaseDocumentsCommand"; import { ListKnowledgeBasesCommand, ListKnowledgeBasesCommandInput, @@ -284,6 +304,7 @@ const commands = { DeleteFlowAliasCommand, DeleteFlowVersionCommand, DeleteKnowledgeBaseCommand, + DeleteKnowledgeBaseDocumentsCommand, DeletePromptCommand, DisassociateAgentKnowledgeBaseCommand, GetAgentCommand, @@ -297,7 +318,9 @@ const commands = { GetFlowVersionCommand, GetIngestionJobCommand, GetKnowledgeBaseCommand, + GetKnowledgeBaseDocumentsCommand, GetPromptCommand, + IngestKnowledgeBaseDocumentsCommand, ListAgentActionGroupsCommand, ListAgentAliasesCommand, ListAgentKnowledgeBasesCommand, @@ -308,6 +331,7 @@ const commands = { ListFlowsCommand, ListFlowVersionsCommand, ListIngestionJobsCommand, + ListKnowledgeBaseDocumentsCommand, ListKnowledgeBasesCommand, ListPromptsCommand, ListTagsForResourceCommand, @@ -634,6 +658,23 @@ export interface BedrockAgent { cb: (err: any, data?: DeleteKnowledgeBaseCommandOutput) => void ): void; + /** + * @see {@link DeleteKnowledgeBaseDocumentsCommand} + */ + deleteKnowledgeBaseDocuments( + args: DeleteKnowledgeBaseDocumentsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + deleteKnowledgeBaseDocuments( + args: DeleteKnowledgeBaseDocumentsCommandInput, + cb: (err: any, data?: DeleteKnowledgeBaseDocumentsCommandOutput) => void + ): void; + deleteKnowledgeBaseDocuments( + args: DeleteKnowledgeBaseDocumentsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteKnowledgeBaseDocumentsCommandOutput) => void + ): void; + /** * @see {@link DeletePromptCommand} */ @@ -810,6 +851,23 @@ export interface BedrockAgent { cb: (err: any, data?: GetKnowledgeBaseCommandOutput) => void ): void; + /** + * @see {@link GetKnowledgeBaseDocumentsCommand} + */ + getKnowledgeBaseDocuments( + args: GetKnowledgeBaseDocumentsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getKnowledgeBaseDocuments( + args: GetKnowledgeBaseDocumentsCommandInput, + cb: (err: any, data?: GetKnowledgeBaseDocumentsCommandOutput) => void + ): void; + getKnowledgeBaseDocuments( + args: GetKnowledgeBaseDocumentsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetKnowledgeBaseDocumentsCommandOutput) => void + ): void; + /** * @see {@link GetPromptCommand} */ @@ -821,6 +879,23 @@ export interface BedrockAgent { cb: (err: any, data?: GetPromptCommandOutput) => void ): void; + /** + * @see {@link IngestKnowledgeBaseDocumentsCommand} + */ + ingestKnowledgeBaseDocuments( + args: IngestKnowledgeBaseDocumentsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + ingestKnowledgeBaseDocuments( + args: IngestKnowledgeBaseDocumentsCommandInput, + cb: (err: any, data?: IngestKnowledgeBaseDocumentsCommandOutput) => void + ): void; + ingestKnowledgeBaseDocuments( + args: IngestKnowledgeBaseDocumentsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: IngestKnowledgeBaseDocumentsCommandOutput) => void + ): void; + /** * @see {@link ListAgentActionGroupsCommand} */ @@ -975,6 +1050,23 @@ export interface BedrockAgent { cb: (err: any, data?: ListIngestionJobsCommandOutput) => void ): void; + /** + * @see {@link ListKnowledgeBaseDocumentsCommand} + */ + listKnowledgeBaseDocuments( + args: ListKnowledgeBaseDocumentsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listKnowledgeBaseDocuments( + args: ListKnowledgeBaseDocumentsCommandInput, + cb: (err: any, data?: ListKnowledgeBaseDocumentsCommandOutput) => void + ): void; + listKnowledgeBaseDocuments( + args: ListKnowledgeBaseDocumentsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListKnowledgeBaseDocumentsCommandOutput) => void + ): void; + /** * @see {@link ListKnowledgeBasesCommand} */ diff --git a/clients/client-bedrock-agent/src/BedrockAgentClient.ts b/clients/client-bedrock-agent/src/BedrockAgentClient.ts index a0df5465b7fb..535b1a86729c 100644 --- a/clients/client-bedrock-agent/src/BedrockAgentClient.ts +++ b/clients/client-bedrock-agent/src/BedrockAgentClient.ts @@ -91,6 +91,10 @@ import { DeleteKnowledgeBaseCommandInput, DeleteKnowledgeBaseCommandOutput, } from "./commands/DeleteKnowledgeBaseCommand"; +import { + DeleteKnowledgeBaseDocumentsCommandInput, + DeleteKnowledgeBaseDocumentsCommandOutput, +} from "./commands/DeleteKnowledgeBaseDocumentsCommand"; import { DeletePromptCommandInput, DeletePromptCommandOutput } from "./commands/DeletePromptCommand"; import { DisassociateAgentKnowledgeBaseCommandInput, @@ -113,7 +117,15 @@ import { GetFlowCommandInput, GetFlowCommandOutput } from "./commands/GetFlowCom import { GetFlowVersionCommandInput, GetFlowVersionCommandOutput } from "./commands/GetFlowVersionCommand"; import { GetIngestionJobCommandInput, GetIngestionJobCommandOutput } from "./commands/GetIngestionJobCommand"; import { GetKnowledgeBaseCommandInput, GetKnowledgeBaseCommandOutput } from "./commands/GetKnowledgeBaseCommand"; +import { + GetKnowledgeBaseDocumentsCommandInput, + GetKnowledgeBaseDocumentsCommandOutput, +} from "./commands/GetKnowledgeBaseDocumentsCommand"; import { GetPromptCommandInput, GetPromptCommandOutput } from "./commands/GetPromptCommand"; +import { + IngestKnowledgeBaseDocumentsCommandInput, + IngestKnowledgeBaseDocumentsCommandOutput, +} from "./commands/IngestKnowledgeBaseDocumentsCommand"; import { ListAgentActionGroupsCommandInput, ListAgentActionGroupsCommandOutput, @@ -130,6 +142,10 @@ import { ListFlowAliasesCommandInput, ListFlowAliasesCommandOutput } from "./com import { ListFlowsCommandInput, ListFlowsCommandOutput } from "./commands/ListFlowsCommand"; import { ListFlowVersionsCommandInput, ListFlowVersionsCommandOutput } from "./commands/ListFlowVersionsCommand"; import { ListIngestionJobsCommandInput, ListIngestionJobsCommandOutput } from "./commands/ListIngestionJobsCommand"; +import { + ListKnowledgeBaseDocumentsCommandInput, + ListKnowledgeBaseDocumentsCommandOutput, +} from "./commands/ListKnowledgeBaseDocumentsCommand"; import { ListKnowledgeBasesCommandInput, ListKnowledgeBasesCommandOutput } from "./commands/ListKnowledgeBasesCommand"; import { ListPromptsCommandInput, ListPromptsCommandOutput } from "./commands/ListPromptsCommand"; import { @@ -199,6 +215,7 @@ export type ServiceInputTypes = | DeleteFlowCommandInput | DeleteFlowVersionCommandInput | DeleteKnowledgeBaseCommandInput + | DeleteKnowledgeBaseDocumentsCommandInput | DeletePromptCommandInput | DisassociateAgentKnowledgeBaseCommandInput | GetAgentActionGroupCommandInput @@ -212,7 +229,9 @@ export type ServiceInputTypes = | GetFlowVersionCommandInput | GetIngestionJobCommandInput | GetKnowledgeBaseCommandInput + | GetKnowledgeBaseDocumentsCommandInput | GetPromptCommandInput + | IngestKnowledgeBaseDocumentsCommandInput | ListAgentActionGroupsCommandInput | ListAgentAliasesCommandInput | ListAgentKnowledgeBasesCommandInput @@ -223,6 +242,7 @@ export type ServiceInputTypes = | ListFlowVersionsCommandInput | ListFlowsCommandInput | ListIngestionJobsCommandInput + | ListKnowledgeBaseDocumentsCommandInput | ListKnowledgeBasesCommandInput | ListPromptsCommandInput | ListTagsForResourceCommandInput @@ -267,6 +287,7 @@ export type ServiceOutputTypes = | DeleteFlowCommandOutput | DeleteFlowVersionCommandOutput | DeleteKnowledgeBaseCommandOutput + | DeleteKnowledgeBaseDocumentsCommandOutput | DeletePromptCommandOutput | DisassociateAgentKnowledgeBaseCommandOutput | GetAgentActionGroupCommandOutput @@ -280,7 +301,9 @@ export type ServiceOutputTypes = | GetFlowVersionCommandOutput | GetIngestionJobCommandOutput | GetKnowledgeBaseCommandOutput + | GetKnowledgeBaseDocumentsCommandOutput | GetPromptCommandOutput + | IngestKnowledgeBaseDocumentsCommandOutput | ListAgentActionGroupsCommandOutput | ListAgentAliasesCommandOutput | ListAgentKnowledgeBasesCommandOutput @@ -291,6 +314,7 @@ export type ServiceOutputTypes = | ListFlowVersionsCommandOutput | ListFlowsCommandOutput | ListIngestionJobsCommandOutput + | ListKnowledgeBaseDocumentsCommandOutput | ListKnowledgeBasesCommandOutput | ListPromptsCommandOutput | ListTagsForResourceCommandOutput diff --git a/clients/client-bedrock-agent/src/commands/AssociateAgentKnowledgeBaseCommand.ts b/clients/client-bedrock-agent/src/commands/AssociateAgentKnowledgeBaseCommand.ts index 1facfc0fd5f1..ac178f64c42b 100644 --- a/clients/client-bedrock-agent/src/commands/AssociateAgentKnowledgeBaseCommand.ts +++ b/clients/client-bedrock-agent/src/commands/AssociateAgentKnowledgeBaseCommand.ts @@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; import { commonParams } from "../endpoint/EndpointParameters"; -import { AssociateAgentKnowledgeBaseRequest, AssociateAgentKnowledgeBaseResponse } from "../models/models_0"; +import { AssociateAgentKnowledgeBaseRequest, AssociateAgentKnowledgeBaseResponse } from "../models/models_1"; import { de_AssociateAgentKnowledgeBaseCommand, se_AssociateAgentKnowledgeBaseCommand, diff --git a/clients/client-bedrock-agent/src/commands/CreateDataSourceCommand.ts b/clients/client-bedrock-agent/src/commands/CreateDataSourceCommand.ts index a09deaf213ca..dd256d6c498a 100644 --- a/clients/client-bedrock-agent/src/commands/CreateDataSourceCommand.ts +++ b/clients/client-bedrock-agent/src/commands/CreateDataSourceCommand.ts @@ -33,7 +33,7 @@ export interface CreateDataSourceCommandInput extends CreateDataSourceRequest {} export interface CreateDataSourceCommandOutput extends CreateDataSourceResponse, __MetadataBearer {} /** - *

Creates a data source connector for a knowledge base.

+ *

Connects a knowledge base to a data source. You specify the configuration for the specific data source service in the dataSourceConfiguration field.

* *

You can't change the chunkingConfiguration after you create the data source connector.

*
@@ -49,7 +49,7 @@ export interface CreateDataSourceCommandOutput extends CreateDataSourceResponse, * name: "STRING_VALUE", // required * description: "STRING_VALUE", * dataSourceConfiguration: { // DataSourceConfiguration - * type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT", // required + * type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT" || "CUSTOM", // required * s3Configuration: { // S3DataSourceConfiguration * bucketArn: "STRING_VALUE", // required * inclusionPrefixes: [ // S3Prefixes @@ -219,7 +219,7 @@ export interface CreateDataSourceCommandOutput extends CreateDataSourceResponse, * // status: "AVAILABLE" || "DELETING" || "DELETE_UNSUCCESSFUL", // required * // description: "STRING_VALUE", * // dataSourceConfiguration: { // DataSourceConfiguration - * // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT", // required + * // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT" || "CUSTOM", // required * // s3Configuration: { // S3DataSourceConfiguration * // bucketArn: "STRING_VALUE", // required * // inclusionPrefixes: [ // S3Prefixes diff --git a/clients/client-bedrock-agent/src/commands/CreateKnowledgeBaseCommand.ts b/clients/client-bedrock-agent/src/commands/CreateKnowledgeBaseCommand.ts index 3de0504d04aa..a4220264c6e6 100644 --- a/clients/client-bedrock-agent/src/commands/CreateKnowledgeBaseCommand.ts +++ b/clients/client-bedrock-agent/src/commands/CreateKnowledgeBaseCommand.ts @@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; import { commonParams } from "../endpoint/EndpointParameters"; -import { CreateKnowledgeBaseRequest, CreateKnowledgeBaseResponse } from "../models/models_0"; +import { CreateKnowledgeBaseRequest, CreateKnowledgeBaseResponse } from "../models/models_1"; import { de_CreateKnowledgeBaseCommand, se_CreateKnowledgeBaseCommand } from "../protocols/Aws_restJson1"; /** diff --git a/clients/client-bedrock-agent/src/commands/DeleteKnowledgeBaseCommand.ts b/clients/client-bedrock-agent/src/commands/DeleteKnowledgeBaseCommand.ts index 30da10492f95..a592c19fee71 100644 --- a/clients/client-bedrock-agent/src/commands/DeleteKnowledgeBaseCommand.ts +++ b/clients/client-bedrock-agent/src/commands/DeleteKnowledgeBaseCommand.ts @@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; import { commonParams } from "../endpoint/EndpointParameters"; -import { DeleteKnowledgeBaseRequest, DeleteKnowledgeBaseResponse } from "../models/models_0"; +import { DeleteKnowledgeBaseRequest, DeleteKnowledgeBaseResponse } from "../models/models_1"; import { de_DeleteKnowledgeBaseCommand, se_DeleteKnowledgeBaseCommand } from "../protocols/Aws_restJson1"; /** diff --git a/clients/client-bedrock-agent/src/commands/DeleteKnowledgeBaseDocumentsCommand.ts b/clients/client-bedrock-agent/src/commands/DeleteKnowledgeBaseDocumentsCommand.ts new file mode 100644 index 000000000000..2a3cbd7223e2 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/DeleteKnowledgeBaseDocumentsCommand.ts @@ -0,0 +1,145 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { DeleteKnowledgeBaseDocumentsRequest, DeleteKnowledgeBaseDocumentsResponse } from "../models/models_0"; +import { + de_DeleteKnowledgeBaseDocumentsCommand, + se_DeleteKnowledgeBaseDocumentsCommand, +} from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DeleteKnowledgeBaseDocumentsCommand}. + */ +export interface DeleteKnowledgeBaseDocumentsCommandInput extends DeleteKnowledgeBaseDocumentsRequest {} +/** + * @public + * + * The output of {@link DeleteKnowledgeBaseDocumentsCommand}. + */ +export interface DeleteKnowledgeBaseDocumentsCommandOutput + extends DeleteKnowledgeBaseDocumentsResponse, + __MetadataBearer {} + +/** + *

Deletes documents from a data source and syncs the changes to the knowledge base that is connected to it. For more information, see Ingest documents into a knowledge base in real-time in the Amazon Bedrock User Guide.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, DeleteKnowledgeBaseDocumentsCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, DeleteKnowledgeBaseDocumentsCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // DeleteKnowledgeBaseDocumentsRequest + * knowledgeBaseId: "STRING_VALUE", // required + * dataSourceId: "STRING_VALUE", // required + * clientToken: "STRING_VALUE", + * documentIdentifiers: [ // DocumentIdentifiers // required + * { // DocumentIdentifier + * dataSourceType: "CUSTOM" || "S3", // required + * s3: { // S3Location + * uri: "STRING_VALUE", // required + * }, + * custom: { // CustomDocumentIdentifier + * id: "STRING_VALUE", // required + * }, + * }, + * ], + * }; + * const command = new DeleteKnowledgeBaseDocumentsCommand(input); + * const response = await client.send(command); + * // { // DeleteKnowledgeBaseDocumentsResponse + * // documentDetails: [ // KnowledgeBaseDocumentDetails + * // { // KnowledgeBaseDocumentDetail + * // knowledgeBaseId: "STRING_VALUE", // required + * // dataSourceId: "STRING_VALUE", // required + * // status: "INDEXED" || "PARTIALLY_INDEXED" || "PENDING" || "FAILED" || "METADATA_PARTIALLY_INDEXED" || "METADATA_UPDATE_FAILED" || "IGNORED" || "NOT_FOUND" || "STARTING" || "IN_PROGRESS" || "DELETING" || "DELETE_IN_PROGRESS", // required + * // identifier: { // DocumentIdentifier + * // dataSourceType: "CUSTOM" || "S3", // required + * // s3: { // S3Location + * // uri: "STRING_VALUE", // required + * // }, + * // custom: { // CustomDocumentIdentifier + * // id: "STRING_VALUE", // required + * // }, + * // }, + * // statusReason: "STRING_VALUE", + * // updatedAt: new Date("TIMESTAMP"), + * // }, + * // ], + * // }; + * + * ``` + * + * @param DeleteKnowledgeBaseDocumentsCommandInput - {@link DeleteKnowledgeBaseDocumentsCommandInput} + * @returns {@link DeleteKnowledgeBaseDocumentsCommandOutput} + * @see {@link DeleteKnowledgeBaseDocumentsCommandInput} for command's `input` shape. + * @see {@link DeleteKnowledgeBaseDocumentsCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

The request is denied because of missing access permissions.

+ * + * @throws {@link InternalServerException} (server fault) + *

An internal server error occurred. Retry your request.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

The number of requests exceeds the service quota. Resubmit your request later.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The number of requests exceeds the limit. Resubmit your request later.

+ * + * @throws {@link ValidationException} (client fault) + *

Input validation failed. Check your request parameters and retry the request.

+ * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + * @public + */ +export class DeleteKnowledgeBaseDocumentsCommand extends $Command + .classBuilder< + DeleteKnowledgeBaseDocumentsCommandInput, + DeleteKnowledgeBaseDocumentsCommandOutput, + BedrockAgentClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BedrockAgentClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonBedrockAgentBuildTimeLambda", "DeleteKnowledgeBaseDocuments", {}) + .n("BedrockAgentClient", "DeleteKnowledgeBaseDocumentsCommand") + .f(void 0, void 0) + .ser(se_DeleteKnowledgeBaseDocumentsCommand) + .de(de_DeleteKnowledgeBaseDocumentsCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: DeleteKnowledgeBaseDocumentsRequest; + output: DeleteKnowledgeBaseDocumentsResponse; + }; + sdk: { + input: DeleteKnowledgeBaseDocumentsCommandInput; + output: DeleteKnowledgeBaseDocumentsCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent/src/commands/DisassociateAgentKnowledgeBaseCommand.ts b/clients/client-bedrock-agent/src/commands/DisassociateAgentKnowledgeBaseCommand.ts index 089d7dfe07e8..ab868d843c90 100644 --- a/clients/client-bedrock-agent/src/commands/DisassociateAgentKnowledgeBaseCommand.ts +++ b/clients/client-bedrock-agent/src/commands/DisassociateAgentKnowledgeBaseCommand.ts @@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; import { commonParams } from "../endpoint/EndpointParameters"; -import { DisassociateAgentKnowledgeBaseRequest, DisassociateAgentKnowledgeBaseResponse } from "../models/models_0"; +import { DisassociateAgentKnowledgeBaseRequest, DisassociateAgentKnowledgeBaseResponse } from "../models/models_1"; import { de_DisassociateAgentKnowledgeBaseCommand, se_DisassociateAgentKnowledgeBaseCommand, diff --git a/clients/client-bedrock-agent/src/commands/GetDataSourceCommand.ts b/clients/client-bedrock-agent/src/commands/GetDataSourceCommand.ts index c395eadcf80c..089c4084bc77 100644 --- a/clients/client-bedrock-agent/src/commands/GetDataSourceCommand.ts +++ b/clients/client-bedrock-agent/src/commands/GetDataSourceCommand.ts @@ -53,7 +53,7 @@ export interface GetDataSourceCommandOutput extends GetDataSourceResponse, __Met * // status: "AVAILABLE" || "DELETING" || "DELETE_UNSUCCESSFUL", // required * // description: "STRING_VALUE", * // dataSourceConfiguration: { // DataSourceConfiguration - * // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT", // required + * // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT" || "CUSTOM", // required * // s3Configuration: { // S3DataSourceConfiguration * // bucketArn: "STRING_VALUE", // required * // inclusionPrefixes: [ // S3Prefixes diff --git a/clients/client-bedrock-agent/src/commands/GetKnowledgeBaseDocumentsCommand.ts b/clients/client-bedrock-agent/src/commands/GetKnowledgeBaseDocumentsCommand.ts new file mode 100644 index 000000000000..c4b7e3e6458d --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/GetKnowledgeBaseDocumentsCommand.ts @@ -0,0 +1,139 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { GetKnowledgeBaseDocumentsRequest, GetKnowledgeBaseDocumentsResponse } from "../models/models_0"; +import { de_GetKnowledgeBaseDocumentsCommand, se_GetKnowledgeBaseDocumentsCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GetKnowledgeBaseDocumentsCommand}. + */ +export interface GetKnowledgeBaseDocumentsCommandInput extends GetKnowledgeBaseDocumentsRequest {} +/** + * @public + * + * The output of {@link GetKnowledgeBaseDocumentsCommand}. + */ +export interface GetKnowledgeBaseDocumentsCommandOutput extends GetKnowledgeBaseDocumentsResponse, __MetadataBearer {} + +/** + *

Retrieves specific documents from a data source that is connected to a knowledge base. For more information, see Ingest documents into a knowledge base in real-time in the Amazon Bedrock User Guide.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, GetKnowledgeBaseDocumentsCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, GetKnowledgeBaseDocumentsCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // GetKnowledgeBaseDocumentsRequest + * knowledgeBaseId: "STRING_VALUE", // required + * dataSourceId: "STRING_VALUE", // required + * documentIdentifiers: [ // DocumentIdentifiers // required + * { // DocumentIdentifier + * dataSourceType: "CUSTOM" || "S3", // required + * s3: { // S3Location + * uri: "STRING_VALUE", // required + * }, + * custom: { // CustomDocumentIdentifier + * id: "STRING_VALUE", // required + * }, + * }, + * ], + * }; + * const command = new GetKnowledgeBaseDocumentsCommand(input); + * const response = await client.send(command); + * // { // GetKnowledgeBaseDocumentsResponse + * // documentDetails: [ // KnowledgeBaseDocumentDetails + * // { // KnowledgeBaseDocumentDetail + * // knowledgeBaseId: "STRING_VALUE", // required + * // dataSourceId: "STRING_VALUE", // required + * // status: "INDEXED" || "PARTIALLY_INDEXED" || "PENDING" || "FAILED" || "METADATA_PARTIALLY_INDEXED" || "METADATA_UPDATE_FAILED" || "IGNORED" || "NOT_FOUND" || "STARTING" || "IN_PROGRESS" || "DELETING" || "DELETE_IN_PROGRESS", // required + * // identifier: { // DocumentIdentifier + * // dataSourceType: "CUSTOM" || "S3", // required + * // s3: { // S3Location + * // uri: "STRING_VALUE", // required + * // }, + * // custom: { // CustomDocumentIdentifier + * // id: "STRING_VALUE", // required + * // }, + * // }, + * // statusReason: "STRING_VALUE", + * // updatedAt: new Date("TIMESTAMP"), + * // }, + * // ], + * // }; + * + * ``` + * + * @param GetKnowledgeBaseDocumentsCommandInput - {@link GetKnowledgeBaseDocumentsCommandInput} + * @returns {@link GetKnowledgeBaseDocumentsCommandOutput} + * @see {@link GetKnowledgeBaseDocumentsCommandInput} for command's `input` shape. + * @see {@link GetKnowledgeBaseDocumentsCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

The request is denied because of missing access permissions.

+ * + * @throws {@link InternalServerException} (server fault) + *

An internal server error occurred. Retry your request.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

The number of requests exceeds the service quota. Resubmit your request later.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The number of requests exceeds the limit. Resubmit your request later.

+ * + * @throws {@link ValidationException} (client fault) + *

Input validation failed. Check your request parameters and retry the request.

+ * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + * @public + */ +export class GetKnowledgeBaseDocumentsCommand extends $Command + .classBuilder< + GetKnowledgeBaseDocumentsCommandInput, + GetKnowledgeBaseDocumentsCommandOutput, + BedrockAgentClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BedrockAgentClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonBedrockAgentBuildTimeLambda", "GetKnowledgeBaseDocuments", {}) + .n("BedrockAgentClient", "GetKnowledgeBaseDocumentsCommand") + .f(void 0, void 0) + .ser(se_GetKnowledgeBaseDocumentsCommand) + .de(de_GetKnowledgeBaseDocumentsCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: GetKnowledgeBaseDocumentsRequest; + output: GetKnowledgeBaseDocumentsResponse; + }; + sdk: { + input: GetKnowledgeBaseDocumentsCommandInput; + output: GetKnowledgeBaseDocumentsCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent/src/commands/IngestKnowledgeBaseDocumentsCommand.ts b/clients/client-bedrock-agent/src/commands/IngestKnowledgeBaseDocumentsCommand.ts new file mode 100644 index 000000000000..e6064f6a66c5 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/IngestKnowledgeBaseDocumentsCommand.ts @@ -0,0 +1,191 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { + IngestKnowledgeBaseDocumentsRequest, + IngestKnowledgeBaseDocumentsRequestFilterSensitiveLog, + IngestKnowledgeBaseDocumentsResponse, +} from "../models/models_0"; +import { + de_IngestKnowledgeBaseDocumentsCommand, + se_IngestKnowledgeBaseDocumentsCommand, +} from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link IngestKnowledgeBaseDocumentsCommand}. + */ +export interface IngestKnowledgeBaseDocumentsCommandInput extends IngestKnowledgeBaseDocumentsRequest {} +/** + * @public + * + * The output of {@link IngestKnowledgeBaseDocumentsCommand}. + */ +export interface IngestKnowledgeBaseDocumentsCommandOutput + extends IngestKnowledgeBaseDocumentsResponse, + __MetadataBearer {} + +/** + *

Ingests documents directly into the knowledge base that is connected to the data source. The dataSourceType specified in the content for each document must match the type of the data source that you specify in the header. For more information, see Ingest documents into a knowledge base in real-time in the Amazon Bedrock User Guide.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, IngestKnowledgeBaseDocumentsCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, IngestKnowledgeBaseDocumentsCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // IngestKnowledgeBaseDocumentsRequest + * knowledgeBaseId: "STRING_VALUE", // required + * dataSourceId: "STRING_VALUE", // required + * clientToken: "STRING_VALUE", + * documents: [ // KnowledgeBaseDocuments // required + * { // KnowledgeBaseDocument + * metadata: { // DocumentMetadata + * type: "IN_LINE_ATTRIBUTE" || "S3_LOCATION", // required + * inlineAttributes: [ // MetadataAttributes + * { // MetadataAttribute + * key: "STRING_VALUE", // required + * value: { // MetadataAttributeValue + * type: "BOOLEAN" || "NUMBER" || "STRING" || "STRING_LIST", // required + * numberValue: Number("double"), + * booleanValue: true || false, + * stringValue: "STRING_VALUE", + * stringListValue: [ // StringListValue + * "STRING_VALUE", + * ], + * }, + * }, + * ], + * s3Location: { // CustomS3Location + * uri: "STRING_VALUE", // required + * bucketOwnerAccountId: "STRING_VALUE", + * }, + * }, + * content: { // DocumentContent + * dataSourceType: "CUSTOM" || "S3", // required + * custom: { // CustomContent + * customDocumentIdentifier: { // CustomDocumentIdentifier + * id: "STRING_VALUE", // required + * }, + * sourceType: "IN_LINE" || "S3_LOCATION", // required + * s3Location: { + * uri: "STRING_VALUE", // required + * bucketOwnerAccountId: "STRING_VALUE", + * }, + * inlineContent: { // InlineContent + * type: "BYTE" || "TEXT", // required + * byteContent: { // ByteContentDoc + * mimeType: "STRING_VALUE", // required + * data: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") // required + * }, + * textContent: { // TextContentDoc + * data: "STRING_VALUE", // required + * }, + * }, + * }, + * s3: { // S3Content + * s3Location: { // S3Location + * uri: "STRING_VALUE", // required + * }, + * }, + * }, + * }, + * ], + * }; + * const command = new IngestKnowledgeBaseDocumentsCommand(input); + * const response = await client.send(command); + * // { // IngestKnowledgeBaseDocumentsResponse + * // documentDetails: [ // KnowledgeBaseDocumentDetails + * // { // KnowledgeBaseDocumentDetail + * // knowledgeBaseId: "STRING_VALUE", // required + * // dataSourceId: "STRING_VALUE", // required + * // status: "INDEXED" || "PARTIALLY_INDEXED" || "PENDING" || "FAILED" || "METADATA_PARTIALLY_INDEXED" || "METADATA_UPDATE_FAILED" || "IGNORED" || "NOT_FOUND" || "STARTING" || "IN_PROGRESS" || "DELETING" || "DELETE_IN_PROGRESS", // required + * // identifier: { // DocumentIdentifier + * // dataSourceType: "CUSTOM" || "S3", // required + * // s3: { // S3Location + * // uri: "STRING_VALUE", // required + * // }, + * // custom: { // CustomDocumentIdentifier + * // id: "STRING_VALUE", // required + * // }, + * // }, + * // statusReason: "STRING_VALUE", + * // updatedAt: new Date("TIMESTAMP"), + * // }, + * // ], + * // }; + * + * ``` + * + * @param IngestKnowledgeBaseDocumentsCommandInput - {@link IngestKnowledgeBaseDocumentsCommandInput} + * @returns {@link IngestKnowledgeBaseDocumentsCommandOutput} + * @see {@link IngestKnowledgeBaseDocumentsCommandInput} for command's `input` shape. + * @see {@link IngestKnowledgeBaseDocumentsCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

The request is denied because of missing access permissions.

+ * + * @throws {@link InternalServerException} (server fault) + *

An internal server error occurred. Retry your request.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

The number of requests exceeds the service quota. Resubmit your request later.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The number of requests exceeds the limit. Resubmit your request later.

+ * + * @throws {@link ValidationException} (client fault) + *

Input validation failed. Check your request parameters and retry the request.

+ * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + * @public + */ +export class IngestKnowledgeBaseDocumentsCommand extends $Command + .classBuilder< + IngestKnowledgeBaseDocumentsCommandInput, + IngestKnowledgeBaseDocumentsCommandOutput, + BedrockAgentClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BedrockAgentClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonBedrockAgentBuildTimeLambda", "IngestKnowledgeBaseDocuments", {}) + .n("BedrockAgentClient", "IngestKnowledgeBaseDocumentsCommand") + .f(IngestKnowledgeBaseDocumentsRequestFilterSensitiveLog, void 0) + .ser(se_IngestKnowledgeBaseDocumentsCommand) + .de(de_IngestKnowledgeBaseDocumentsCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: IngestKnowledgeBaseDocumentsRequest; + output: IngestKnowledgeBaseDocumentsResponse; + }; + sdk: { + input: IngestKnowledgeBaseDocumentsCommandInput; + output: IngestKnowledgeBaseDocumentsCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent/src/commands/ListKnowledgeBaseDocumentsCommand.ts b/clients/client-bedrock-agent/src/commands/ListKnowledgeBaseDocumentsCommand.ts new file mode 100644 index 000000000000..b6d9eebf1c31 --- /dev/null +++ b/clients/client-bedrock-agent/src/commands/ListKnowledgeBaseDocumentsCommand.ts @@ -0,0 +1,131 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { BedrockAgentClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { ListKnowledgeBaseDocumentsRequest, ListKnowledgeBaseDocumentsResponse } from "../models/models_0"; +import { de_ListKnowledgeBaseDocumentsCommand, se_ListKnowledgeBaseDocumentsCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ListKnowledgeBaseDocumentsCommand}. + */ +export interface ListKnowledgeBaseDocumentsCommandInput extends ListKnowledgeBaseDocumentsRequest {} +/** + * @public + * + * The output of {@link ListKnowledgeBaseDocumentsCommand}. + */ +export interface ListKnowledgeBaseDocumentsCommandOutput extends ListKnowledgeBaseDocumentsResponse, __MetadataBearer {} + +/** + *

Retrieves all the documents contained in a data source that is connected to a knowledge base. For more information, see Ingest documents into a knowledge base in real-time in the Amazon Bedrock User Guide.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentClient, ListKnowledgeBaseDocumentsCommand } from "@aws-sdk/client-bedrock-agent"; // ES Modules import + * // const { BedrockAgentClient, ListKnowledgeBaseDocumentsCommand } = require("@aws-sdk/client-bedrock-agent"); // CommonJS import + * const client = new BedrockAgentClient(config); + * const input = { // ListKnowledgeBaseDocumentsRequest + * knowledgeBaseId: "STRING_VALUE", // required + * dataSourceId: "STRING_VALUE", // required + * maxResults: Number("int"), + * nextToken: "STRING_VALUE", + * }; + * const command = new ListKnowledgeBaseDocumentsCommand(input); + * const response = await client.send(command); + * // { // ListKnowledgeBaseDocumentsResponse + * // documentDetails: [ // KnowledgeBaseDocumentDetails // required + * // { // KnowledgeBaseDocumentDetail + * // knowledgeBaseId: "STRING_VALUE", // required + * // dataSourceId: "STRING_VALUE", // required + * // status: "INDEXED" || "PARTIALLY_INDEXED" || "PENDING" || "FAILED" || "METADATA_PARTIALLY_INDEXED" || "METADATA_UPDATE_FAILED" || "IGNORED" || "NOT_FOUND" || "STARTING" || "IN_PROGRESS" || "DELETING" || "DELETE_IN_PROGRESS", // required + * // identifier: { // DocumentIdentifier + * // dataSourceType: "CUSTOM" || "S3", // required + * // s3: { // S3Location + * // uri: "STRING_VALUE", // required + * // }, + * // custom: { // CustomDocumentIdentifier + * // id: "STRING_VALUE", // required + * // }, + * // }, + * // statusReason: "STRING_VALUE", + * // updatedAt: new Date("TIMESTAMP"), + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListKnowledgeBaseDocumentsCommandInput - {@link ListKnowledgeBaseDocumentsCommandInput} + * @returns {@link ListKnowledgeBaseDocumentsCommandOutput} + * @see {@link ListKnowledgeBaseDocumentsCommandInput} for command's `input` shape. + * @see {@link ListKnowledgeBaseDocumentsCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentClientResolvedConfig | config} for BedrockAgentClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

The request is denied because of missing access permissions.

+ * + * @throws {@link InternalServerException} (server fault) + *

An internal server error occurred. Retry your request.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

The number of requests exceeds the service quota. Resubmit your request later.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The number of requests exceeds the limit. Resubmit your request later.

+ * + * @throws {@link ValidationException} (client fault) + *

Input validation failed. Check your request parameters and retry the request.

+ * + * @throws {@link BedrockAgentServiceException} + *

Base exception class for all service exceptions from BedrockAgent service.

+ * + * @public + */ +export class ListKnowledgeBaseDocumentsCommand extends $Command + .classBuilder< + ListKnowledgeBaseDocumentsCommandInput, + ListKnowledgeBaseDocumentsCommandOutput, + BedrockAgentClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BedrockAgentClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonBedrockAgentBuildTimeLambda", "ListKnowledgeBaseDocuments", {}) + .n("BedrockAgentClient", "ListKnowledgeBaseDocumentsCommand") + .f(void 0, void 0) + .ser(se_ListKnowledgeBaseDocumentsCommand) + .de(de_ListKnowledgeBaseDocumentsCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ListKnowledgeBaseDocumentsRequest; + output: ListKnowledgeBaseDocumentsResponse; + }; + sdk: { + input: ListKnowledgeBaseDocumentsCommandInput; + output: ListKnowledgeBaseDocumentsCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent/src/commands/UpdateDataSourceCommand.ts b/clients/client-bedrock-agent/src/commands/UpdateDataSourceCommand.ts index 3dbc6b2b312f..f5a7b695db1b 100644 --- a/clients/client-bedrock-agent/src/commands/UpdateDataSourceCommand.ts +++ b/clients/client-bedrock-agent/src/commands/UpdateDataSourceCommand.ts @@ -49,7 +49,7 @@ export interface UpdateDataSourceCommandOutput extends UpdateDataSourceResponse, * name: "STRING_VALUE", // required * description: "STRING_VALUE", * dataSourceConfiguration: { // DataSourceConfiguration - * type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT", // required + * type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT" || "CUSTOM", // required * s3Configuration: { // S3DataSourceConfiguration * bucketArn: "STRING_VALUE", // required * inclusionPrefixes: [ // S3Prefixes @@ -219,7 +219,7 @@ export interface UpdateDataSourceCommandOutput extends UpdateDataSourceResponse, * // status: "AVAILABLE" || "DELETING" || "DELETE_UNSUCCESSFUL", // required * // description: "STRING_VALUE", * // dataSourceConfiguration: { // DataSourceConfiguration - * // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT", // required + * // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT" || "CUSTOM", // required * // s3Configuration: { // S3DataSourceConfiguration * // bucketArn: "STRING_VALUE", // required * // inclusionPrefixes: [ // S3Prefixes diff --git a/clients/client-bedrock-agent/src/commands/index.ts b/clients/client-bedrock-agent/src/commands/index.ts index ffc07c4e8d35..4469e3d7982b 100644 --- a/clients/client-bedrock-agent/src/commands/index.ts +++ b/clients/client-bedrock-agent/src/commands/index.ts @@ -19,6 +19,7 @@ export * from "./DeleteFlowAliasCommand"; export * from "./DeleteFlowCommand"; export * from "./DeleteFlowVersionCommand"; export * from "./DeleteKnowledgeBaseCommand"; +export * from "./DeleteKnowledgeBaseDocumentsCommand"; export * from "./DeletePromptCommand"; export * from "./DisassociateAgentKnowledgeBaseCommand"; export * from "./GetAgentActionGroupCommand"; @@ -32,7 +33,9 @@ export * from "./GetFlowCommand"; export * from "./GetFlowVersionCommand"; export * from "./GetIngestionJobCommand"; export * from "./GetKnowledgeBaseCommand"; +export * from "./GetKnowledgeBaseDocumentsCommand"; export * from "./GetPromptCommand"; +export * from "./IngestKnowledgeBaseDocumentsCommand"; export * from "./ListAgentActionGroupsCommand"; export * from "./ListAgentAliasesCommand"; export * from "./ListAgentKnowledgeBasesCommand"; @@ -43,6 +46,7 @@ export * from "./ListFlowAliasesCommand"; export * from "./ListFlowVersionsCommand"; export * from "./ListFlowsCommand"; export * from "./ListIngestionJobsCommand"; +export * from "./ListKnowledgeBaseDocumentsCommand"; export * from "./ListKnowledgeBasesCommand"; export * from "./ListPromptsCommand"; export * from "./ListTagsForResourceCommand"; diff --git a/clients/client-bedrock-agent/src/models/models_0.ts b/clients/client-bedrock-agent/src/models/models_0.ts index 8f691c4c0bf0..90250b8ebdc5 100644 --- a/clients/client-bedrock-agent/src/models/models_0.ts +++ b/clients/client-bedrock-agent/src/models/models_0.ts @@ -2906,6 +2906,7 @@ export interface SharePointDataSourceConfiguration { */ export const DataSourceType = { CONFLUENCE: "CONFLUENCE", + CUSTOM: "CUSTOM", S3: "S3", SALESFORCE: "SALESFORCE", SHAREPOINT: "SHAREPOINT", @@ -8439,717 +8440,675 @@ export interface StopIngestionJobResponse { } /** + *

Contains information about the identifier of the document to ingest into a custom data source.

* @public */ -export interface AssociateAgentKnowledgeBaseRequest { +export interface CustomDocumentIdentifier { /** - *

The unique identifier of the agent with which you want to associate the knowledge base.

+ *

The identifier of the document to ingest into a custom data source.

* @public */ - agentId: string | undefined; - - /** - *

The version of the agent with which you want to associate the knowledge base.

- * @public - */ - agentVersion: string | undefined; - - /** - *

The unique identifier of the knowledge base to associate with the agent.

- * @public - */ - knowledgeBaseId: string | undefined; - - /** - *

A description of what the agent should use the knowledge base for.

- * @public - */ - description: string | undefined; - - /** - *

Specifies whether to use the knowledge base or not when sending an InvokeAgent request.

- * @public - */ - knowledgeBaseState?: KnowledgeBaseState | undefined; -} - -/** - * @public - */ -export interface AssociateAgentKnowledgeBaseResponse { - /** - *

Contains details about the knowledge base that has been associated with the agent.

- * @public - */ - agentKnowledgeBase: AgentKnowledgeBase | undefined; + id: string | undefined; } /** * @public * @enum */ -export const KnowledgeBaseType = { - VECTOR: "VECTOR", -} as const; - -/** - * @public - */ -export type KnowledgeBaseType = (typeof KnowledgeBaseType)[keyof typeof KnowledgeBaseType]; - -/** - * @public - * @enum - */ -export const EmbeddingDataType = { - BINARY: "BINARY", - FLOAT32: "FLOAT32", +export const ContentDataSourceType = { + CUSTOM: "CUSTOM", + S3: "S3", } as const; /** * @public */ -export type EmbeddingDataType = (typeof EmbeddingDataType)[keyof typeof EmbeddingDataType]; +export type ContentDataSourceType = (typeof ContentDataSourceType)[keyof typeof ContentDataSourceType]; /** - *

The vector configuration details for the Bedrock embeddings model.

+ *

Contains information that identifies the document.

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

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

+ *

The type of data source connected to the knowledge base that contains the document.

* @public */ - dimensions?: number | undefined; + dataSourceType: ContentDataSourceType | undefined; /** - *

The data type for the vectors when using a model to convert text into vector - * embeddings. The model must support the specified data type for vector embeddings. - * Floating-point (float32) is the default data type, and is supported by most models - * for vector embeddings. See Supported embeddings - * models for information on the available models and their vector data types.

+ *

Contains information that identifies the document in an S3 data source.

* @public */ - embeddingDataType?: EmbeddingDataType | undefined; -} + s3?: S3Location | undefined; -/** - *

The configuration details for the embeddings model.

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

The vector configuration details on the Bedrock embeddings model.

+ *

Contains information that identifies the document in a custom data source.

* @public */ - bedrockEmbeddingModelConfiguration?: BedrockEmbeddingModelConfiguration | undefined; + custom?: CustomDocumentIdentifier | undefined; } /** - *

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

* @public */ -export interface VectorKnowledgeBaseConfiguration { +export interface DeleteKnowledgeBaseDocumentsRequest { /** - *

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

+ *

The unique identifier of the knowledge base that is connected to the data source.

* @public */ - embeddingModelArn: string | undefined; + knowledgeBaseId: string | undefined; /** - *

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

+ *

The unique identifier of the data source that contains the documents.

* @public */ - embeddingModelConfiguration?: EmbeddingModelConfiguration | undefined; -} + dataSourceId: string | undefined; -/** - *

Contains details about the vector embeddings configuration of the knowledge base.

- * @public - */ -export interface KnowledgeBaseConfiguration { /** - *

The type of data that the data source is converted into for the knowledge base.

+ *

A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, + * Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.

* @public */ - type: KnowledgeBaseType | undefined; + clientToken?: string | undefined; /** - *

Contains details about the model that's used to convert the data source into vector embeddings.

+ *

A list of objects, each of which contains information to identify a document to delete.

* @public */ - vectorKnowledgeBaseConfiguration?: VectorKnowledgeBaseConfiguration | undefined; + documentIdentifiers: DocumentIdentifier[] | undefined; } /** - *

Contains the names of the fields to which to map information about the vector store.

* @public + * @enum */ -export interface MongoDbAtlasFieldMapping { - /** - *

The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

- * @public - */ - vectorField: string | undefined; - - /** - *

The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

- * @public - */ - textField: string | undefined; +export const DocumentStatus = { + DELETE_IN_PROGRESS: "DELETE_IN_PROGRESS", + DELETING: "DELETING", + FAILED: "FAILED", + IGNORED: "IGNORED", + INDEXED: "INDEXED", + IN_PROGRESS: "IN_PROGRESS", + METADATA_PARTIALLY_INDEXED: "METADATA_PARTIALLY_INDEXED", + METADATA_UPDATE_FAILED: "METADATA_UPDATE_FAILED", + NOT_FOUND: "NOT_FOUND", + PARTIALLY_INDEXED: "PARTIALLY_INDEXED", + PENDING: "PENDING", + STARTING: "STARTING", +} as const; - /** - *

The name of the field in which Amazon Bedrock stores metadata about the vector store.

- * @public - */ - metadataField: string | undefined; -} +/** + * @public + */ +export type DocumentStatus = (typeof DocumentStatus)[keyof typeof DocumentStatus]; /** - *

Contains details about the storage configuration of the knowledge base in MongoDB Atlas.

+ *

Contains the details for a document that was ingested or deleted.

* @public */ -export interface MongoDbAtlasConfiguration { +export interface KnowledgeBaseDocumentDetail { /** - *

The endpoint URL of your MongoDB Atlas cluster for your knowledge base.

+ *

The identifier of the knowledge base that the document was ingested into or deleted from.

* @public */ - endpoint: string | undefined; + knowledgeBaseId: string | undefined; /** - *

The database name in your MongoDB Atlas cluster for your knowledge base.

+ *

The identifier of the data source connected to the knowledge base that the document was ingested into or deleted from.

* @public */ - databaseName: string | undefined; + dataSourceId: string | undefined; /** - *

The collection name of the knowledge base in MongoDB Atlas.

+ *

The ingestion status of the document. The following statuses are possible:

+ *
    + *
  • + *

    STARTED – You submitted the ingestion job containing the document.

    + *
  • + *
  • + *

    PENDING – The document is waiting to be ingested.

    + *
  • + *
  • + *

    IN_PROGRESS – The document is being ingested.

    + *
  • + *
  • + *

    INDEXED – The document was successfully indexed.

    + *
  • + *
  • + *

    PARTIALLY_INDEXED – The document was partially indexed.

    + *
  • + *
  • + *

    METADATA_PARTIALLY_INDEXED – You submitted metadata for an existing document and it was partially indexed.

    + *
  • + *
  • + *

    METADATA_UPDATE_FAILED – You submitted a metadata update for an existing document but it failed.

    + *
  • + *
  • + *

    FAILED – The document failed to be ingested.

    + *
  • + *
  • + *

    NOT_FOUND – The document wasn't found.

    + *
  • + *
  • + *

    IGNORED – The document was ignored during ingestion.

    + *
  • + *
  • + *

    DELETING – You submitted the delete job containing the document.

    + *
  • + *
  • + *

    DELETE_IN_PROGRESS – The document is being deleted.

    + *
  • + *
* @public */ - collectionName: string | undefined; + status: DocumentStatus | undefined; /** - *

The name of the MongoDB Atlas vector search index.

+ *

Contains information that identifies the document.

* @public */ - vectorIndexName: string | undefined; + identifier: DocumentIdentifier | undefined; /** - *

The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that contains user credentials for your MongoDB Atlas cluster.

+ *

The reason for the status. Appears alongside the status IGNORED.

* @public */ - credentialsSecretArn: string | undefined; + statusReason?: string | undefined; /** - *

Contains the names of the fields to which to map information about the vector store.

+ *

The date and time at which the document was last updated.

* @public */ - fieldMapping: MongoDbAtlasFieldMapping | undefined; + updatedAt?: Date | undefined; +} +/** + * @public + */ +export interface DeleteKnowledgeBaseDocumentsResponse { /** - *

The name of the VPC endpoint service in your account that is connected to your MongoDB Atlas cluster.

+ *

A list of objects, each of which contains information about the documents that were deleted.

* @public */ - endpointServiceName?: string | undefined; + documentDetails?: KnowledgeBaseDocumentDetail[] | undefined; } /** - *

Contains the names of the fields to which to map information about the vector store.

* @public */ -export interface OpenSearchServerlessFieldMapping { +export interface GetKnowledgeBaseDocumentsRequest { /** - *

The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

+ *

The unique identifier of the knowledge base that is connected to the data source.

* @public */ - vectorField: string | undefined; + knowledgeBaseId: string | undefined; /** - *

The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

+ *

The unique identifier of the data source that contains the documents.

* @public */ - textField: string | undefined; + dataSourceId: string | undefined; /** - *

The name of the field in which Amazon Bedrock stores metadata about the vector store.

+ *

A list of objects, each of which contains information to identify a document for which to retrieve information.

* @public */ - metadataField: string | undefined; + documentIdentifiers: DocumentIdentifier[] | undefined; } /** - *

Contains details about the storage configuration of the knowledge base in Amazon OpenSearch Service. For more information, see Create a vector index in Amazon OpenSearch Service.

* @public */ -export interface OpenSearchServerlessConfiguration { +export interface GetKnowledgeBaseDocumentsResponse { /** - *

The Amazon Resource Name (ARN) of the OpenSearch Service vector store.

+ *

A list of objects, each of which contains information about the documents that were retrieved.

* @public */ - collectionArn: string | undefined; + documentDetails?: KnowledgeBaseDocumentDetail[] | undefined; +} +/** + *

Contains information about content defined inline in bytes.

+ * @public + */ +export interface ByteContentDoc { /** - *

The name of the vector store.

+ *

The MIME type of the content. For a list of MIME types, see Media Types. The following MIME types are supported:

+ *
    + *
  • + *

    text/plain

    + *
  • + *
  • + *

    text/html

    + *
  • + *
  • + *

    text/csv

    + *
  • + *
  • + *

    text/vtt

    + *
  • + *
  • + *

    message/rfc822

    + *
  • + *
  • + *

    application/xhtml+xml

    + *
  • + *
  • + *

    application/pdf

    + *
  • + *
  • + *

    application/msword

    + *
  • + *
  • + *

    application/vnd.ms-word.document.macroenabled.12

    + *
  • + *
  • + *

    application/vnd.ms-word.template.macroenabled.12

    + *
  • + *
  • + *

    application/vnd.ms-excel

    + *
  • + *
  • + *

    application/vnd.ms-excel.addin.macroenabled.12

    + *
  • + *
  • + *

    application/vnd.ms-excel.sheet.macroenabled.12

    + *
  • + *
  • + *

    application/vnd.ms-excel.template.macroenabled.12

    + *
  • + *
  • + *

    application/vnd.ms-excel.sheet.binary.macroenabled.12

    + *
  • + *
  • + *

    application/vnd.ms-spreadsheetml

    + *
  • + *
  • + *

    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

    + *
  • + *
  • + *

    application/vnd.openxmlformats-officedocument.spreadsheetml.template

    + *
  • + *
  • + *

    application/vnd.openxmlformats-officedocument.wordprocessingml.document

    + *
  • + *
  • + *

    application/vnd.openxmlformats-officedocument.wordprocessingml.template

    + *
  • + *
* @public */ - vectorIndexName: string | undefined; + mimeType: string | undefined; /** - *

Contains the names of the fields to which to map information about the vector store.

+ *

The base64-encoded string of the content.

* @public */ - fieldMapping: OpenSearchServerlessFieldMapping | undefined; + data: Uint8Array | undefined; } /** - *

Contains the names of the fields to which to map information about the vector store.

+ *

Contains information about content defined inline in text.

* @public */ -export interface PineconeFieldMapping { - /** - *

The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

- * @public - */ - textField: string | undefined; - +export interface TextContentDoc { /** - *

The name of the field in which Amazon Bedrock stores metadata about the vector store.

+ *

The text of the content.

* @public */ - metadataField: string | undefined; + data: string | undefined; } /** - *

Contains details about the storage configuration of the knowledge base in Pinecone. For more information, see Create a vector index in Pinecone.

* @public + * @enum */ -export interface PineconeConfiguration { - /** - *

The endpoint URL for your index management page.

- * @public - */ - connectionString: string | undefined; +export const InlineContentType = { + BYTE: "BYTE", + TEXT: "TEXT", +} as const; + +/** + * @public + */ +export type InlineContentType = (typeof InlineContentType)[keyof typeof InlineContentType]; +/** + *

Contains information about content defined inline to ingest into a data source. Choose a type and include the field that corresponds to it.

+ * @public + */ +export interface InlineContent { /** - *

The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Pinecone API key.

+ *

The type of inline content to define.

* @public */ - credentialsSecretArn: string | undefined; + type: InlineContentType | undefined; /** - *

The namespace to be used to write new data to your database.

+ *

Contains information about content defined inline in bytes.

* @public */ - namespace?: string | undefined; + byteContent?: ByteContentDoc | undefined; /** - *

Contains the names of the fields to which to map information about the vector store.

+ *

Contains information about content defined inline in text.

* @public */ - fieldMapping: PineconeFieldMapping | undefined; + textContent?: TextContentDoc | undefined; } /** - *

Contains the names of the fields to which to map information about the vector store.

+ *

Contains information about the Amazon S3 location of the file containing the content to ingest into a knowledge base connected to a custom data source.

* @public */ -export interface RdsFieldMapping { +export interface CustomS3Location { /** - *

The name of the field in which Amazon Bedrock stores the ID for each entry.

+ *

The S3 URI of the file containing the content to ingest.

* @public */ - primaryKeyField: string | undefined; - - /** - *

The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

- * @public - */ - vectorField: string | undefined; - - /** - *

The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

- * @public - */ - textField: string | undefined; + uri: string | undefined; /** - *

The name of the field in which Amazon Bedrock stores metadata about the vector store.

+ *

The identifier of the Amazon Web Services account that owns the S3 bucket containing the content to ingest.

* @public */ - metadataField: string | undefined; + bucketOwnerAccountId?: string | undefined; } /** - *

Contains details about the storage configuration of the knowledge base in Amazon RDS. For more information, see Create a vector index in Amazon RDS.

* @public + * @enum */ -export interface RdsConfiguration { - /** - *

The Amazon Resource Name (ARN) of the vector store.

- * @public - */ - resourceArn: string | undefined; +export const CustomSourceType = { + IN_LINE: "IN_LINE", + S3_LOCATION: "S3_LOCATION", +} as const; + +/** + * @public + */ +export type CustomSourceType = (typeof CustomSourceType)[keyof typeof CustomSourceType]; +/** + *

Contains information about the content to ingest into a knowledge base connected to a custom data source. Choose a sourceType and include the field that corresponds to it.

+ * @public + */ +export interface CustomContent { /** - *

The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Amazon RDS database.

+ *

A unique identifier for the document.

* @public */ - credentialsSecretArn: string | undefined; + customDocumentIdentifier: CustomDocumentIdentifier | undefined; /** - *

The name of your Amazon RDS database.

+ *

The source of the data to ingest.

* @public */ - databaseName: string | undefined; + sourceType: CustomSourceType | undefined; /** - *

The name of the table in the database.

+ *

Contains information about the Amazon S3 location of the file from which to ingest data.

* @public */ - tableName: string | undefined; + s3Location?: CustomS3Location | undefined; /** - *

Contains the names of the fields to which to map information about the vector store.

+ *

Contains information about content defined inline to ingest into a knowledge base.

* @public */ - fieldMapping: RdsFieldMapping | undefined; + inlineContent?: InlineContent | undefined; } /** - *

Contains the names of the fields to which to map information about the vector store.

+ *

Contains information about the content to ingest into a knowledge base connected to an Amazon S3 data source.

* @public */ -export interface RedisEnterpriseCloudFieldMapping { - /** - *

The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

- * @public - */ - vectorField: string | undefined; - - /** - *

The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

- * @public - */ - textField: string | undefined; - +export interface S3Content { /** - *

The name of the field in which Amazon Bedrock stores metadata about the vector store.

+ *

The S3 location of the file containing the content to ingest.

* @public */ - metadataField: string | undefined; + s3Location: S3Location | undefined; } /** - *

Contains details about the storage configuration of the knowledge base in Redis Enterprise Cloud. For more information, see Create a vector index in Redis Enterprise Cloud.

+ *

Contains information about the content of a document. Choose a dataSourceType and include the field that corresponds to it.

* @public */ -export interface RedisEnterpriseCloudConfiguration { +export interface DocumentContent { /** - *

The endpoint URL of the Redis Enterprise Cloud database.

+ *

The type of data source that is connected to the knowledge base to which to ingest this document.

* @public */ - endpoint: string | undefined; + dataSourceType: ContentDataSourceType | undefined; /** - *

The name of the vector index.

+ *

Contains information about the content to ingest into a knowledge base connected to a custom data source.

* @public */ - vectorIndexName: string | undefined; + custom?: CustomContent | undefined; /** - *

The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Redis Enterprise Cloud database.

+ *

Contains information about the content to ingest into a knowledge base connected to an Amazon S3 data source

* @public */ - credentialsSecretArn: string | undefined; - - /** - *

Contains the names of the fields to which to map information about the vector store.

- * @public - */ - fieldMapping: RedisEnterpriseCloudFieldMapping | undefined; + s3?: S3Content | undefined; } /** * @public * @enum */ -export const KnowledgeBaseStorageType = { - MONGO_DB_ATLAS: "MONGO_DB_ATLAS", - OPENSEARCH_SERVERLESS: "OPENSEARCH_SERVERLESS", - PINECONE: "PINECONE", - RDS: "RDS", - REDIS_ENTERPRISE_CLOUD: "REDIS_ENTERPRISE_CLOUD", +export const MetadataValueType = { + BOOLEAN: "BOOLEAN", + NUMBER: "NUMBER", + STRING: "STRING", + STRING_LIST: "STRING_LIST", } as const; /** * @public */ -export type KnowledgeBaseStorageType = (typeof KnowledgeBaseStorageType)[keyof typeof KnowledgeBaseStorageType]; +export type MetadataValueType = (typeof MetadataValueType)[keyof typeof MetadataValueType]; /** - *

Contains the storage configuration of the knowledge base.

+ *

Contains the value of the metadata attribute. Choose a type and include the field that corresponds to it.

* @public */ -export interface StorageConfiguration { +export interface MetadataAttributeValue { /** - *

The vector store service in which the knowledge base is stored.

+ *

The type of the metadata attribute.

* @public */ - type: KnowledgeBaseStorageType | undefined; + type: MetadataValueType | undefined; /** - *

Contains the storage configuration of the knowledge base in Amazon OpenSearch Service.

+ *

The value of the numeric metadata attribute.

* @public */ - opensearchServerlessConfiguration?: OpenSearchServerlessConfiguration | undefined; + numberValue?: number | undefined; /** - *

Contains the storage configuration of the knowledge base in Pinecone.

+ *

The value of the Boolean metadata attribute.

* @public */ - pineconeConfiguration?: PineconeConfiguration | undefined; + booleanValue?: boolean | undefined; /** - *

Contains the storage configuration of the knowledge base in Redis Enterprise Cloud.

+ *

The value of the string metadata attribute.

* @public */ - redisEnterpriseCloudConfiguration?: RedisEnterpriseCloudConfiguration | undefined; + stringValue?: string | undefined; /** - *

Contains details about the storage configuration of the knowledge base in Amazon RDS. For more information, see Create a vector index in Amazon RDS.

+ *

An array of strings that define the value of the metadata attribute.

* @public */ - rdsConfiguration?: RdsConfiguration | undefined; - - /** - *

Contains the storage configuration of the knowledge base in MongoDB Atlas.

- * @public - */ - mongoDbAtlasConfiguration?: MongoDbAtlasConfiguration | undefined; + stringListValue?: string[] | undefined; } /** + *

Contains information about a metadata attribute.

* @public */ -export interface CreateKnowledgeBaseRequest { - /** - *

A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, - * Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.

- * @public - */ - clientToken?: string | undefined; - +export interface MetadataAttribute { /** - *

A name for the knowledge base.

+ *

The key of the metadata attribute.

* @public */ - name: string | undefined; + key: string | undefined; /** - *

A description of the knowledge base.

+ *

Contains the value of the metadata attribute.

* @public */ - description?: string | undefined; - - /** - *

The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.

- * @public - */ - roleArn: string | undefined; - - /** - *

Contains details about the embeddings model used for the knowledge base.

- * @public - */ - knowledgeBaseConfiguration: KnowledgeBaseConfiguration | undefined; - - /** - *

Contains details about the configuration of the vector database used for the knowledge base.

- * @public - */ - storageConfiguration: StorageConfiguration | undefined; - - /** - *

Specify the key-value pairs for the tags that you want to attach to your knowledge base in this object.

- * @public - */ - tags?: Record | undefined; + value: MetadataAttributeValue | undefined; } /** * @public * @enum */ -export const KnowledgeBaseStatus = { - ACTIVE: "ACTIVE", - CREATING: "CREATING", - DELETE_UNSUCCESSFUL: "DELETE_UNSUCCESSFUL", - DELETING: "DELETING", - FAILED: "FAILED", - UPDATING: "UPDATING", +export const MetadataSourceType = { + IN_LINE_ATTRIBUTE: "IN_LINE_ATTRIBUTE", + S3_LOCATION: "S3_LOCATION", } as const; /** * @public */ -export type KnowledgeBaseStatus = (typeof KnowledgeBaseStatus)[keyof typeof KnowledgeBaseStatus]; +export type MetadataSourceType = (typeof MetadataSourceType)[keyof typeof MetadataSourceType]; /** - *

Contains information about a knowledge base.

+ *

Contains information about the metadata associate with the content to ingest into a knowledge base. Choose a type and include the field that corresponds to it.

* @public */ -export interface KnowledgeBase { +export interface DocumentMetadata { /** - *

The unique identifier of the knowledge base.

+ *

The type of the source source from which to add metadata.

* @public */ - knowledgeBaseId: string | undefined; + type: MetadataSourceType | undefined; /** - *

The name of the knowledge base.

+ *

An array of objects, each of which defines a metadata attribute to associate with the content to ingest. You define the attributes inline.

* @public */ - name: string | undefined; - - /** - *

The Amazon Resource Name (ARN) of the knowledge base.

- * @public - */ - knowledgeBaseArn: string | undefined; + inlineAttributes?: MetadataAttribute[] | undefined; /** - *

The description of the knowledge base.

+ *

The Amazon S3 location of the file containing metadata to associate with the content to ingest.

* @public */ - description?: string | undefined; - - /** - *

The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.

- * @public - */ - roleArn: string | undefined; + s3Location?: CustomS3Location | undefined; +} +/** + *

Contains information about a document to ingest into a knowledge base and metadata to associate with it.

+ * @public + */ +export interface KnowledgeBaseDocument { /** - *

Contains details about the embeddings configuration of the knowledge base.

+ *

Contains the metadata to associate with the document.

* @public */ - knowledgeBaseConfiguration: KnowledgeBaseConfiguration | undefined; + metadata?: DocumentMetadata | undefined; /** - *

Contains details about the storage configuration of the knowledge base.

+ *

Contains the content of the document.

* @public */ - storageConfiguration: StorageConfiguration | undefined; + content: DocumentContent | undefined; +} +/** + * @public + */ +export interface IngestKnowledgeBaseDocumentsRequest { /** - *

The status of the knowledge base. The following statuses are possible:

- *
    - *
  • - *

    CREATING – The knowledge base is being created.

    - *
  • - *
  • - *

    ACTIVE – The knowledge base is ready to be queried.

    - *
  • - *
  • - *

    DELETING – The knowledge base is being deleted.

    - *
  • - *
  • - *

    UPDATING – The knowledge base is being updated.

    - *
  • - *
  • - *

    FAILED – The knowledge base API operation failed.

    - *
  • - *
+ *

The unique identifier of the knowledge base to ingest the documents into.

* @public */ - status: KnowledgeBaseStatus | undefined; + knowledgeBaseId: string | undefined; /** - *

The time the knowledge base was created.

+ *

The unique identifier of the data source connected to the knowledge base that you're adding documents to.

* @public */ - createdAt: Date | undefined; + dataSourceId: string | undefined; /** - *

The time the knowledge base was last updated.

+ *

A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, + * Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.

* @public */ - updatedAt: Date | undefined; + clientToken?: string | undefined; /** - *

A list of reasons that the API operation on the knowledge base failed.

+ *

A list of objects, each of which contains information about the documents to add.

* @public */ - failureReasons?: string[] | undefined; + documents: KnowledgeBaseDocument[] | undefined; } /** * @public */ -export interface CreateKnowledgeBaseResponse { +export interface IngestKnowledgeBaseDocumentsResponse { /** - *

Contains details about the knowledge base.

+ *

A list of objects, each of which contains information about the documents that were ingested.

* @public */ - knowledgeBase: KnowledgeBase | undefined; + documentDetails?: KnowledgeBaseDocumentDetail[] | undefined; } /** * @public */ -export interface DeleteKnowledgeBaseRequest { +export interface ListKnowledgeBaseDocumentsRequest { /** - *

The unique identifier of the knowledge base to delete.

+ *

The unique identifier of the knowledge base that is connected to the data source.

* @public */ knowledgeBaseId: string | undefined; -} -/** - * @public - */ -export interface DeleteKnowledgeBaseResponse { /** - *

The unique identifier of the knowledge base that was deleted.

+ *

The unique identifier of the data source that contains the documents.

* @public */ - knowledgeBaseId: string | undefined; + dataSourceId: string | undefined; /** - *

The status of the knowledge base and whether it has been successfully deleted.

+ *

The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

* @public */ - status: KnowledgeBaseStatus | undefined; -} + maxResults?: number | undefined; -/** - * @public - */ -export interface DisassociateAgentKnowledgeBaseRequest { /** - *

The unique identifier of the agent from which to disassociate the knowledge base.

+ *

If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

* @public */ - agentId: string | undefined; + nextToken?: string | undefined; +} +/** + * @public + */ +export interface ListKnowledgeBaseDocumentsResponse { /** - *

The version of the agent from which to disassociate the knowledge base.

+ *

A list of objects, each of which contains information about the documents that were retrieved.

* @public */ - agentVersion: string | undefined; + documentDetails: KnowledgeBaseDocumentDetail[] | undefined; /** - *

The unique identifier of the knowledge base to disassociate.

+ *

If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

* @public */ - knowledgeBaseId: string | undefined; + nextToken?: string | undefined; } -/** - * @public - */ -export interface DisassociateAgentKnowledgeBaseResponse {} - /** * @internal */ @@ -9765,3 +9724,92 @@ export const UpdateFlowResponseFilterSensitiveLog = (obj: UpdateFlowResponse): a ...obj, ...(obj.definition && { definition: SENSITIVE_STRING }), }); + +/** + * @internal + */ +export const ByteContentDocFilterSensitiveLog = (obj: ByteContentDoc): any => ({ + ...obj, + ...(obj.data && { data: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const TextContentDocFilterSensitiveLog = (obj: TextContentDoc): any => ({ + ...obj, + ...(obj.data && { data: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const InlineContentFilterSensitiveLog = (obj: InlineContent): any => ({ + ...obj, + ...(obj.byteContent && { byteContent: ByteContentDocFilterSensitiveLog(obj.byteContent) }), + ...(obj.textContent && { textContent: TextContentDocFilterSensitiveLog(obj.textContent) }), +}); + +/** + * @internal + */ +export const CustomContentFilterSensitiveLog = (obj: CustomContent): any => ({ + ...obj, + ...(obj.inlineContent && { inlineContent: InlineContentFilterSensitiveLog(obj.inlineContent) }), +}); + +/** + * @internal + */ +export const DocumentContentFilterSensitiveLog = (obj: DocumentContent): any => ({ + ...obj, + ...(obj.custom && { custom: CustomContentFilterSensitiveLog(obj.custom) }), +}); + +/** + * @internal + */ +export const MetadataAttributeValueFilterSensitiveLog = (obj: MetadataAttributeValue): any => ({ + ...obj, + ...(obj.numberValue && { numberValue: SENSITIVE_STRING }), + ...(obj.stringValue && { stringValue: SENSITIVE_STRING }), + ...(obj.stringListValue && { stringListValue: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const MetadataAttributeFilterSensitiveLog = (obj: MetadataAttribute): any => ({ + ...obj, + ...(obj.key && { key: SENSITIVE_STRING }), + ...(obj.value && { value: MetadataAttributeValueFilterSensitiveLog(obj.value) }), +}); + +/** + * @internal + */ +export const DocumentMetadataFilterSensitiveLog = (obj: DocumentMetadata): any => ({ + ...obj, + ...(obj.inlineAttributes && { + inlineAttributes: obj.inlineAttributes.map((item) => MetadataAttributeFilterSensitiveLog(item)), + }), +}); + +/** + * @internal + */ +export const KnowledgeBaseDocumentFilterSensitiveLog = (obj: KnowledgeBaseDocument): any => ({ + ...obj, + ...(obj.metadata && { metadata: DocumentMetadataFilterSensitiveLog(obj.metadata) }), + ...(obj.content && { content: DocumentContentFilterSensitiveLog(obj.content) }), +}); + +/** + * @internal + */ +export const IngestKnowledgeBaseDocumentsRequestFilterSensitiveLog = ( + obj: IngestKnowledgeBaseDocumentsRequest +): any => ({ + ...obj, + ...(obj.documents && { documents: obj.documents.map((item) => KnowledgeBaseDocumentFilterSensitiveLog(item)) }), +}); diff --git a/clients/client-bedrock-agent/src/models/models_1.ts b/clients/client-bedrock-agent/src/models/models_1.ts index 6f16bbf6eeba..3e67b5fc54c1 100644 --- a/clients/client-bedrock-agent/src/models/models_1.ts +++ b/clients/client-bedrock-agent/src/models/models_1.ts @@ -13,17 +13,725 @@ import { FlowDefinition, FlowValidation, FlowValidationFilterSensitiveLog, - KnowledgeBase, - KnowledgeBaseConfiguration, KnowledgeBaseState, - KnowledgeBaseStatus, PromptInferenceConfiguration, PromptTemplateConfiguration, PromptTemplateConfigurationFilterSensitiveLog, PromptTemplateType, - StorageConfiguration, } from "./models_0"; +/** + * @public + */ +export interface AssociateAgentKnowledgeBaseRequest { + /** + *

The unique identifier of the agent with which you want to associate the knowledge base.

+ * @public + */ + agentId: string | undefined; + + /** + *

The version of the agent with which you want to associate the knowledge base.

+ * @public + */ + agentVersion: string | undefined; + + /** + *

The unique identifier of the knowledge base to associate with the agent.

+ * @public + */ + knowledgeBaseId: string | undefined; + + /** + *

A description of what the agent should use the knowledge base for.

+ * @public + */ + description: string | undefined; + + /** + *

Specifies whether to use the knowledge base or not when sending an InvokeAgent request.

+ * @public + */ + knowledgeBaseState?: KnowledgeBaseState | undefined; +} + +/** + * @public + */ +export interface AssociateAgentKnowledgeBaseResponse { + /** + *

Contains details about the knowledge base that has been associated with the agent.

+ * @public + */ + agentKnowledgeBase: AgentKnowledgeBase | undefined; +} + +/** + * @public + * @enum + */ +export const KnowledgeBaseType = { + VECTOR: "VECTOR", +} as const; + +/** + * @public + */ +export type KnowledgeBaseType = (typeof KnowledgeBaseType)[keyof typeof KnowledgeBaseType]; + +/** + * @public + * @enum + */ +export const EmbeddingDataType = { + BINARY: "BINARY", + FLOAT32: "FLOAT32", +} as const; + +/** + * @public + */ +export type EmbeddingDataType = (typeof EmbeddingDataType)[keyof typeof EmbeddingDataType]; + +/** + *

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 | undefined; + + /** + *

The data type for the vectors when using a model to convert text into vector + * embeddings. The model must support the specified data type for vector embeddings. + * Floating-point (float32) is the default data type, and is supported by most models + * for vector embeddings. See Supported embeddings + * models for information on the available models and their vector data types.

+ * @public + */ + embeddingDataType?: EmbeddingDataType | undefined; +} + +/** + *

The configuration details for the embeddings model.

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

The vector configuration details on the Bedrock embeddings model.

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

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

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

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

+ * @public + */ + embeddingModelArn: string | undefined; + + /** + *

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

+ * @public + */ + embeddingModelConfiguration?: EmbeddingModelConfiguration | undefined; +} + +/** + *

Contains details about the vector embeddings configuration of the knowledge base.

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

The type of data that the data source is converted into for the knowledge base.

+ * @public + */ + type: KnowledgeBaseType | undefined; + + /** + *

Contains details about the model that's used to convert the data source into vector embeddings.

+ * @public + */ + vectorKnowledgeBaseConfiguration?: VectorKnowledgeBaseConfiguration | undefined; +} + +/** + *

Contains the names of the fields to which to map information about the vector store.

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

The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

+ * @public + */ + vectorField: string | undefined; + + /** + *

The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

+ * @public + */ + textField: string | undefined; + + /** + *

The name of the field in which Amazon Bedrock stores metadata about the vector store.

+ * @public + */ + metadataField: string | undefined; +} + +/** + *

Contains details about the storage configuration of the knowledge base in MongoDB Atlas.

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

The endpoint URL of your MongoDB Atlas cluster for your knowledge base.

+ * @public + */ + endpoint: string | undefined; + + /** + *

The database name in your MongoDB Atlas cluster for your knowledge base.

+ * @public + */ + databaseName: string | undefined; + + /** + *

The collection name of the knowledge base in MongoDB Atlas.

+ * @public + */ + collectionName: string | undefined; + + /** + *

The name of the MongoDB Atlas vector search index.

+ * @public + */ + vectorIndexName: string | undefined; + + /** + *

The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that contains user credentials for your MongoDB Atlas cluster.

+ * @public + */ + credentialsSecretArn: string | undefined; + + /** + *

Contains the names of the fields to which to map information about the vector store.

+ * @public + */ + fieldMapping: MongoDbAtlasFieldMapping | undefined; + + /** + *

The name of the VPC endpoint service in your account that is connected to your MongoDB Atlas cluster.

+ * @public + */ + endpointServiceName?: string | undefined; +} + +/** + *

Contains the names of the fields to which to map information about the vector store.

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

The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

+ * @public + */ + vectorField: string | undefined; + + /** + *

The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

+ * @public + */ + textField: string | undefined; + + /** + *

The name of the field in which Amazon Bedrock stores metadata about the vector store.

+ * @public + */ + metadataField: string | undefined; +} + +/** + *

Contains details about the storage configuration of the knowledge base in Amazon OpenSearch Service. For more information, see Create a vector index in Amazon OpenSearch Service.

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

The Amazon Resource Name (ARN) of the OpenSearch Service vector store.

+ * @public + */ + collectionArn: string | undefined; + + /** + *

The name of the vector store.

+ * @public + */ + vectorIndexName: string | undefined; + + /** + *

Contains the names of the fields to which to map information about the vector store.

+ * @public + */ + fieldMapping: OpenSearchServerlessFieldMapping | undefined; +} + +/** + *

Contains the names of the fields to which to map information about the vector store.

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

The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

+ * @public + */ + textField: string | undefined; + + /** + *

The name of the field in which Amazon Bedrock stores metadata about the vector store.

+ * @public + */ + metadataField: string | undefined; +} + +/** + *

Contains details about the storage configuration of the knowledge base in Pinecone. For more information, see Create a vector index in Pinecone.

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

The endpoint URL for your index management page.

+ * @public + */ + connectionString: string | undefined; + + /** + *

The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Pinecone API key.

+ * @public + */ + credentialsSecretArn: string | undefined; + + /** + *

The namespace to be used to write new data to your database.

+ * @public + */ + namespace?: string | undefined; + + /** + *

Contains the names of the fields to which to map information about the vector store.

+ * @public + */ + fieldMapping: PineconeFieldMapping | undefined; +} + +/** + *

Contains the names of the fields to which to map information about the vector store.

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

The name of the field in which Amazon Bedrock stores the ID for each entry.

+ * @public + */ + primaryKeyField: string | undefined; + + /** + *

The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

+ * @public + */ + vectorField: string | undefined; + + /** + *

The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

+ * @public + */ + textField: string | undefined; + + /** + *

The name of the field in which Amazon Bedrock stores metadata about the vector store.

+ * @public + */ + metadataField: string | undefined; +} + +/** + *

Contains details about the storage configuration of the knowledge base in Amazon RDS. For more information, see Create a vector index in Amazon RDS.

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

The Amazon Resource Name (ARN) of the vector store.

+ * @public + */ + resourceArn: string | undefined; + + /** + *

The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Amazon RDS database.

+ * @public + */ + credentialsSecretArn: string | undefined; + + /** + *

The name of your Amazon RDS database.

+ * @public + */ + databaseName: string | undefined; + + /** + *

The name of the table in the database.

+ * @public + */ + tableName: string | undefined; + + /** + *

Contains the names of the fields to which to map information about the vector store.

+ * @public + */ + fieldMapping: RdsFieldMapping | undefined; +} + +/** + *

Contains the names of the fields to which to map information about the vector store.

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

The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources.

+ * @public + */ + vectorField: string | undefined; + + /** + *

The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose.

+ * @public + */ + textField: string | undefined; + + /** + *

The name of the field in which Amazon Bedrock stores metadata about the vector store.

+ * @public + */ + metadataField: string | undefined; +} + +/** + *

Contains details about the storage configuration of the knowledge base in Redis Enterprise Cloud. For more information, see Create a vector index in Redis Enterprise Cloud.

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

The endpoint URL of the Redis Enterprise Cloud database.

+ * @public + */ + endpoint: string | undefined; + + /** + *

The name of the vector index.

+ * @public + */ + vectorIndexName: string | undefined; + + /** + *

The Amazon Resource Name (ARN) of the secret that you created in Secrets Manager that is linked to your Redis Enterprise Cloud database.

+ * @public + */ + credentialsSecretArn: string | undefined; + + /** + *

Contains the names of the fields to which to map information about the vector store.

+ * @public + */ + fieldMapping: RedisEnterpriseCloudFieldMapping | undefined; +} + +/** + * @public + * @enum + */ +export const KnowledgeBaseStorageType = { + MONGO_DB_ATLAS: "MONGO_DB_ATLAS", + OPENSEARCH_SERVERLESS: "OPENSEARCH_SERVERLESS", + PINECONE: "PINECONE", + RDS: "RDS", + REDIS_ENTERPRISE_CLOUD: "REDIS_ENTERPRISE_CLOUD", +} as const; + +/** + * @public + */ +export type KnowledgeBaseStorageType = (typeof KnowledgeBaseStorageType)[keyof typeof KnowledgeBaseStorageType]; + +/** + *

Contains the storage configuration of the knowledge base.

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

The vector store service in which the knowledge base is stored.

+ * @public + */ + type: KnowledgeBaseStorageType | undefined; + + /** + *

Contains the storage configuration of the knowledge base in Amazon OpenSearch Service.

+ * @public + */ + opensearchServerlessConfiguration?: OpenSearchServerlessConfiguration | undefined; + + /** + *

Contains the storage configuration of the knowledge base in Pinecone.

+ * @public + */ + pineconeConfiguration?: PineconeConfiguration | undefined; + + /** + *

Contains the storage configuration of the knowledge base in Redis Enterprise Cloud.

+ * @public + */ + redisEnterpriseCloudConfiguration?: RedisEnterpriseCloudConfiguration | undefined; + + /** + *

Contains details about the storage configuration of the knowledge base in Amazon RDS. For more information, see Create a vector index in Amazon RDS.

+ * @public + */ + rdsConfiguration?: RdsConfiguration | undefined; + + /** + *

Contains the storage configuration of the knowledge base in MongoDB Atlas.

+ * @public + */ + mongoDbAtlasConfiguration?: MongoDbAtlasConfiguration | undefined; +} + +/** + * @public + */ +export interface CreateKnowledgeBaseRequest { + /** + *

A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, + * Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.

+ * @public + */ + clientToken?: string | undefined; + + /** + *

A name for the knowledge base.

+ * @public + */ + name: string | undefined; + + /** + *

A description of the knowledge base.

+ * @public + */ + description?: string | undefined; + + /** + *

The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.

+ * @public + */ + roleArn: string | undefined; + + /** + *

Contains details about the embeddings model used for the knowledge base.

+ * @public + */ + knowledgeBaseConfiguration: KnowledgeBaseConfiguration | undefined; + + /** + *

Contains details about the configuration of the vector database used for the knowledge base.

+ * @public + */ + storageConfiguration: StorageConfiguration | undefined; + + /** + *

Specify the key-value pairs for the tags that you want to attach to your knowledge base in this object.

+ * @public + */ + tags?: Record | undefined; +} + +/** + * @public + * @enum + */ +export const KnowledgeBaseStatus = { + ACTIVE: "ACTIVE", + CREATING: "CREATING", + DELETE_UNSUCCESSFUL: "DELETE_UNSUCCESSFUL", + DELETING: "DELETING", + FAILED: "FAILED", + UPDATING: "UPDATING", +} as const; + +/** + * @public + */ +export type KnowledgeBaseStatus = (typeof KnowledgeBaseStatus)[keyof typeof KnowledgeBaseStatus]; + +/** + *

Contains information about a knowledge base.

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

The unique identifier of the knowledge base.

+ * @public + */ + knowledgeBaseId: string | undefined; + + /** + *

The name of the knowledge base.

+ * @public + */ + name: string | undefined; + + /** + *

The Amazon Resource Name (ARN) of the knowledge base.

+ * @public + */ + knowledgeBaseArn: string | undefined; + + /** + *

The description of the knowledge base.

+ * @public + */ + description?: string | undefined; + + /** + *

The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.

+ * @public + */ + roleArn: string | undefined; + + /** + *

Contains details about the embeddings configuration of the knowledge base.

+ * @public + */ + knowledgeBaseConfiguration: KnowledgeBaseConfiguration | undefined; + + /** + *

Contains details about the storage configuration of the knowledge base.

+ * @public + */ + storageConfiguration: StorageConfiguration | undefined; + + /** + *

The status of the knowledge base. The following statuses are possible:

+ *
    + *
  • + *

    CREATING – The knowledge base is being created.

    + *
  • + *
  • + *

    ACTIVE – The knowledge base is ready to be queried.

    + *
  • + *
  • + *

    DELETING – The knowledge base is being deleted.

    + *
  • + *
  • + *

    UPDATING – The knowledge base is being updated.

    + *
  • + *
  • + *

    FAILED – The knowledge base API operation failed.

    + *
  • + *
+ * @public + */ + status: KnowledgeBaseStatus | undefined; + + /** + *

The time the knowledge base was created.

+ * @public + */ + createdAt: Date | undefined; + + /** + *

The time the knowledge base was last updated.

+ * @public + */ + updatedAt: Date | undefined; + + /** + *

A list of reasons that the API operation on the knowledge base failed.

+ * @public + */ + failureReasons?: string[] | undefined; +} + +/** + * @public + */ +export interface CreateKnowledgeBaseResponse { + /** + *

Contains details about the knowledge base.

+ * @public + */ + knowledgeBase: KnowledgeBase | undefined; +} + +/** + * @public + */ +export interface DeleteKnowledgeBaseRequest { + /** + *

The unique identifier of the knowledge base to delete.

+ * @public + */ + knowledgeBaseId: string | undefined; +} + +/** + * @public + */ +export interface DeleteKnowledgeBaseResponse { + /** + *

The unique identifier of the knowledge base that was deleted.

+ * @public + */ + knowledgeBaseId: string | undefined; + + /** + *

The status of the knowledge base and whether it has been successfully deleted.

+ * @public + */ + status: KnowledgeBaseStatus | undefined; +} + +/** + * @public + */ +export interface DisassociateAgentKnowledgeBaseRequest { + /** + *

The unique identifier of the agent from which to disassociate the knowledge base.

+ * @public + */ + agentId: string | undefined; + + /** + *

The version of the agent from which to disassociate the knowledge base.

+ * @public + */ + agentVersion: string | undefined; + + /** + *

The unique identifier of the knowledge base to disassociate.

+ * @public + */ + knowledgeBaseId: string | undefined; +} + +/** + * @public + */ +export interface DisassociateAgentKnowledgeBaseResponse {} + /** * @public */ diff --git a/clients/client-bedrock-agent/src/pagination/ListKnowledgeBaseDocumentsPaginator.ts b/clients/client-bedrock-agent/src/pagination/ListKnowledgeBaseDocumentsPaginator.ts new file mode 100644 index 000000000000..d5a1ab5b8e27 --- /dev/null +++ b/clients/client-bedrock-agent/src/pagination/ListKnowledgeBaseDocumentsPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { BedrockAgentClient } from "../BedrockAgentClient"; +import { + ListKnowledgeBaseDocumentsCommand, + ListKnowledgeBaseDocumentsCommandInput, + ListKnowledgeBaseDocumentsCommandOutput, +} from "../commands/ListKnowledgeBaseDocumentsCommand"; +import { BedrockAgentPaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateListKnowledgeBaseDocuments: ( + config: BedrockAgentPaginationConfiguration, + input: ListKnowledgeBaseDocumentsCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + BedrockAgentPaginationConfiguration, + ListKnowledgeBaseDocumentsCommandInput, + ListKnowledgeBaseDocumentsCommandOutput +>(BedrockAgentClient, ListKnowledgeBaseDocumentsCommand, "nextToken", "nextToken", "maxResults"); diff --git a/clients/client-bedrock-agent/src/pagination/index.ts b/clients/client-bedrock-agent/src/pagination/index.ts index 7d5004a134e9..cc4a1a36b1f3 100644 --- a/clients/client-bedrock-agent/src/pagination/index.ts +++ b/clients/client-bedrock-agent/src/pagination/index.ts @@ -10,5 +10,6 @@ export * from "./ListFlowAliasesPaginator"; export * from "./ListFlowVersionsPaginator"; export * from "./ListFlowsPaginator"; export * from "./ListIngestionJobsPaginator"; +export * from "./ListKnowledgeBaseDocumentsPaginator"; export * from "./ListKnowledgeBasesPaginator"; export * from "./ListPromptsPaginator"; diff --git a/clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts b/clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts index 2c774dcf9325..ec1f1ad7a9ec 100644 --- a/clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts +++ b/clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts @@ -70,6 +70,10 @@ import { DeleteKnowledgeBaseCommandInput, DeleteKnowledgeBaseCommandOutput, } from "../commands/DeleteKnowledgeBaseCommand"; +import { + DeleteKnowledgeBaseDocumentsCommandInput, + DeleteKnowledgeBaseDocumentsCommandOutput, +} from "../commands/DeleteKnowledgeBaseDocumentsCommand"; import { DeletePromptCommandInput, DeletePromptCommandOutput } from "../commands/DeletePromptCommand"; import { DisassociateAgentKnowledgeBaseCommandInput, @@ -92,7 +96,15 @@ import { GetFlowCommandInput, GetFlowCommandOutput } from "../commands/GetFlowCo import { GetFlowVersionCommandInput, GetFlowVersionCommandOutput } from "../commands/GetFlowVersionCommand"; import { GetIngestionJobCommandInput, GetIngestionJobCommandOutput } from "../commands/GetIngestionJobCommand"; import { GetKnowledgeBaseCommandInput, GetKnowledgeBaseCommandOutput } from "../commands/GetKnowledgeBaseCommand"; +import { + GetKnowledgeBaseDocumentsCommandInput, + GetKnowledgeBaseDocumentsCommandOutput, +} from "../commands/GetKnowledgeBaseDocumentsCommand"; import { GetPromptCommandInput, GetPromptCommandOutput } from "../commands/GetPromptCommand"; +import { + IngestKnowledgeBaseDocumentsCommandInput, + IngestKnowledgeBaseDocumentsCommandOutput, +} from "../commands/IngestKnowledgeBaseDocumentsCommand"; import { ListAgentActionGroupsCommandInput, ListAgentActionGroupsCommandOutput, @@ -109,6 +121,10 @@ import { ListFlowAliasesCommandInput, ListFlowAliasesCommandOutput } from "../co import { ListFlowsCommandInput, ListFlowsCommandOutput } from "../commands/ListFlowsCommand"; import { ListFlowVersionsCommandInput, ListFlowVersionsCommandOutput } from "../commands/ListFlowVersionsCommand"; import { ListIngestionJobsCommandInput, ListIngestionJobsCommandOutput } from "../commands/ListIngestionJobsCommand"; +import { + ListKnowledgeBaseDocumentsCommandInput, + ListKnowledgeBaseDocumentsCommandOutput, +} from "../commands/ListKnowledgeBaseDocumentsCommand"; import { ListKnowledgeBasesCommandInput, ListKnowledgeBasesCommandOutput } from "../commands/ListKnowledgeBasesCommand"; import { ListPromptsCommandInput, ListPromptsCommandOutput } from "../commands/ListPromptsCommand"; import { @@ -163,8 +179,8 @@ import { AnyToolChoice, APISchema, AutoToolChoice, - BedrockEmbeddingModelConfiguration, BedrockFoundationModelConfiguration, + ByteContentDoc, ChatPromptTemplateConfiguration, ChunkingConfiguration, CollectorFlowNodeConfiguration, @@ -175,12 +191,17 @@ import { ConfluenceSourceConfiguration, ContentBlock, CrawlFilterConfiguration, + CustomContent, + CustomDocumentIdentifier, CustomOrchestration, + CustomS3Location, CustomTransformationConfiguration, DataSource, DataSourceConfiguration, DataSourceSummary, - EmbeddingModelConfiguration, + DocumentContent, + DocumentIdentifier, + DocumentMetadata, FixedSizeChunkingConfiguration, FlowAliasRoutingConfigurationListItem, FlowAliasSummary, @@ -206,22 +227,21 @@ import { IngestionJobFilter, IngestionJobSortBy, IngestionJobSummary, + InlineContent, InputFlowNodeConfiguration, IntermediateStorage, InternalServerException, IteratorFlowNodeConfiguration, - KnowledgeBase, - KnowledgeBaseConfiguration, + KnowledgeBaseDocument, + KnowledgeBaseDocumentDetail, KnowledgeBaseFlowNodeConfiguration, LambdaFunctionFlowNodeConfiguration, LexFlowNodeConfiguration, MemoryConfiguration, MemoryType, Message, - MongoDbAtlasConfiguration, - MongoDbAtlasFieldMapping, - OpenSearchServerlessConfiguration, - OpenSearchServerlessFieldMapping, + MetadataAttribute, + MetadataAttributeValue, OrchestrationExecutor, OutputFlowNodeConfiguration, ParameterDetail, @@ -229,8 +249,6 @@ import { ParsingPrompt, PatternObjectFilter, PatternObjectFilterConfiguration, - PineconeConfiguration, - PineconeFieldMapping, PromptConfiguration, PromptFlowNodeConfiguration, PromptFlowNodeInlineConfiguration, @@ -241,14 +259,11 @@ import { PromptModelInferenceConfiguration, PromptOverrideConfiguration, PromptTemplateConfiguration, - RdsConfiguration, - RdsFieldMapping, - RedisEnterpriseCloudConfiguration, - RedisEnterpriseCloudFieldMapping, ResourceNotFoundException, RetrievalFlowNodeConfiguration, RetrievalFlowNodeS3Configuration, RetrievalFlowNodeServiceConfiguration, + S3Content, S3DataSourceConfiguration, S3Identifier, S3Location, @@ -263,11 +278,11 @@ import { SharePointDataSourceConfiguration, SharePointSourceConfiguration, SpecificToolChoice, - StorageConfiguration, StorageFlowNodeConfiguration, StorageFlowNodeS3Configuration, StorageFlowNodeServiceConfiguration, SystemContentBlock, + TextContentDoc, TextPromptTemplateConfiguration, ThrottlingException, Tool, @@ -281,19 +296,34 @@ import { UrlConfiguration, ValidationException, VectorIngestionConfiguration, - VectorKnowledgeBaseConfiguration, WebCrawlerConfiguration, WebCrawlerLimits, WebDataSourceConfiguration, WebSourceConfiguration, } from "../models/models_0"; import { + BedrockEmbeddingModelConfiguration, + EmbeddingModelConfiguration, + KnowledgeBase, + KnowledgeBaseConfiguration, KnowledgeBaseSummary, + MongoDbAtlasConfiguration, + MongoDbAtlasFieldMapping, + OpenSearchServerlessConfiguration, + OpenSearchServerlessFieldMapping, + PineconeConfiguration, + PineconeFieldMapping, PromptAgentResource, PromptGenAiResource, PromptMetadataEntry, PromptSummary, PromptVariant, + RdsConfiguration, + RdsFieldMapping, + RedisEnterpriseCloudConfiguration, + RedisEnterpriseCloudFieldMapping, + StorageConfiguration, + VectorKnowledgeBaseConfiguration, } from "../models/models_1"; /** @@ -770,6 +800,31 @@ export const se_DeleteKnowledgeBaseCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1DeleteKnowledgeBaseDocumentsCommand + */ +export const se_DeleteKnowledgeBaseDocumentsCommand = async ( + input: DeleteKnowledgeBaseDocumentsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents/deleteDocuments"); + b.p("knowledgeBaseId", () => input.knowledgeBaseId!, "{knowledgeBaseId}", false); + b.p("dataSourceId", () => input.dataSourceId!, "{dataSourceId}", false); + let body: any; + body = JSON.stringify( + take(input, { + clientToken: [true, (_) => _ ?? generateIdempotencyToken()], + documentIdentifiers: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1DeletePromptCommand */ @@ -994,6 +1049,30 @@ export const se_GetKnowledgeBaseCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1GetKnowledgeBaseDocumentsCommand + */ +export const se_GetKnowledgeBaseDocumentsCommand = async ( + input: GetKnowledgeBaseDocumentsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents/getDocuments"); + b.p("knowledgeBaseId", () => input.knowledgeBaseId!, "{knowledgeBaseId}", false); + b.p("dataSourceId", () => input.dataSourceId!, "{dataSourceId}", false); + let body: any; + body = JSON.stringify( + take(input, { + documentIdentifiers: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1GetPromptCommand */ @@ -1013,6 +1092,31 @@ export const se_GetPromptCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1IngestKnowledgeBaseDocumentsCommand + */ +export const se_IngestKnowledgeBaseDocumentsCommand = async ( + input: IngestKnowledgeBaseDocumentsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents"); + b.p("knowledgeBaseId", () => input.knowledgeBaseId!, "{knowledgeBaseId}", false); + b.p("dataSourceId", () => input.dataSourceId!, "{dataSourceId}", false); + let body: any; + body = JSON.stringify( + take(input, { + clientToken: [true, (_) => _ ?? generateIdempotencyToken()], + documents: (_) => se_KnowledgeBaseDocuments(_, context), + }) + ); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1ListAgentActionGroupsCommand */ @@ -1244,6 +1348,31 @@ export const se_ListIngestionJobsCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1ListKnowledgeBaseDocumentsCommand + */ +export const se_ListKnowledgeBaseDocumentsCommand = async ( + input: ListKnowledgeBaseDocumentsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents"); + b.p("knowledgeBaseId", () => input.knowledgeBaseId!, "{knowledgeBaseId}", false); + b.p("dataSourceId", () => input.dataSourceId!, "{dataSourceId}", false); + let body: any; + body = JSON.stringify( + take(input, { + maxResults: [], + nextToken: [], + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1ListKnowledgeBasesCommand */ @@ -2165,6 +2294,27 @@ export const de_DeleteKnowledgeBaseCommand = async ( return contents; }; +/** + * deserializeAws_restJson1DeleteKnowledgeBaseDocumentsCommand + */ +export const de_DeleteKnowledgeBaseDocumentsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + documentDetails: (_) => de_KnowledgeBaseDocumentDetails(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1DeletePromptCommand */ @@ -2462,6 +2612,27 @@ export const de_GetKnowledgeBaseCommand = async ( return contents; }; +/** + * deserializeAws_restJson1GetKnowledgeBaseDocumentsCommand + */ +export const de_GetKnowledgeBaseDocumentsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + documentDetails: (_) => de_KnowledgeBaseDocumentDetails(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1GetPromptCommand */ @@ -2492,6 +2663,27 @@ export const de_GetPromptCommand = async ( return contents; }; +/** + * deserializeAws_restJson1IngestKnowledgeBaseDocumentsCommand + */ +export const de_IngestKnowledgeBaseDocumentsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + documentDetails: (_) => de_KnowledgeBaseDocumentDetails(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1ListAgentActionGroupsCommand */ @@ -2712,6 +2904,28 @@ export const de_ListIngestionJobsCommand = async ( return contents; }; +/** + * deserializeAws_restJson1ListKnowledgeBaseDocumentsCommand + */ +export const de_ListKnowledgeBaseDocumentsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + documentDetails: (_) => de_KnowledgeBaseDocumentDetails(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1ListKnowledgeBasesCommand */ @@ -3327,6 +3541,16 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_BedrockFoundationModelConfiguration omitted. +/** + * serializeAws_restJson1ByteContentDoc + */ +const se_ByteContentDoc = (input: ByteContentDoc, context: __SerdeContext): any => { + return take(input, { + data: context.base64Encoder, + mimeType: [], + }); +}; + /** * serializeAws_restJson1ChatPromptTemplateConfiguration */ @@ -3357,12 +3581,54 @@ const se_ChatPromptTemplateConfiguration = (input: ChatPromptTemplateConfigurati // se_CrawlFilterConfiguration omitted. +/** + * serializeAws_restJson1CustomContent + */ +const se_CustomContent = (input: CustomContent, context: __SerdeContext): any => { + return take(input, { + customDocumentIdentifier: _json, + inlineContent: (_) => se_InlineContent(_, context), + s3Location: _json, + sourceType: [], + }); +}; + +// se_CustomDocumentIdentifier omitted. + // se_CustomOrchestration omitted. +// se_CustomS3Location omitted. + // se_CustomTransformationConfiguration omitted. // se_DataSourceConfiguration omitted. +/** + * serializeAws_restJson1DocumentContent + */ +const se_DocumentContent = (input: DocumentContent, context: __SerdeContext): any => { + return take(input, { + custom: (_) => se_CustomContent(_, context), + dataSourceType: [], + s3: _json, + }); +}; + +// se_DocumentIdentifier omitted. + +// se_DocumentIdentifiers omitted. + +/** + * serializeAws_restJson1DocumentMetadata + */ +const se_DocumentMetadata = (input: DocumentMetadata, context: __SerdeContext): any => { + return take(input, { + inlineAttributes: (_) => se_MetadataAttributes(_, context), + s3Location: _json, + type: [], + }); +}; + // se_EmbeddingModelConfiguration omitted. // se_EnabledMemoryTypes omitted. @@ -3487,6 +3753,17 @@ const se_InferenceConfiguration = (input: InferenceConfiguration, context: __Ser // se_IngestionJobSortBy omitted. +/** + * serializeAws_restJson1InlineContent + */ +const se_InlineContent = (input: InlineContent, context: __SerdeContext): any => { + return take(input, { + byteContent: (_) => se_ByteContentDoc(_, context), + textContent: _json, + type: [], + }); +}; + // se_InputFlowNodeConfiguration omitted. // se_IntermediateStorage omitted. @@ -3495,6 +3772,27 @@ const se_InferenceConfiguration = (input: InferenceConfiguration, context: __Ser // se_KnowledgeBaseConfiguration omitted. +/** + * serializeAws_restJson1KnowledgeBaseDocument + */ +const se_KnowledgeBaseDocument = (input: KnowledgeBaseDocument, context: __SerdeContext): any => { + return take(input, { + content: (_) => se_DocumentContent(_, context), + metadata: (_) => se_DocumentMetadata(_, context), + }); +}; + +/** + * serializeAws_restJson1KnowledgeBaseDocuments + */ +const se_KnowledgeBaseDocuments = (input: KnowledgeBaseDocument[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return se_KnowledgeBaseDocument(entry, context); + }); +}; + // se_KnowledgeBaseFlowNodeConfiguration omitted. // se_LambdaFunctionFlowNodeConfiguration omitted. @@ -3507,6 +3805,40 @@ const se_InferenceConfiguration = (input: InferenceConfiguration, context: __Ser // se_Messages omitted. +/** + * serializeAws_restJson1MetadataAttribute + */ +const se_MetadataAttribute = (input: MetadataAttribute, context: __SerdeContext): any => { + return take(input, { + key: [], + value: (_) => se_MetadataAttributeValue(_, context), + }); +}; + +/** + * serializeAws_restJson1MetadataAttributes + */ +const se_MetadataAttributes = (input: MetadataAttribute[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return se_MetadataAttribute(entry, context); + }); +}; + +/** + * serializeAws_restJson1MetadataAttributeValue + */ +const se_MetadataAttributeValue = (input: MetadataAttributeValue, context: __SerdeContext): any => { + return take(input, { + booleanValue: [], + numberValue: __serializeFloat, + stringListValue: _json, + stringValue: [], + type: [], + }); +}; + // se_MongoDbAtlasConfiguration omitted. // se_MongoDbAtlasFieldMapping omitted. @@ -3703,6 +4035,8 @@ const se_PromptVariantList = (input: PromptVariant[], context: __SerdeContext): // se_RetrievalFlowNodeServiceConfiguration omitted. +// se_S3Content omitted. + // se_S3DataSourceConfiguration omitted. // se_S3Identifier omitted. @@ -3745,12 +4079,16 @@ const se_PromptVariantList = (input: PromptVariant[], context: __SerdeContext): // se_StorageFlowNodeServiceConfiguration omitted. +// se_StringListValue omitted. + // se_SystemContentBlock omitted. // se_SystemContentBlocks omitted. // se_TagsMap omitted. +// se_TextContentDoc omitted. + // se_TextPromptTemplateConfiguration omitted. /** @@ -4149,6 +4487,8 @@ const de_ChatPromptTemplateConfiguration = (output: any, context: __SerdeContext // de_CrawlFilterConfiguration omitted. +// de_CustomDocumentIdentifier omitted. + // de_CustomOrchestration omitted. // de_CustomTransformationConfiguration omitted. @@ -4203,6 +4543,8 @@ const de_DataSourceSummary = (output: any, context: __SerdeContext): DataSourceS }) as any; }; +// de_DocumentIdentifier omitted. + // de_DuplicateConditionExpressionFlowValidationDetails omitted. // de_DuplicateConnectionsFlowValidationDetails omitted. @@ -4535,6 +4877,32 @@ const de_KnowledgeBase = (output: any, context: __SerdeContext): KnowledgeBase = // de_KnowledgeBaseConfiguration omitted. +/** + * deserializeAws_restJson1KnowledgeBaseDocumentDetail + */ +const de_KnowledgeBaseDocumentDetail = (output: any, context: __SerdeContext): KnowledgeBaseDocumentDetail => { + return take(output, { + dataSourceId: __expectString, + identifier: _json, + knowledgeBaseId: __expectString, + status: __expectString, + statusReason: __expectString, + updatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }) as any; +}; + +/** + * deserializeAws_restJson1KnowledgeBaseDocumentDetails + */ +const de_KnowledgeBaseDocumentDetails = (output: any, context: __SerdeContext): KnowledgeBaseDocumentDetail[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_KnowledgeBaseDocumentDetail(entry, context); + }); + return retVal; +}; + // de_KnowledgeBaseFlowNodeConfiguration omitted. /** diff --git a/codegen/sdk-codegen/aws-models/bedrock-agent.json b/codegen/sdk-codegen/aws-models/bedrock-agent.json index 2109c1fdf39e..273e2ba486d4 100644 --- a/codegen/sdk-codegen/aws-models/bedrock-agent.json +++ b/codegen/sdk-codegen/aws-models/bedrock-agent.json @@ -1194,6 +1194,9 @@ { "target": "com.amazonaws.bedrockagent#IngestionJobResource" }, + { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseDocumentResource" + }, { "target": "com.amazonaws.bedrockagent#KnowledgeBaseResource" }, @@ -2094,6 +2097,39 @@ "smithy.api#pattern": "^[0-9]{12}$" } }, + "com.amazonaws.bedrockagent#ByteContentBlob": { + "type": "blob", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 5242880 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.bedrockagent#ByteContentDoc": { + "type": "structure", + "members": { + "mimeType": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The MIME type of the content. For a list of MIME types, see Media Types. The following MIME types are supported:

\n
    \n
  • \n

    text/plain

    \n
  • \n
  • \n

    text/html

    \n
  • \n
  • \n

    text/csv

    \n
  • \n
  • \n

    text/vtt

    \n
  • \n
  • \n

    message/rfc822

    \n
  • \n
  • \n

    application/xhtml+xml

    \n
  • \n
  • \n

    application/pdf

    \n
  • \n
  • \n

    application/msword

    \n
  • \n
  • \n

    application/vnd.ms-word.document.macroenabled.12

    \n
  • \n
  • \n

    application/vnd.ms-word.template.macroenabled.12

    \n
  • \n
  • \n

    application/vnd.ms-excel

    \n
  • \n
  • \n

    application/vnd.ms-excel.addin.macroenabled.12

    \n
  • \n
  • \n

    application/vnd.ms-excel.sheet.macroenabled.12

    \n
  • \n
  • \n

    application/vnd.ms-excel.template.macroenabled.12

    \n
  • \n
  • \n

    application/vnd.ms-excel.sheet.binary.macroenabled.12

    \n
  • \n
  • \n

    application/vnd.ms-spreadsheetml

    \n
  • \n
  • \n

    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

    \n
  • \n
  • \n

    application/vnd.openxmlformats-officedocument.spreadsheetml.template

    \n
  • \n
  • \n

    application/vnd.openxmlformats-officedocument.wordprocessingml.document

    \n
  • \n
  • \n

    application/vnd.openxmlformats-officedocument.wordprocessingml.template

    \n
  • \n
", + "smithy.api#pattern": "[a-z]{1,20}/.{1,20}", + "smithy.api#required": {} + } + }, + "data": { + "target": "com.amazonaws.bedrockagent#ByteContentBlob", + "traits": { + "smithy.api#documentation": "

The base64-encoded string of the content.

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

Contains information about content defined inline in bytes.

" + } + }, "com.amazonaws.bedrockagent#ChatPromptTemplateConfiguration": { "type": "structure", "members": { @@ -2364,6 +2400,23 @@ "target": "com.amazonaws.bedrockagent#ContentBlock" } }, + "com.amazonaws.bedrockagent#ContentDataSourceType": { + "type": "enum", + "members": { + "CUSTOM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CUSTOM" + } + }, + "S3": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "S3" + } + } + } + }, "com.amazonaws.bedrockagent#ConversationRole": { "type": "enum", "members": { @@ -2829,7 +2882,7 @@ } ], "traits": { - "smithy.api#documentation": "

Creates a data source connector for a knowledge base.

\n \n

You can't change the chunkingConfiguration after you create the data source connector.

\n
", + "smithy.api#documentation": "

Connects a knowledge base to a data source. You specify the configuration for the specific data source service in the dataSourceConfiguration field.

\n \n

You can't change the chunkingConfiguration after you create the data source connector.

\n
", "smithy.api#http": { "code": 200, "method": "PUT", @@ -3835,6 +3888,40 @@ } } }, + "com.amazonaws.bedrockagent#CustomContent": { + "type": "structure", + "members": { + "customDocumentIdentifier": { + "target": "com.amazonaws.bedrockagent#CustomDocumentIdentifier", + "traits": { + "smithy.api#documentation": "

A unique identifier for the document.

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

The source of the data to ingest.

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

Contains information about the Amazon S3 location of the file from which to ingest data.

" + } + }, + "inlineContent": { + "target": "com.amazonaws.bedrockagent#InlineContent", + "traits": { + "smithy.api#documentation": "

Contains information about content defined inline to ingest into a knowledge base.

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

Contains information about the content to ingest into a knowledge base connected to a custom data source. Choose a sourceType and include the field that corresponds to it.

" + } + }, "com.amazonaws.bedrockagent#CustomControlMethod": { "type": "enum", "members": { @@ -3846,6 +3933,25 @@ } } }, + "com.amazonaws.bedrockagent#CustomDocumentIdentifier": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The identifier of the document to ingest into a custom data source.

", + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Contains information about the identifier of the document to ingest into a custom data source.

" + } + }, "com.amazonaws.bedrockagent#CustomOrchestration": { "type": "structure", "members": { @@ -3860,6 +3966,44 @@ "smithy.api#documentation": "

\n Details of custom orchestration.\n

" } }, + "com.amazonaws.bedrockagent#CustomS3Location": { + "type": "structure", + "members": { + "uri": { + "target": "com.amazonaws.bedrockagent#S3ObjectUri", + "traits": { + "smithy.api#documentation": "

The S3 URI of the file containing the content to ingest.

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

The identifier of the Amazon Web Services account that owns the S3 bucket containing the content to ingest.

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

Contains information about the Amazon S3 location of the file containing the content to ingest into a knowledge base connected to a custom data source.

" + } + }, + "com.amazonaws.bedrockagent#CustomSourceType": { + "type": "enum", + "members": { + "IN_LINE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IN_LINE" + } + }, + "S3_LOCATION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "S3_LOCATION" + } + } + } + }, "com.amazonaws.bedrockagent#CustomTransformationConfiguration": { "type": "structure", "members": { @@ -3897,6 +4041,16 @@ "smithy.api#documentation": "

Details about a cyclic connection detected in the flow.

" } }, + "com.amazonaws.bedrockagent#Data": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 5242880 + }, + "smithy.api#sensitive": {} + } + }, "com.amazonaws.bedrockagent#DataDeletionPolicy": { "type": "enum", "members": { @@ -4176,6 +4330,12 @@ "traits": { "smithy.api#enumValue": "SHAREPOINT" } + }, + "CUSTOM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CUSTOM" + } } } }, @@ -4932,6 +5092,97 @@ "smithy.api#tags": ["console"] } }, + "com.amazonaws.bedrockagent#DeleteKnowledgeBaseDocuments": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#DeleteKnowledgeBaseDocumentsRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#DeleteKnowledgeBaseDocumentsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes documents from a data source and syncs the changes to the knowledge base that is connected to it. For more information, see Ingest documents into a knowledge base in real-time in the Amazon Bedrock User Guide.

", + "smithy.api#http": { + "code": 202, + "method": "POST", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents/deleteDocuments" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#DeleteKnowledgeBaseDocumentsRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "

The unique identifier of the knowledge base that is connected to the data source.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "

The unique identifier of the data source that contains the documents.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.bedrockagent#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request,\n Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.

", + "smithy.api#idempotencyToken": {} + } + }, + "documentIdentifiers": { + "target": "com.amazonaws.bedrockagent#DocumentIdentifiers", + "traits": { + "smithy.api#documentation": "

A list of objects, each of which contains information to identify a document to delete.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#DeleteKnowledgeBaseDocumentsResponse": { + "type": "structure", + "members": { + "documentDetails": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseDocumentDetails", + "traits": { + "smithy.api#documentation": "

A list of objects, each of which contains information about the documents that were deleted.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.bedrockagent#DeleteKnowledgeBaseRequest": { "type": "structure", "members": { @@ -5149,78 +5400,249 @@ "smithy.api#output": {} } }, - "com.amazonaws.bedrockagent#DraftVersion": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 5, - "max": 5 - }, - "smithy.api#pattern": "^DRAFT$" - } - }, - "com.amazonaws.bedrockagent#DuplicateConditionExpressionFlowValidationDetails": { + "com.amazonaws.bedrockagent#DocumentContent": { "type": "structure", "members": { - "node": { - "target": "com.amazonaws.bedrockagent#FlowNodeName", + "dataSourceType": { + "target": "com.amazonaws.bedrockagent#ContentDataSourceType", "traits": { - "smithy.api#documentation": "

The name of the node containing the duplicate condition expressions.

", + "smithy.api#documentation": "

The type of data source that is connected to the knowledge base to which to ingest this document.

", "smithy.api#required": {} } }, - "expression": { - "target": "com.amazonaws.bedrockagent#FlowConditionExpression", + "custom": { + "target": "com.amazonaws.bedrockagent#CustomContent", "traits": { - "smithy.api#documentation": "

The duplicated condition expression.

", - "smithy.api#required": {} + "smithy.api#documentation": "

Contains information about the content to ingest into a knowledge base connected to a custom data source.

" + } + }, + "s3": { + "target": "com.amazonaws.bedrockagent#S3Content", + "traits": { + "smithy.api#documentation": "

Contains information about the content to ingest into a knowledge base connected to an Amazon S3 data source

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

Details about duplicate condition expressions found in a condition node.

" + "smithy.api#documentation": "

Contains information about the content of a document. Choose a dataSourceType and include the field that corresponds to it.

" } }, - "com.amazonaws.bedrockagent#DuplicateConnectionsFlowValidationDetails": { + "com.amazonaws.bedrockagent#DocumentIdentifier": { "type": "structure", "members": { - "source": { - "target": "com.amazonaws.bedrockagent#FlowNodeName", + "dataSourceType": { + "target": "com.amazonaws.bedrockagent#ContentDataSourceType", "traits": { - "smithy.api#documentation": "

The name of the source node where the duplicate connection starts.

", + "smithy.api#documentation": "

The type of data source connected to the knowledge base that contains the document.

", "smithy.api#required": {} } }, - "target": { - "target": "com.amazonaws.bedrockagent#FlowNodeName", + "s3": { + "target": "com.amazonaws.bedrockagent#S3Location", "traits": { - "smithy.api#documentation": "

The name of the target node where the duplicate connection ends.

", - "smithy.api#required": {} + "smithy.api#documentation": "

Contains information that identifies the document in an S3 data source.

" + } + }, + "custom": { + "target": "com.amazonaws.bedrockagent#CustomDocumentIdentifier", + "traits": { + "smithy.api#documentation": "

Contains information that identifies the document in a custom data source.

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

Details about duplicate connections found between two nodes in the flow.

" + "smithy.api#documentation": "

Contains information that identifies the document.

" } }, - "com.amazonaws.bedrockagent#EmbeddingDataType": { - "type": "enum", + "com.amazonaws.bedrockagent#DocumentIdentifiers": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#DocumentIdentifier" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 10 + } + } + }, + "com.amazonaws.bedrockagent#DocumentMetadata": { + "type": "structure", "members": { - "FLOAT32": { - "target": "smithy.api#Unit", + "type": { + "target": "com.amazonaws.bedrockagent#MetadataSourceType", "traits": { - "smithy.api#enumValue": "FLOAT32" + "smithy.api#documentation": "

The type of the source source from which to add metadata.

", + "smithy.api#required": {} } }, - "BINARY": { - "target": "smithy.api#Unit", + "inlineAttributes": { + "target": "com.amazonaws.bedrockagent#MetadataAttributes", "traits": { - "smithy.api#enumValue": "BINARY" + "smithy.api#documentation": "

An array of objects, each of which defines a metadata attribute to associate with the content to ingest. You define the attributes inline.

", + "smithy.api#length": { + "min": 1, + "max": 50 + } + } + }, + "s3Location": { + "target": "com.amazonaws.bedrockagent#CustomS3Location", + "traits": { + "smithy.api#documentation": "

The Amazon S3 location of the file containing metadata to associate with the content to ingest.

" } } }, "traits": { - "smithy.api#documentation": "Bedrock models embedding data type. Can be either float32 or binary" + "smithy.api#documentation": "

Contains information about the metadata associate with the content to ingest into a knowledge base. Choose a type and include the field that corresponds to it.

" + } + }, + "com.amazonaws.bedrockagent#DocumentStatus": { + "type": "enum", + "members": { + "INDEXED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INDEXED" + } + }, + "PARTIALLY_INDEXED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PARTIALLY_INDEXED" + } + }, + "PENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PENDING" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "METADATA_PARTIALLY_INDEXED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "METADATA_PARTIALLY_INDEXED" + } + }, + "METADATA_UPDATE_FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "METADATA_UPDATE_FAILED" + } + }, + "IGNORED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IGNORED" + } + }, + "NOT_FOUND": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOT_FOUND" + } + }, + "STARTING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "STARTING" + } + }, + "IN_PROGRESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IN_PROGRESS" + } + }, + "DELETING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETING" + } + }, + "DELETE_IN_PROGRESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETE_IN_PROGRESS" + } + } + } + }, + "com.amazonaws.bedrockagent#DraftVersion": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 5, + "max": 5 + }, + "smithy.api#pattern": "^DRAFT$" + } + }, + "com.amazonaws.bedrockagent#DuplicateConditionExpressionFlowValidationDetails": { + "type": "structure", + "members": { + "node": { + "target": "com.amazonaws.bedrockagent#FlowNodeName", + "traits": { + "smithy.api#documentation": "

The name of the node containing the duplicate condition expressions.

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

The duplicated condition expression.

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

Details about duplicate condition expressions found in a condition node.

" + } + }, + "com.amazonaws.bedrockagent#DuplicateConnectionsFlowValidationDetails": { + "type": "structure", + "members": { + "source": { + "target": "com.amazonaws.bedrockagent#FlowNodeName", + "traits": { + "smithy.api#documentation": "

The name of the source node where the duplicate connection starts.

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

The name of the target node where the duplicate connection ends.

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

Details about duplicate connections found between two nodes in the flow.

" + } + }, + "com.amazonaws.bedrockagent#EmbeddingDataType": { + "type": "enum", + "members": { + "FLOAT32": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FLOAT32" + } + }, + "BINARY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BINARY" + } + } } }, "com.amazonaws.bedrockagent#EmbeddingModelConfiguration": { @@ -7726,6 +8148,90 @@ "smithy.api#tags": ["console"] } }, + "com.amazonaws.bedrockagent#GetKnowledgeBaseDocuments": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#GetKnowledgeBaseDocumentsRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#GetKnowledgeBaseDocumentsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Retrieves specific documents from a data source that is connected to a knowledge base. For more information, see Ingest documents into a knowledge base in real-time in the Amazon Bedrock User Guide.

", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents/getDocuments" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#GetKnowledgeBaseDocumentsRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "

The unique identifier of the knowledge base that is connected to the data source.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "

The unique identifier of the data source that contains the documents.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "documentIdentifiers": { + "target": "com.amazonaws.bedrockagent#DocumentIdentifiers", + "traits": { + "smithy.api#documentation": "

A list of objects, each of which contains information to identify a document for which to retrieve information.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#GetKnowledgeBaseDocumentsResponse": { + "type": "structure", + "members": { + "documentDetails": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseDocumentDetails", + "traits": { + "smithy.api#documentation": "

A list of objects, each of which contains information about the documents that were retrieved.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.bedrockagent#GetKnowledgeBaseRequest": { "type": "structure", "members": { @@ -8046,6 +8552,97 @@ "smithy.api#documentation": "

Contains inference parameters to use when the agent invokes a foundation model in the part of the agent sequence defined by the promptType. For more information, see Inference parameters for foundation models.

" } }, + "com.amazonaws.bedrockagent#IngestKnowledgeBaseDocuments": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#IngestKnowledgeBaseDocumentsRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#IngestKnowledgeBaseDocumentsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Ingests documents directly into the knowledge base that is connected to the data source. The dataSourceType specified in the content for each document must match the type of the data source that you specify in the header. For more information, see Ingest documents into a knowledge base in real-time in the Amazon Bedrock User Guide.

", + "smithy.api#http": { + "code": 202, + "method": "PUT", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents" + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#IngestKnowledgeBaseDocumentsRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "

The unique identifier of the knowledge base to ingest the documents into.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "

The unique identifier of the data source connected to the knowledge base that you're adding documents to.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "com.amazonaws.bedrockagent#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request,\n Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.

", + "smithy.api#idempotencyToken": {} + } + }, + "documents": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseDocuments", + "traits": { + "smithy.api#documentation": "

A list of objects, each of which contains information about the documents to add.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#IngestKnowledgeBaseDocumentsResponse": { + "type": "structure", + "members": { + "documentDetails": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseDocumentDetails", + "traits": { + "smithy.api#documentation": "

A list of objects, each of which contains information about the documents that were ingested.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.bedrockagent#IngestionJob": { "type": "structure", "members": { @@ -8421,6 +9018,50 @@ "smithy.api#documentation": "

Contains details about a data ingestion job.

" } }, + "com.amazonaws.bedrockagent#InlineContent": { + "type": "structure", + "members": { + "type": { + "target": "com.amazonaws.bedrockagent#InlineContentType", + "traits": { + "smithy.api#documentation": "

The type of inline content to define.

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

Contains information about content defined inline in bytes.

" + } + }, + "textContent": { + "target": "com.amazonaws.bedrockagent#TextContentDoc", + "traits": { + "smithy.api#documentation": "

Contains information about content defined inline in text.

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

Contains information about content defined inline to ingest into a data source. Choose a type and include the field that corresponds to it.

" + } + }, + "com.amazonaws.bedrockagent#InlineContentType": { + "type": "enum", + "members": { + "BYTE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BYTE" + } + }, + "TEXT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TEXT" + } + } + } + }, "com.amazonaws.bedrockagent#InputFlowNodeConfiguration": { "type": "structure", "members": {}, @@ -8473,6 +9114,16 @@ "smithy.api#documentation": "

Contains configurations for an iterator node in a flow. Takes an input that is an array and iteratively sends each item of the array as an output to the following node. The size of the array is also returned in the output.

\n

The output flow node at the end of the flow iteration will return a response for each member of the array. To return only one response, you can include a collector node downstream from the iterator node.

" } }, + "com.amazonaws.bedrockagent#Key": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 200 + }, + "smithy.api#sensitive": {} + } + }, "com.amazonaws.bedrockagent#KmsKeyArn": { "type": "string", "traits": { @@ -8581,19 +9232,123 @@ "type": { "target": "com.amazonaws.bedrockagent#KnowledgeBaseType", "traits": { - "smithy.api#documentation": "

The type of data that the data source is converted into for the knowledge base.

", + "smithy.api#documentation": "

The type of data that the data source is converted into for the knowledge base.

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

Contains details about the model that's used to convert the data source into vector embeddings.

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

Contains details about the vector embeddings configuration of the knowledge base.

" + } + }, + "com.amazonaws.bedrockagent#KnowledgeBaseDocument": { + "type": "structure", + "members": { + "metadata": { + "target": "com.amazonaws.bedrockagent#DocumentMetadata", + "traits": { + "smithy.api#documentation": "

Contains the metadata to associate with the document.

" + } + }, + "content": { + "target": "com.amazonaws.bedrockagent#DocumentContent", + "traits": { + "smithy.api#documentation": "

Contains the content of the document.

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

Contains information about a document to ingest into a knowledge base and metadata to associate with it.

" + } + }, + "com.amazonaws.bedrockagent#KnowledgeBaseDocumentDetail": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "

The identifier of the knowledge base that the document was ingested into or deleted from.

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

The identifier of the data source connected to the knowledge base that the document was ingested into or deleted from.

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

The ingestion status of the document. The following statuses are possible:

\n
    \n
  • \n

    STARTED – You submitted the ingestion job containing the document.

    \n
  • \n
  • \n

    PENDING – The document is waiting to be ingested.

    \n
  • \n
  • \n

    IN_PROGRESS – The document is being ingested.

    \n
  • \n
  • \n

    INDEXED – The document was successfully indexed.

    \n
  • \n
  • \n

    PARTIALLY_INDEXED – The document was partially indexed.

    \n
  • \n
  • \n

    METADATA_PARTIALLY_INDEXED – You submitted metadata for an existing document and it was partially indexed.

    \n
  • \n
  • \n

    METADATA_UPDATE_FAILED – You submitted a metadata update for an existing document but it failed.

    \n
  • \n
  • \n

    FAILED – The document failed to be ingested.

    \n
  • \n
  • \n

    NOT_FOUND – The document wasn't found.

    \n
  • \n
  • \n

    IGNORED – The document was ignored during ingestion.

    \n
  • \n
  • \n

    DELETING – You submitted the delete job containing the document.

    \n
  • \n
  • \n

    DELETE_IN_PROGRESS – The document is being deleted.

    \n
  • \n
", + "smithy.api#required": {} + } + }, + "identifier": { + "target": "com.amazonaws.bedrockagent#DocumentIdentifier", + "traits": { + "smithy.api#documentation": "

Contains information that identifies the document.

", "smithy.api#required": {} } }, - "vectorKnowledgeBaseConfiguration": { - "target": "com.amazonaws.bedrockagent#VectorKnowledgeBaseConfiguration", + "statusReason": { + "target": "smithy.api#String", "traits": { - "smithy.api#documentation": "

Contains details about the model that's used to convert the data source into vector embeddings.

" + "smithy.api#documentation": "

The reason for the status. Appears alongside the status IGNORED.

" + } + }, + "updatedAt": { + "target": "com.amazonaws.bedrockagent#DateTimestamp", + "traits": { + "smithy.api#documentation": "

The date and time at which the document was last updated.

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

Contains details about the vector embeddings configuration of the knowledge base.

" + "smithy.api#documentation": "

Contains the details for a document that was ingested or deleted.

" + } + }, + "com.amazonaws.bedrockagent#KnowledgeBaseDocumentDetails": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseDocumentDetail" + } + }, + "com.amazonaws.bedrockagent#KnowledgeBaseDocumentResource": { + "type": "resource", + "operations": [ + { + "target": "com.amazonaws.bedrockagent#DeleteKnowledgeBaseDocuments" + }, + { + "target": "com.amazonaws.bedrockagent#GetKnowledgeBaseDocuments" + }, + { + "target": "com.amazonaws.bedrockagent#IngestKnowledgeBaseDocuments" + }, + { + "target": "com.amazonaws.bedrockagent#ListKnowledgeBaseDocuments" + } + ] + }, + "com.amazonaws.bedrockagent#KnowledgeBaseDocuments": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseDocument" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 10 + } } }, "com.amazonaws.bedrockagent#KnowledgeBaseFlowNodeConfiguration": { @@ -9832,6 +10587,108 @@ "smithy.api#output": {} } }, + "com.amazonaws.bedrockagent#ListKnowledgeBaseDocuments": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockagent#ListKnowledgeBaseDocumentsRequest" + }, + "output": { + "target": "com.amazonaws.bedrockagent#ListKnowledgeBaseDocumentsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockagent#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockagent#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockagent#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.bedrockagent#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.bedrockagent#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockagent#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Retrieves all the documents contained in a data source that is connected to a knowledge base. For more information, see Ingest documents into a knowledge base in real-time in the Amazon Bedrock User Guide.

", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "documentDetails" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": ["console"] + } + }, + "com.amazonaws.bedrockagent#ListKnowledgeBaseDocumentsRequest": { + "type": "structure", + "members": { + "knowledgeBaseId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "

The unique identifier of the knowledge base that is connected to the data source.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "dataSourceId": { + "target": "com.amazonaws.bedrockagent#Id", + "traits": { + "smithy.api#documentation": "

The unique identifier of the data source that contains the documents.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "maxResults": { + "target": "com.amazonaws.bedrockagent#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

" + } + }, + "nextToken": { + "target": "com.amazonaws.bedrockagent#NextToken", + "traits": { + "smithy.api#documentation": "

If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagent#ListKnowledgeBaseDocumentsResponse": { + "type": "structure", + "members": { + "documentDetails": { + "target": "com.amazonaws.bedrockagent#KnowledgeBaseDocumentDetails", + "traits": { + "smithy.api#documentation": "

A list of objects, each of which contains information about the documents that were retrieved.

", + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

If the total number of results is greater than the maxResults value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.bedrockagent#ListKnowledgeBases": { "type": "operation", "input": { @@ -10206,6 +11063,123 @@ "target": "com.amazonaws.bedrockagent#Message" } }, + "com.amazonaws.bedrockagent#MetadataAttribute": { + "type": "structure", + "members": { + "key": { + "target": "com.amazonaws.bedrockagent#Key", + "traits": { + "smithy.api#documentation": "

The key of the metadata attribute.

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

Contains the value of the metadata attribute.

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

Contains information about a metadata attribute.

" + } + }, + "com.amazonaws.bedrockagent#MetadataAttributeValue": { + "type": "structure", + "members": { + "type": { + "target": "com.amazonaws.bedrockagent#MetadataValueType", + "traits": { + "smithy.api#documentation": "

The type of the metadata attribute.

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

The value of the numeric metadata attribute.

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

The value of the Boolean metadata attribute.

" + } + }, + "stringValue": { + "target": "com.amazonaws.bedrockagent#StringValue", + "traits": { + "smithy.api#documentation": "

The value of the string metadata attribute.

" + } + }, + "stringListValue": { + "target": "com.amazonaws.bedrockagent#StringListValue", + "traits": { + "smithy.api#documentation": "

An array of strings that define the value of the metadata attribute.

", + "smithy.api#length": { + "min": 1, + "max": 10 + } + } + } + }, + "traits": { + "smithy.api#documentation": "

Contains the value of the metadata attribute. Choose a type and include the field that corresponds to it.

" + } + }, + "com.amazonaws.bedrockagent#MetadataAttributes": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#MetadataAttribute" + } + }, + "com.amazonaws.bedrockagent#MetadataSourceType": { + "type": "enum", + "members": { + "IN_LINE_ATTRIBUTE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IN_LINE_ATTRIBUTE" + } + }, + "S3_LOCATION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "S3_LOCATION" + } + } + } + }, + "com.amazonaws.bedrockagent#MetadataValueType": { + "type": "enum", + "members": { + "BOOLEAN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BOOLEAN" + } + }, + "NUMBER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NUMBER" + } + }, + "STRING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "STRING" + } + }, + "STRING_LIST": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "STRING_LIST" + } + } + } + }, "com.amazonaws.bedrockagent#Microsoft365TenantId": { "type": "string", "traits": { @@ -10570,6 +11544,12 @@ } } }, + "com.amazonaws.bedrockagent#NumberValue": { + "type": "double", + "traits": { + "smithy.api#sensitive": {} + } + }, "com.amazonaws.bedrockagent#NumericalVersion": { "type": "string", "traits": { @@ -12065,6 +13045,21 @@ "smithy.api#pattern": "^s3://.{1,128}$" } }, + "com.amazonaws.bedrockagent#S3Content": { + "type": "structure", + "members": { + "s3Location": { + "target": "com.amazonaws.bedrockagent#S3Location", + "traits": { + "smithy.api#documentation": "

The S3 location of the file containing the content to ingest.

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

Contains information about the content to ingest into a knowledge base connected to an Amazon S3 data source.

" + } + }, "com.amazonaws.bedrockagent#S3DataSourceConfiguration": { "type": "structure", "members": { @@ -12137,6 +13132,16 @@ "smithy.api#pattern": "^[\\.\\-\\!\\*\\_\\'\\(\\)a-zA-Z0-9][\\.\\-\\!\\*\\_\\'\\(\\)\\/a-zA-Z0-9]*$" } }, + "com.amazonaws.bedrockagent#S3ObjectUri": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1024 + }, + "smithy.api#pattern": "^s3://[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]/.{1,1024}$" + } + }, "com.amazonaws.bedrockagent#S3Prefix": { "type": "string", "traits": { @@ -12803,6 +13808,22 @@ "smithy.api#documentation": "

Contains configurations for the service to use for storing the input into the node.

" } }, + "com.amazonaws.bedrockagent#StringListValue": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockagent#StringValue" + } + }, + "com.amazonaws.bedrockagent#StringValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#sensitive": {} + } + }, "com.amazonaws.bedrockagent#SystemContentBlock": { "type": "union", "members": { @@ -12965,6 +13986,21 @@ } } }, + "com.amazonaws.bedrockagent#TextContentDoc": { + "type": "structure", + "members": { + "data": { + "target": "com.amazonaws.bedrockagent#Data", + "traits": { + "smithy.api#documentation": "

The text of the content.

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

Contains information about content defined inline in text.

" + } + }, "com.amazonaws.bedrockagent#TextPrompt": { "type": "string", "traits": {