Skip to content

Commit

Permalink
feat(client-bedrock-agent): This release introduces APIs to upload do…
Browse files Browse the repository at this point in the history
…cuments directly into a Knowledge Base
  • Loading branch information
awstools committed Dec 2, 2024
1 parent 824c92f commit 908a395
Show file tree
Hide file tree
Showing 21 changed files with 3,390 additions and 447 deletions.
32 changes: 32 additions & 0 deletions clients/client-bedrock-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)

</details>
<details>
<summary>
DeleteKnowledgeBaseDocuments
</summary>

[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/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -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/)

</details>
<details>
<summary>
GetKnowledgeBaseDocuments
</summary>

[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/)

</details>
<details>
<summary>
Expand All @@ -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/)

</details>
<details>
<summary>
IngestKnowledgeBaseDocuments
</summary>

[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/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -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/)

</details>
<details>
<summary>
ListKnowledgeBaseDocuments
</summary>

[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/)

</details>
<details>
<summary>
Expand Down
92 changes: 92 additions & 0 deletions clients/client-bedrock-agent/src/BedrockAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ import {
DeleteKnowledgeBaseCommandInput,
DeleteKnowledgeBaseCommandOutput,
} from "./commands/DeleteKnowledgeBaseCommand";
import {
DeleteKnowledgeBaseDocumentsCommand,
DeleteKnowledgeBaseDocumentsCommandInput,
DeleteKnowledgeBaseDocumentsCommandOutput,
} from "./commands/DeleteKnowledgeBaseDocumentsCommand";
import {
DeletePromptCommand,
DeletePromptCommandInput,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -187,6 +202,11 @@ import {
ListIngestionJobsCommandInput,
ListIngestionJobsCommandOutput,
} from "./commands/ListIngestionJobsCommand";
import {
ListKnowledgeBaseDocumentsCommand,
ListKnowledgeBaseDocumentsCommandInput,
ListKnowledgeBaseDocumentsCommandOutput,
} from "./commands/ListKnowledgeBaseDocumentsCommand";
import {
ListKnowledgeBasesCommand,
ListKnowledgeBasesCommandInput,
Expand Down Expand Up @@ -284,6 +304,7 @@ const commands = {
DeleteFlowAliasCommand,
DeleteFlowVersionCommand,
DeleteKnowledgeBaseCommand,
DeleteKnowledgeBaseDocumentsCommand,
DeletePromptCommand,
DisassociateAgentKnowledgeBaseCommand,
GetAgentCommand,
Expand All @@ -297,7 +318,9 @@ const commands = {
GetFlowVersionCommand,
GetIngestionJobCommand,
GetKnowledgeBaseCommand,
GetKnowledgeBaseDocumentsCommand,
GetPromptCommand,
IngestKnowledgeBaseDocumentsCommand,
ListAgentActionGroupsCommand,
ListAgentAliasesCommand,
ListAgentKnowledgeBasesCommand,
Expand All @@ -308,6 +331,7 @@ const commands = {
ListFlowsCommand,
ListFlowVersionsCommand,
ListIngestionJobsCommand,
ListKnowledgeBaseDocumentsCommand,
ListKnowledgeBasesCommand,
ListPromptsCommand,
ListTagsForResourceCommand,
Expand Down Expand Up @@ -634,6 +658,23 @@ export interface BedrockAgent {
cb: (err: any, data?: DeleteKnowledgeBaseCommandOutput) => void
): void;

/**
* @see {@link DeleteKnowledgeBaseDocumentsCommand}
*/
deleteKnowledgeBaseDocuments(
args: DeleteKnowledgeBaseDocumentsCommandInput,
options?: __HttpHandlerOptions
): Promise<DeleteKnowledgeBaseDocumentsCommandOutput>;
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}
*/
Expand Down Expand Up @@ -810,6 +851,23 @@ export interface BedrockAgent {
cb: (err: any, data?: GetKnowledgeBaseCommandOutput) => void
): void;

/**
* @see {@link GetKnowledgeBaseDocumentsCommand}
*/
getKnowledgeBaseDocuments(
args: GetKnowledgeBaseDocumentsCommandInput,
options?: __HttpHandlerOptions
): Promise<GetKnowledgeBaseDocumentsCommandOutput>;
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}
*/
Expand All @@ -821,6 +879,23 @@ export interface BedrockAgent {
cb: (err: any, data?: GetPromptCommandOutput) => void
): void;

/**
* @see {@link IngestKnowledgeBaseDocumentsCommand}
*/
ingestKnowledgeBaseDocuments(
args: IngestKnowledgeBaseDocumentsCommandInput,
options?: __HttpHandlerOptions
): Promise<IngestKnowledgeBaseDocumentsCommandOutput>;
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}
*/
Expand Down Expand Up @@ -975,6 +1050,23 @@ export interface BedrockAgent {
cb: (err: any, data?: ListIngestionJobsCommandOutput) => void
): void;

/**
* @see {@link ListKnowledgeBaseDocumentsCommand}
*/
listKnowledgeBaseDocuments(
args: ListKnowledgeBaseDocumentsCommandInput,
options?: __HttpHandlerOptions
): Promise<ListKnowledgeBaseDocumentsCommandOutput>;
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}
*/
Expand Down
24 changes: 24 additions & 0 deletions clients/client-bedrock-agent/src/BedrockAgentClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ import {
DeleteKnowledgeBaseCommandInput,
DeleteKnowledgeBaseCommandOutput,
} from "./commands/DeleteKnowledgeBaseCommand";
import {
DeleteKnowledgeBaseDocumentsCommandInput,
DeleteKnowledgeBaseDocumentsCommandOutput,
} from "./commands/DeleteKnowledgeBaseDocumentsCommand";
import { DeletePromptCommandInput, DeletePromptCommandOutput } from "./commands/DeletePromptCommand";
import {
DisassociateAgentKnowledgeBaseCommandInput,
Expand All @@ -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,
Expand All @@ -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 {
Expand Down Expand Up @@ -199,6 +215,7 @@ export type ServiceInputTypes =
| DeleteFlowCommandInput
| DeleteFlowVersionCommandInput
| DeleteKnowledgeBaseCommandInput
| DeleteKnowledgeBaseDocumentsCommandInput
| DeletePromptCommandInput
| DisassociateAgentKnowledgeBaseCommandInput
| GetAgentActionGroupCommandInput
Expand All @@ -212,7 +229,9 @@ export type ServiceInputTypes =
| GetFlowVersionCommandInput
| GetIngestionJobCommandInput
| GetKnowledgeBaseCommandInput
| GetKnowledgeBaseDocumentsCommandInput
| GetPromptCommandInput
| IngestKnowledgeBaseDocumentsCommandInput
| ListAgentActionGroupsCommandInput
| ListAgentAliasesCommandInput
| ListAgentKnowledgeBasesCommandInput
Expand All @@ -223,6 +242,7 @@ export type ServiceInputTypes =
| ListFlowVersionsCommandInput
| ListFlowsCommandInput
| ListIngestionJobsCommandInput
| ListKnowledgeBaseDocumentsCommandInput
| ListKnowledgeBasesCommandInput
| ListPromptsCommandInput
| ListTagsForResourceCommandInput
Expand Down Expand Up @@ -267,6 +287,7 @@ export type ServiceOutputTypes =
| DeleteFlowCommandOutput
| DeleteFlowVersionCommandOutput
| DeleteKnowledgeBaseCommandOutput
| DeleteKnowledgeBaseDocumentsCommandOutput
| DeletePromptCommandOutput
| DisassociateAgentKnowledgeBaseCommandOutput
| GetAgentActionGroupCommandOutput
Expand All @@ -280,7 +301,9 @@ export type ServiceOutputTypes =
| GetFlowVersionCommandOutput
| GetIngestionJobCommandOutput
| GetKnowledgeBaseCommandOutput
| GetKnowledgeBaseDocumentsCommandOutput
| GetPromptCommandOutput
| IngestKnowledgeBaseDocumentsCommandOutput
| ListAgentActionGroupsCommandOutput
| ListAgentAliasesCommandOutput
| ListAgentKnowledgeBasesCommandOutput
Expand All @@ -291,6 +314,7 @@ export type ServiceOutputTypes =
| ListFlowVersionsCommandOutput
| ListFlowsCommandOutput
| ListIngestionJobsCommandOutput
| ListKnowledgeBaseDocumentsCommandOutput
| ListKnowledgeBasesCommandOutput
| ListPromptsCommandOutput
| ListTagsForResourceCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface CreateDataSourceCommandInput extends CreateDataSourceRequest {}
export interface CreateDataSourceCommandOutput extends CreateDataSourceResponse, __MetadataBearer {}

/**
* <p>Creates a data source connector for a knowledge base.</p>
* <p>Connects a knowledge base to a data source. You specify the configuration for the specific data source service in the <code>dataSourceConfiguration</code> field.</p>
* <important>
* <p>You can't change the <code>chunkingConfiguration</code> after you create the data source connector.</p>
* </important>
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down
Loading

0 comments on commit 908a395

Please sign in to comment.