Skip to content

Commit

Permalink
feat(client-bedrock-agent): Support for custom user agent and max web…
Browse files Browse the repository at this point in the history
… pages crawled for web connector. Support app only credentials for SharePoint connector. Increase agents memory duration limit to 365 days. Support to specify max number of session summaries to include in agent invocation context.
  • Loading branch information
awstools committed Dec 20, 2024
1 parent 47d77a9 commit 808e71b
Show file tree
Hide file tree
Showing 11 changed files with 171 additions and 35 deletions.
10 changes: 8 additions & 2 deletions clients/client-bedrock-agent/src/commands/CreateAgentCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export interface CreateAgentCommandOutput extends CreateAgentResponse, __Metadat
* promptOverrideConfiguration: { // PromptOverrideConfiguration
* promptConfigurations: [ // PromptConfigurations // required
* { // PromptConfiguration
* promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "POST_PROCESSING" || "KNOWLEDGE_BASE_RESPONSE_GENERATION",
* promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "POST_PROCESSING" || "KNOWLEDGE_BASE_RESPONSE_GENERATION" || "MEMORY_SUMMARIZATION",
* promptCreationMode: "DEFAULT" || "OVERRIDDEN",
* promptState: "ENABLED" || "DISABLED",
* basePromptTemplate: "STRING_VALUE",
Expand Down Expand Up @@ -120,6 +120,9 @@ export interface CreateAgentCommandOutput extends CreateAgentResponse, __Metadat
* "SESSION_SUMMARY",
* ],
* storageDays: Number("int"),
* sessionSummaryConfiguration: { // SessionSummaryConfiguration
* maxRecentSessions: Number("int"),
* },
* },
* agentCollaboration: "SUPERVISOR" || "SUPERVISOR_ROUTER" || "DISABLED",
* };
Expand Down Expand Up @@ -157,7 +160,7 @@ export interface CreateAgentCommandOutput extends CreateAgentResponse, __Metadat
* // promptOverrideConfiguration: { // PromptOverrideConfiguration
* // promptConfigurations: [ // PromptConfigurations // required
* // { // PromptConfiguration
* // promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "POST_PROCESSING" || "KNOWLEDGE_BASE_RESPONSE_GENERATION",
* // promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "POST_PROCESSING" || "KNOWLEDGE_BASE_RESPONSE_GENERATION" || "MEMORY_SUMMARIZATION",
* // promptCreationMode: "DEFAULT" || "OVERRIDDEN",
* // promptState: "ENABLED" || "DISABLED",
* // basePromptTemplate: "STRING_VALUE",
Expand Down Expand Up @@ -185,6 +188,9 @@ export interface CreateAgentCommandOutput extends CreateAgentResponse, __Metadat
* // "SESSION_SUMMARY",
* // ],
* // storageDays: Number("int"),
* // sessionSummaryConfiguration: { // SessionSummaryConfiguration
* // maxRecentSessions: Number("int"),
* // },
* // },
* // agentCollaboration: "SUPERVISOR" || "SUPERVISOR_ROUTER" || "DISABLED",
* // },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export interface CreateDataSourceCommandOutput extends CreateDataSourceResponse,
* crawlerConfiguration: { // WebCrawlerConfiguration
* crawlerLimits: { // WebCrawlerLimits
* rateLimit: Number("int"),
* maxPages: Number("int"),
* },
* inclusionFilters: [ // FilterList
* "STRING_VALUE",
Expand All @@ -78,6 +79,7 @@ export interface CreateDataSourceCommandOutput extends CreateDataSourceResponse,
* "STRING_VALUE",
* ],
* scope: "HOST_ONLY" || "SUBDOMAINS",
* userAgent: "STRING_VALUE",
* },
* },
* confluenceConfiguration: { // ConfluenceDataSourceConfiguration
Expand Down Expand Up @@ -137,7 +139,7 @@ export interface CreateDataSourceCommandOutput extends CreateDataSourceResponse,
* "STRING_VALUE",
* ],
* hostType: "ONLINE", // required
* authType: "OAUTH2_CLIENT_CREDENTIALS", // required
* authType: "OAUTH2_CLIENT_CREDENTIALS" || "OAUTH2_SHAREPOINT_APP_ONLY_CLIENT_CREDENTIALS", // required
* credentialsSecretArn: "STRING_VALUE", // required
* },
* crawlerConfiguration: { // SharePointCrawlerConfiguration
Expand Down Expand Up @@ -244,6 +246,7 @@ export interface CreateDataSourceCommandOutput extends CreateDataSourceResponse,
* // crawlerConfiguration: { // WebCrawlerConfiguration
* // crawlerLimits: { // WebCrawlerLimits
* // rateLimit: Number("int"),
* // maxPages: Number("int"),
* // },
* // inclusionFilters: [ // FilterList
* // "STRING_VALUE",
Expand All @@ -252,6 +255,7 @@ export interface CreateDataSourceCommandOutput extends CreateDataSourceResponse,
* // "STRING_VALUE",
* // ],
* // scope: "HOST_ONLY" || "SUBDOMAINS",
* // userAgent: "STRING_VALUE",
* // },
* // },
* // confluenceConfiguration: { // ConfluenceDataSourceConfiguration
Expand Down Expand Up @@ -311,7 +315,7 @@ export interface CreateDataSourceCommandOutput extends CreateDataSourceResponse,
* // "STRING_VALUE",
* // ],
* // hostType: "ONLINE", // required
* // authType: "OAUTH2_CLIENT_CREDENTIALS", // required
* // authType: "OAUTH2_CLIENT_CREDENTIALS" || "OAUTH2_SHAREPOINT_APP_ONLY_CLIENT_CREDENTIALS", // required
* // credentialsSecretArn: "STRING_VALUE", // required
* // },
* // crawlerConfiguration: { // SharePointCrawlerConfiguration
Expand Down
5 changes: 4 additions & 1 deletion clients/client-bedrock-agent/src/commands/GetAgentCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export interface GetAgentCommandOutput extends GetAgentResponse, __MetadataBeare
* // promptOverrideConfiguration: { // PromptOverrideConfiguration
* // promptConfigurations: [ // PromptConfigurations // required
* // { // PromptConfiguration
* // promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "POST_PROCESSING" || "KNOWLEDGE_BASE_RESPONSE_GENERATION",
* // promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "POST_PROCESSING" || "KNOWLEDGE_BASE_RESPONSE_GENERATION" || "MEMORY_SUMMARIZATION",
* // promptCreationMode: "DEFAULT" || "OVERRIDDEN",
* // promptState: "ENABLED" || "DISABLED",
* // basePromptTemplate: "STRING_VALUE",
Expand Down Expand Up @@ -100,6 +100,9 @@ export interface GetAgentCommandOutput extends GetAgentResponse, __MetadataBeare
* // "SESSION_SUMMARY",
* // ],
* // storageDays: Number("int"),
* // sessionSummaryConfiguration: { // SessionSummaryConfiguration
* // maxRecentSessions: Number("int"),
* // },
* // },
* // agentCollaboration: "SUPERVISOR" || "SUPERVISOR_ROUTER" || "DISABLED",
* // },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export interface GetAgentVersionCommandOutput extends GetAgentVersionResponse, _
* // promptOverrideConfiguration: { // PromptOverrideConfiguration
* // promptConfigurations: [ // PromptConfigurations // required
* // { // PromptConfiguration
* // promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "POST_PROCESSING" || "KNOWLEDGE_BASE_RESPONSE_GENERATION",
* // promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "POST_PROCESSING" || "KNOWLEDGE_BASE_RESPONSE_GENERATION" || "MEMORY_SUMMARIZATION",
* // promptCreationMode: "DEFAULT" || "OVERRIDDEN",
* // promptState: "ENABLED" || "DISABLED",
* // basePromptTemplate: "STRING_VALUE",
Expand Down Expand Up @@ -97,6 +97,9 @@ export interface GetAgentVersionCommandOutput extends GetAgentVersionResponse, _
* // "SESSION_SUMMARY",
* // ],
* // storageDays: Number("int"),
* // sessionSummaryConfiguration: { // SessionSummaryConfiguration
* // maxRecentSessions: Number("int"),
* // },
* // },
* // agentCollaboration: "SUPERVISOR" || "SUPERVISOR_ROUTER" || "DISABLED",
* // },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export interface GetDataSourceCommandOutput extends GetDataSourceResponse, __Met
* // crawlerConfiguration: { // WebCrawlerConfiguration
* // crawlerLimits: { // WebCrawlerLimits
* // rateLimit: Number("int"),
* // maxPages: Number("int"),
* // },
* // inclusionFilters: [ // FilterList
* // "STRING_VALUE",
Expand All @@ -82,6 +83,7 @@ export interface GetDataSourceCommandOutput extends GetDataSourceResponse, __Met
* // "STRING_VALUE",
* // ],
* // scope: "HOST_ONLY" || "SUBDOMAINS",
* // userAgent: "STRING_VALUE",
* // },
* // },
* // confluenceConfiguration: { // ConfluenceDataSourceConfiguration
Expand Down Expand Up @@ -141,7 +143,7 @@ export interface GetDataSourceCommandOutput extends GetDataSourceResponse, __Met
* // "STRING_VALUE",
* // ],
* // hostType: "ONLINE", // required
* // authType: "OAUTH2_CLIENT_CREDENTIALS", // required
* // authType: "OAUTH2_CLIENT_CREDENTIALS" || "OAUTH2_SHAREPOINT_APP_ONLY_CLIENT_CREDENTIALS", // required
* // credentialsSecretArn: "STRING_VALUE", // required
* // },
* // crawlerConfiguration: { // SharePointCrawlerConfiguration
Expand Down
10 changes: 8 additions & 2 deletions clients/client-bedrock-agent/src/commands/UpdateAgentCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export interface UpdateAgentCommandOutput extends UpdateAgentResponse, __Metadat
* promptOverrideConfiguration: { // PromptOverrideConfiguration
* promptConfigurations: [ // PromptConfigurations // required
* { // PromptConfiguration
* promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "POST_PROCESSING" || "KNOWLEDGE_BASE_RESPONSE_GENERATION",
* promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "POST_PROCESSING" || "KNOWLEDGE_BASE_RESPONSE_GENERATION" || "MEMORY_SUMMARIZATION",
* promptCreationMode: "DEFAULT" || "OVERRIDDEN",
* promptState: "ENABLED" || "DISABLED",
* basePromptTemplate: "STRING_VALUE",
Expand Down Expand Up @@ -86,6 +86,9 @@ export interface UpdateAgentCommandOutput extends UpdateAgentResponse, __Metadat
* "SESSION_SUMMARY",
* ],
* storageDays: Number("int"),
* sessionSummaryConfiguration: { // SessionSummaryConfiguration
* maxRecentSessions: Number("int"),
* },
* },
* agentCollaboration: "SUPERVISOR" || "SUPERVISOR_ROUTER" || "DISABLED",
* };
Expand Down Expand Up @@ -123,7 +126,7 @@ export interface UpdateAgentCommandOutput extends UpdateAgentResponse, __Metadat
* // promptOverrideConfiguration: { // PromptOverrideConfiguration
* // promptConfigurations: [ // PromptConfigurations // required
* // { // PromptConfiguration
* // promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "POST_PROCESSING" || "KNOWLEDGE_BASE_RESPONSE_GENERATION",
* // promptType: "PRE_PROCESSING" || "ORCHESTRATION" || "POST_PROCESSING" || "KNOWLEDGE_BASE_RESPONSE_GENERATION" || "MEMORY_SUMMARIZATION",
* // promptCreationMode: "DEFAULT" || "OVERRIDDEN",
* // promptState: "ENABLED" || "DISABLED",
* // basePromptTemplate: "STRING_VALUE",
Expand Down Expand Up @@ -151,6 +154,9 @@ export interface UpdateAgentCommandOutput extends UpdateAgentResponse, __Metadat
* // "SESSION_SUMMARY",
* // ],
* // storageDays: Number("int"),
* // sessionSummaryConfiguration: { // SessionSummaryConfiguration
* // maxRecentSessions: Number("int"),
* // },
* // },
* // agentCollaboration: "SUPERVISOR" || "SUPERVISOR_ROUTER" || "DISABLED",
* // },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export interface UpdateDataSourceCommandOutput extends UpdateDataSourceResponse,
* crawlerConfiguration: { // WebCrawlerConfiguration
* crawlerLimits: { // WebCrawlerLimits
* rateLimit: Number("int"),
* maxPages: Number("int"),
* },
* inclusionFilters: [ // FilterList
* "STRING_VALUE",
Expand All @@ -78,6 +79,7 @@ export interface UpdateDataSourceCommandOutput extends UpdateDataSourceResponse,
* "STRING_VALUE",
* ],
* scope: "HOST_ONLY" || "SUBDOMAINS",
* userAgent: "STRING_VALUE",
* },
* },
* confluenceConfiguration: { // ConfluenceDataSourceConfiguration
Expand Down Expand Up @@ -137,7 +139,7 @@ export interface UpdateDataSourceCommandOutput extends UpdateDataSourceResponse,
* "STRING_VALUE",
* ],
* hostType: "ONLINE", // required
* authType: "OAUTH2_CLIENT_CREDENTIALS", // required
* authType: "OAUTH2_CLIENT_CREDENTIALS" || "OAUTH2_SHAREPOINT_APP_ONLY_CLIENT_CREDENTIALS", // required
* credentialsSecretArn: "STRING_VALUE", // required
* },
* crawlerConfiguration: { // SharePointCrawlerConfiguration
Expand Down Expand Up @@ -244,6 +246,7 @@ export interface UpdateDataSourceCommandOutput extends UpdateDataSourceResponse,
* // crawlerConfiguration: { // WebCrawlerConfiguration
* // crawlerLimits: { // WebCrawlerLimits
* // rateLimit: Number("int"),
* // maxPages: Number("int"),
* // },
* // inclusionFilters: [ // FilterList
* // "STRING_VALUE",
Expand All @@ -252,6 +255,7 @@ export interface UpdateDataSourceCommandOutput extends UpdateDataSourceResponse,
* // "STRING_VALUE",
* // ],
* // scope: "HOST_ONLY" || "SUBDOMAINS",
* // userAgent: "STRING_VALUE",
* // },
* // },
* // confluenceConfiguration: { // ConfluenceDataSourceConfiguration
Expand Down Expand Up @@ -311,7 +315,7 @@ export interface UpdateDataSourceCommandOutput extends UpdateDataSourceResponse,
* // "STRING_VALUE",
* // ],
* // hostType: "ONLINE", // required
* // authType: "OAUTH2_CLIENT_CREDENTIALS", // required
* // authType: "OAUTH2_CLIENT_CREDENTIALS" || "OAUTH2_SHAREPOINT_APP_ONLY_CLIENT_CREDENTIALS", // required
* // credentialsSecretArn: "STRING_VALUE", // required
* // },
* // crawlerConfiguration: { // SharePointCrawlerConfiguration
Expand Down
59 changes: 39 additions & 20 deletions clients/client-bedrock-agent/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,18 @@ export const MemoryType = {
*/
export type MemoryType = (typeof MemoryType)[keyof typeof MemoryType];

/**
* <p>Configuration for SESSION_SUMMARY memory type enabled for the agent.</p>
* @public
*/
export interface SessionSummaryConfiguration {
/**
* <p>Maximum number of recent session summaries to include in the agent's prompt context.</p>
* @public
*/
maxRecentSessions?: number | undefined;
}

/**
* <p>Details of the memory configuration.</p>
* @public
Expand All @@ -1077,6 +1089,12 @@ export interface MemoryConfiguration {
* @public
*/
storageDays?: number | undefined;

/**
* <p>Contains the configuration for SESSION_SUMMARY memory type enabled for the agent. </p>
* @public
*/
sessionSummaryConfiguration?: SessionSummaryConfiguration | undefined;
}

/**
Expand Down Expand Up @@ -1163,6 +1181,7 @@ export type PromptState = (typeof PromptState)[keyof typeof PromptState];
*/
export const PromptType = {
KNOWLEDGE_BASE_RESPONSE_GENERATION: "KNOWLEDGE_BASE_RESPONSE_GENERATION",
MEMORY_SUMMARIZATION: "MEMORY_SUMMARIZATION",
ORCHESTRATION: "ORCHESTRATION",
POST_PROCESSING: "POST_PROCESSING",
PRE_PROCESSING: "PRE_PROCESSING",
Expand Down Expand Up @@ -3235,6 +3254,7 @@ export interface SharePointCrawlerConfiguration {
*/
export const SharePointAuthType = {
OAUTH2_CLIENT_CREDENTIALS: "OAUTH2_CLIENT_CREDENTIALS",
OAUTH2_SHAREPOINT_APP_ONLY_CLIENT_CREDENTIALS: "OAUTH2_SHAREPOINT_APP_ONLY_CLIENT_CREDENTIALS",
} as const;

/**
Expand Down Expand Up @@ -3351,6 +3371,15 @@ export interface WebCrawlerLimits {
* @public
*/
rateLimit?: number | undefined;

/**
* <p>
* The max number of web pages crawled from your source URLs, up to 25,000 pages. If
* the web pages exceed this limit, the data source sync will fail and no web pages will be ingested.
* </p>
* @public
*/
maxPages?: number | undefined;
}

/**
Expand Down Expand Up @@ -3408,6 +3437,15 @@ export interface WebCrawlerConfiguration {
* @public
*/
scope?: WebScopeType | undefined;

/**
* <p>A string used for identifying the crawler or a bot when it accesses a web server. By default,
* this is set to <code>bedrockbot_UUID</code> for your crawler. You can optionally append a custom
* string to <code>bedrockbot_UUID</code> to allowlist a specific user agent permitted to access your source URLs.
* </p>
* @public
*/
userAgent?: string | undefined;
}

/**
Expand Down Expand Up @@ -9194,18 +9232,6 @@ export interface ByteContentDoc {
data: Uint8Array | undefined;
}

/**
* <p>Contains information about content defined inline in text.</p>
* @public
*/
export interface TextContentDoc {
/**
* <p>The text of the content.</p>
* @public
*/
data: string | undefined;
}

/**
* @internal
*/
Expand Down Expand Up @@ -9521,6 +9547,7 @@ export const WebCrawlerConfigurationFilterSensitiveLog = (obj: WebCrawlerConfigu
...obj,
...(obj.inclusionFilters && { inclusionFilters: SENSITIVE_STRING }),
...(obj.exclusionFilters && { exclusionFilters: SENSITIVE_STRING }),
...(obj.userAgent && { userAgent: SENSITIVE_STRING }),
});

/**
Expand Down Expand Up @@ -9897,11 +9924,3 @@ 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 }),
});
22 changes: 20 additions & 2 deletions clients/client-bedrock-agent/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,20 @@ import {
PromptTemplateConfigurationFilterSensitiveLog,
PromptTemplateType,
S3Location,
TextContentDoc,
TextContentDocFilterSensitiveLog,
} from "./models_0";

/**
* <p>Contains information about content defined inline in text.</p>
* @public
*/
export interface TextContentDoc {
/**
* <p>The text of the content.</p>
* @public
*/
data: string | undefined;
}

/**
* @public
* @enum
Expand Down Expand Up @@ -2671,6 +2681,14 @@ export interface ListAgentVersionsResponse {
nextToken?: string | undefined;
}

/**
* @internal
*/
export const TextContentDocFilterSensitiveLog = (obj: TextContentDoc): any => ({
...obj,
...(obj.data && { data: SENSITIVE_STRING }),
});

/**
* @internal
*/
Expand Down
Loading

0 comments on commit 808e71b

Please sign in to comment.