": [
+ * // {
+ * // name: "STRING_VALUE",
+ * // type: "STRING_VALUE",
+ * // value: "STRING_VALUE",
+ * // },
+ * // ],
+ * // },
+ * // },
+ * // },
+ * // knowledgeBaseLookupInput: { // KnowledgeBaseLookupInput
+ * // text: "STRING_VALUE",
+ * // knowledgeBaseId: "STRING_VALUE",
+ * // },
+ * // },
+ * // observation: { // Observation
+ * // traceId: "STRING_VALUE",
+ * // type: "ACTION_GROUP" || "KNOWLEDGE_BASE" || "FINISH" || "ASK_USER" || "REPROMPT",
+ * // actionGroupInvocationOutput: { // ActionGroupInvocationOutput
+ * // text: "STRING_VALUE",
+ * // },
+ * // knowledgeBaseLookupOutput: { // KnowledgeBaseLookupOutput
+ * // retrievedReferences: [
+ * // {
+ * // content: {
+ * // text: "STRING_VALUE", // required
+ * // },
+ * // location: {
+ * // type: "S3", // required
+ * // s3Location: {
+ * // uri: "STRING_VALUE",
+ * // },
+ * // },
+ * // },
+ * // ],
+ * // },
+ * // finalResponse: { // FinalResponse
+ * // text: "STRING_VALUE",
+ * // },
+ * // repromptResponse: { // RepromptResponse
+ * // text: "STRING_VALUE",
+ * // source: "ACTION_GROUP" || "KNOWLEDGE_BASE" || "PARSER",
+ * // },
+ * // },
+ * // modelInvocationInput: {
+ * // traceId: "STRING_VALUE",
+ * // text: "STRING_VALUE",
+ * // type: "PRE_PROCESSING" || "ORCHESTRATION" || "KNOWLEDGE_BASE_RESPONSE_GENERATION" || "POST_PROCESSING",
+ * // inferenceConfiguration: {
+ * // temperature: Number("float"),
+ * // topP: Number("float"),
+ * // topK: Number("int"),
+ * // maximumLength: Number("int"),
+ * // stopSequences: [
+ * // "STRING_VALUE",
+ * // ],
+ * // },
+ * // overrideLambda: "STRING_VALUE",
+ * // promptCreationMode: "DEFAULT" || "OVERRIDDEN",
+ * // parserMode: "DEFAULT" || "OVERRIDDEN",
+ * // },
+ * // },
+ * // postProcessingTrace: { // PostProcessingTrace Union: only one key present
+ * // modelInvocationInput: {
+ * // traceId: "STRING_VALUE",
+ * // text: "STRING_VALUE",
+ * // type: "PRE_PROCESSING" || "ORCHESTRATION" || "KNOWLEDGE_BASE_RESPONSE_GENERATION" || "POST_PROCESSING",
+ * // inferenceConfiguration: {
+ * // temperature: Number("float"),
+ * // topP: Number("float"),
+ * // topK: Number("int"),
+ * // maximumLength: Number("int"),
+ * // stopSequences: [
+ * // "STRING_VALUE",
+ * // ],
+ * // },
+ * // overrideLambda: "STRING_VALUE",
+ * // promptCreationMode: "DEFAULT" || "OVERRIDDEN",
+ * // parserMode: "DEFAULT" || "OVERRIDDEN",
+ * // },
+ * // modelInvocationOutput: { // PostProcessingModelInvocationOutput
+ * // traceId: "STRING_VALUE",
+ * // parsedResponse: { // PostProcessingParsedResponse
+ * // text: "STRING_VALUE",
+ * // },
+ * // },
+ * // },
+ * // failureTrace: { // FailureTrace
+ * // traceId: "STRING_VALUE",
+ * // failureReason: "STRING_VALUE",
+ * // },
+ * // },
+ * // },
+ * // internalServerException: { // InternalServerException
+ * // message: "STRING_VALUE",
+ * // },
+ * // validationException: { // ValidationException
+ * // message: "STRING_VALUE",
+ * // },
+ * // resourceNotFoundException: { // ResourceNotFoundException
+ * // message: "STRING_VALUE",
+ * // },
+ * // serviceQuotaExceededException: { // ServiceQuotaExceededException
+ * // message: "STRING_VALUE",
+ * // },
+ * // throttlingException: { // ThrottlingException
+ * // message: "STRING_VALUE",
+ * // },
+ * // accessDeniedException: { // AccessDeniedException
+ * // message: "STRING_VALUE",
+ * // },
+ * // conflictException: { // ConflictException
+ * // message: "STRING_VALUE",
+ * // },
+ * // dependencyFailedException: { // DependencyFailedException
+ * // message: "STRING_VALUE",
+ * // resourceName: "STRING_VALUE",
+ * // },
+ * // badGatewayException: { // BadGatewayException
+ * // message: "STRING_VALUE",
+ * // resourceName: "STRING_VALUE",
+ * // },
+ * // },
+ * // contentType: "STRING_VALUE", // required
+ * // sessionId: "STRING_VALUE", // required
+ * // };
+ *
+ * ```
+ *
+ * @param InvokeAgentCommandInput - {@link InvokeAgentCommandInput}
+ * @returns {@link InvokeAgentCommandOutput}
+ * @see {@link InvokeAgentCommandInput} for command's `input` shape.
+ * @see {@link InvokeAgentCommandOutput} for command's `response` shape.
+ * @see {@link BedrockAgentRuntimeClientResolvedConfig | config} for BedrockAgentRuntimeClient's `config` shape.
+ *
+ * @throws {@link AccessDeniedException} (client fault)
+ * This exception is thrown when a request is denied per access permissions
+ *
+ * @throws {@link BadGatewayException} (server fault)
+ * This exception is thrown when a request fails due to dependency like Lambda, Bedrock, STS resource
+ *
+ * @throws {@link ConflictException} (client fault)
+ * This exception is thrown when there is a conflict performing an operation
+ *
+ * @throws {@link DependencyFailedException} (client fault)
+ * This exception is thrown when a request fails due to dependency like Lambda, Bedrock, STS resource due to a customer fault (i.e. bad configuration)
+ *
+ * @throws {@link InternalServerException} (server fault)
+ * This exception is thrown if there was an unexpected error during processing of request
+ *
+ * @throws {@link ResourceNotFoundException} (client fault)
+ * This exception is thrown when a resource referenced by the operation does not exist
+ *
+ * @throws {@link ServiceQuotaExceededException} (client fault)
+ * This exception is thrown when a request is made beyond the service quota
+ *
+ * @throws {@link ThrottlingException} (client fault)
+ * This exception is thrown when the number of requests exceeds the limit
+ *
+ * @throws {@link ValidationException} (client fault)
+ * This exception is thrown when the request's input validation fails
+ *
+ * @throws {@link BedrockAgentRuntimeServiceException}
+ * Base exception class for all service exceptions from BedrockAgentRuntime service.
+ *
+ */
+export class InvokeAgentCommand extends $Command<
+ InvokeAgentCommandInput,
+ InvokeAgentCommandOutput,
+ BedrockAgentRuntimeClientResolvedConfig
+> {
+ public static getEndpointParameterInstructions(): EndpointParameterInstructions {
+ return {
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
+ Endpoint: { type: "builtInParams", name: "endpoint" },
+ Region: { type: "builtInParams", name: "region" },
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
+ };
+ }
+
+ /**
+ * @public
+ */
+ constructor(readonly input: InvokeAgentCommandInput) {
+ super();
+ }
+
+ /**
+ * @internal
+ */
+ resolveMiddleware(
+ clientStack: MiddlewareStack,
+ configuration: BedrockAgentRuntimeClientResolvedConfig,
+ options?: __HttpHandlerOptions
+ ): Handler {
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
+ this.middlewareStack.use(getEndpointPlugin(configuration, InvokeAgentCommand.getEndpointParameterInstructions()));
+
+ const stack = clientStack.concat(this.middlewareStack);
+
+ const { logger } = configuration;
+ const clientName = "BedrockAgentRuntimeClient";
+ const commandName = "InvokeAgentCommand";
+ const handlerExecutionContext: HandlerExecutionContext = {
+ logger,
+ clientName,
+ commandName,
+ inputFilterSensitiveLog: InvokeAgentRequestFilterSensitiveLog,
+ outputFilterSensitiveLog: InvokeAgentResponseFilterSensitiveLog,
+ [SMITHY_CONTEXT_KEY]: {
+ service: "AmazonBedrockAgentRunTimeService",
+ operation: "InvokeAgent",
+ },
+ };
+ const { requestHandler } = configuration;
+ return stack.resolve(
+ (request: FinalizeHandlerArguments) =>
+ requestHandler.handle(request.request as __HttpRequest, options || {}),
+ handlerExecutionContext
+ );
+ }
+
+ /**
+ * @internal
+ */
+ private serialize(input: InvokeAgentCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
+ return se_InvokeAgentCommand(input, context);
+ }
+
+ /**
+ * @internal
+ */
+ private deserialize(
+ output: __HttpResponse,
+ context: __SerdeContext & __EventStreamSerdeContext
+ ): Promise {
+ return de_InvokeAgentCommand(output, context);
+ }
+}
diff --git a/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateCommand.ts
new file mode 100644
index 000000000000..bba32e5a5ef9
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateCommand.ts
@@ -0,0 +1,217 @@
+// smithy-typescript generated code
+import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
+import { getSerdePlugin } from "@smithy/middleware-serde";
+import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
+import { Command as $Command } from "@smithy/smithy-client";
+import {
+ FinalizeHandlerArguments,
+ Handler,
+ HandlerExecutionContext,
+ HttpHandlerOptions as __HttpHandlerOptions,
+ MetadataBearer as __MetadataBearer,
+ MiddlewareStack,
+ SerdeContext as __SerdeContext,
+ SMITHY_CONTEXT_KEY,
+} from "@smithy/types";
+
+import {
+ BedrockAgentRuntimeClientResolvedConfig,
+ ServiceInputTypes,
+ ServiceOutputTypes,
+} from "../BedrockAgentRuntimeClient";
+import {
+ RetrieveAndGenerateRequest,
+ RetrieveAndGenerateRequestFilterSensitiveLog,
+ RetrieveAndGenerateResponse,
+ RetrieveAndGenerateResponseFilterSensitiveLog,
+} from "../models/models_0";
+import { de_RetrieveAndGenerateCommand, se_RetrieveAndGenerateCommand } from "../protocols/Aws_restJson1";
+
+/**
+ * @public
+ */
+export { __MetadataBearer, $Command };
+/**
+ * @public
+ *
+ * The input for {@link RetrieveAndGenerateCommand}.
+ */
+export interface RetrieveAndGenerateCommandInput extends RetrieveAndGenerateRequest {}
+/**
+ * @public
+ *
+ * The output of {@link RetrieveAndGenerateCommand}.
+ */
+export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateResponse, __MetadataBearer {}
+
+/**
+ * @public
+ * RetrieveAndGenerate API
+ * @example
+ * Use a bare-bones client and the command you need to make an API call.
+ * ```javascript
+ * import { BedrockAgentRuntimeClient, RetrieveAndGenerateCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import
+ * // const { BedrockAgentRuntimeClient, RetrieveAndGenerateCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import
+ * const client = new BedrockAgentRuntimeClient(config);
+ * const input = { // RetrieveAndGenerateRequest
+ * sessionId: "STRING_VALUE",
+ * input: { // RetrieveAndGenerateInput
+ * text: "STRING_VALUE", // required
+ * },
+ * retrieveAndGenerateConfiguration: { // RetrieveAndGenerateConfiguration
+ * type: "KNOWLEDGE_BASE", // required
+ * knowledgeBaseConfiguration: { // KnowledgeBaseRetrieveAndGenerateConfiguration
+ * knowledgeBaseId: "STRING_VALUE", // required
+ * modelArn: "STRING_VALUE", // required
+ * },
+ * },
+ * sessionConfiguration: { // RetrieveAndGenerateSessionConfiguration
+ * kmsKeyArn: "STRING_VALUE", // required
+ * },
+ * };
+ * const command = new RetrieveAndGenerateCommand(input);
+ * const response = await client.send(command);
+ * // { // RetrieveAndGenerateResponse
+ * // sessionId: "STRING_VALUE", // required
+ * // output: { // RetrieveAndGenerateOutput
+ * // text: "STRING_VALUE", // required
+ * // },
+ * // citations: [ // Citations
+ * // { // Citation
+ * // generatedResponsePart: { // GeneratedResponsePart
+ * // textResponsePart: { // TextResponsePart
+ * // text: "STRING_VALUE",
+ * // span: { // Span
+ * // start: Number("int"),
+ * // end: Number("int"),
+ * // },
+ * // },
+ * // },
+ * // retrievedReferences: [ // RetrievedReferences
+ * // { // RetrievedReference
+ * // content: { // RetrievalResultContent
+ * // text: "STRING_VALUE", // required
+ * // },
+ * // location: { // RetrievalResultLocation
+ * // type: "S3", // required
+ * // s3Location: { // RetrievalResultS3Location
+ * // uri: "STRING_VALUE",
+ * // },
+ * // },
+ * // },
+ * // ],
+ * // },
+ * // ],
+ * // };
+ *
+ * ```
+ *
+ * @param RetrieveAndGenerateCommandInput - {@link RetrieveAndGenerateCommandInput}
+ * @returns {@link RetrieveAndGenerateCommandOutput}
+ * @see {@link RetrieveAndGenerateCommandInput} for command's `input` shape.
+ * @see {@link RetrieveAndGenerateCommandOutput} for command's `response` shape.
+ * @see {@link BedrockAgentRuntimeClientResolvedConfig | config} for BedrockAgentRuntimeClient's `config` shape.
+ *
+ * @throws {@link AccessDeniedException} (client fault)
+ * This exception is thrown when a request is denied per access permissions
+ *
+ * @throws {@link BadGatewayException} (server fault)
+ * This exception is thrown when a request fails due to dependency like Lambda, Bedrock, STS resource
+ *
+ * @throws {@link ConflictException} (client fault)
+ * This exception is thrown when there is a conflict performing an operation
+ *
+ * @throws {@link DependencyFailedException} (client fault)
+ * This exception is thrown when a request fails due to dependency like Lambda, Bedrock, STS resource due to a customer fault (i.e. bad configuration)
+ *
+ * @throws {@link InternalServerException} (server fault)
+ * This exception is thrown if there was an unexpected error during processing of request
+ *
+ * @throws {@link ResourceNotFoundException} (client fault)
+ * This exception is thrown when a resource referenced by the operation does not exist
+ *
+ * @throws {@link ServiceQuotaExceededException} (client fault)
+ * This exception is thrown when a request is made beyond the service quota
+ *
+ * @throws {@link ThrottlingException} (client fault)
+ * This exception is thrown when the number of requests exceeds the limit
+ *
+ * @throws {@link ValidationException} (client fault)
+ * This exception is thrown when the request's input validation fails
+ *
+ * @throws {@link BedrockAgentRuntimeServiceException}
+ * Base exception class for all service exceptions from BedrockAgentRuntime service.
+ *
+ */
+export class RetrieveAndGenerateCommand extends $Command<
+ RetrieveAndGenerateCommandInput,
+ RetrieveAndGenerateCommandOutput,
+ BedrockAgentRuntimeClientResolvedConfig
+> {
+ public static getEndpointParameterInstructions(): EndpointParameterInstructions {
+ return {
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
+ Endpoint: { type: "builtInParams", name: "endpoint" },
+ Region: { type: "builtInParams", name: "region" },
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
+ };
+ }
+
+ /**
+ * @public
+ */
+ constructor(readonly input: RetrieveAndGenerateCommandInput) {
+ super();
+ }
+
+ /**
+ * @internal
+ */
+ resolveMiddleware(
+ clientStack: MiddlewareStack,
+ configuration: BedrockAgentRuntimeClientResolvedConfig,
+ options?: __HttpHandlerOptions
+ ): Handler {
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
+ this.middlewareStack.use(
+ getEndpointPlugin(configuration, RetrieveAndGenerateCommand.getEndpointParameterInstructions())
+ );
+
+ const stack = clientStack.concat(this.middlewareStack);
+
+ const { logger } = configuration;
+ const clientName = "BedrockAgentRuntimeClient";
+ const commandName = "RetrieveAndGenerateCommand";
+ const handlerExecutionContext: HandlerExecutionContext = {
+ logger,
+ clientName,
+ commandName,
+ inputFilterSensitiveLog: RetrieveAndGenerateRequestFilterSensitiveLog,
+ outputFilterSensitiveLog: RetrieveAndGenerateResponseFilterSensitiveLog,
+ [SMITHY_CONTEXT_KEY]: {
+ service: "AmazonBedrockAgentRunTimeService",
+ operation: "RetrieveAndGenerate",
+ },
+ };
+ const { requestHandler } = configuration;
+ return stack.resolve(
+ (request: FinalizeHandlerArguments) =>
+ requestHandler.handle(request.request as __HttpRequest, options || {}),
+ handlerExecutionContext
+ );
+ }
+
+ /**
+ * @internal
+ */
+ private serialize(input: RetrieveAndGenerateCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
+ return se_RetrieveAndGenerateCommand(input, context);
+ }
+
+ /**
+ * @internal
+ */
+ private deserialize(output: __HttpResponse, context: __SerdeContext): Promise {
+ return de_RetrieveAndGenerateCommand(output, context);
+ }
+}
diff --git a/clients/client-bedrock-agent-runtime/src/commands/RetrieveCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/RetrieveCommand.ts
new file mode 100644
index 000000000000..ae06c2388d8e
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/commands/RetrieveCommand.ts
@@ -0,0 +1,196 @@
+// smithy-typescript generated code
+import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
+import { getSerdePlugin } from "@smithy/middleware-serde";
+import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
+import { Command as $Command } from "@smithy/smithy-client";
+import {
+ FinalizeHandlerArguments,
+ Handler,
+ HandlerExecutionContext,
+ HttpHandlerOptions as __HttpHandlerOptions,
+ MetadataBearer as __MetadataBearer,
+ MiddlewareStack,
+ SerdeContext as __SerdeContext,
+ SMITHY_CONTEXT_KEY,
+} from "@smithy/types";
+
+import {
+ BedrockAgentRuntimeClientResolvedConfig,
+ ServiceInputTypes,
+ ServiceOutputTypes,
+} from "../BedrockAgentRuntimeClient";
+import {
+ RetrieveRequest,
+ RetrieveRequestFilterSensitiveLog,
+ RetrieveResponse,
+ RetrieveResponseFilterSensitiveLog,
+} from "../models/models_0";
+import { de_RetrieveCommand, se_RetrieveCommand } from "../protocols/Aws_restJson1";
+
+/**
+ * @public
+ */
+export { __MetadataBearer, $Command };
+/**
+ * @public
+ *
+ * The input for {@link RetrieveCommand}.
+ */
+export interface RetrieveCommandInput extends RetrieveRequest {}
+/**
+ * @public
+ *
+ * The output of {@link RetrieveCommand}.
+ */
+export interface RetrieveCommandOutput extends RetrieveResponse, __MetadataBearer {}
+
+/**
+ * @public
+ * Retrieve from knowledge base.
+ * @example
+ * Use a bare-bones client and the command you need to make an API call.
+ * ```javascript
+ * import { BedrockAgentRuntimeClient, RetrieveCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import
+ * // const { BedrockAgentRuntimeClient, RetrieveCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import
+ * const client = new BedrockAgentRuntimeClient(config);
+ * const input = { // RetrieveRequest
+ * knowledgeBaseId: "STRING_VALUE", // required
+ * retrievalQuery: { // KnowledgeBaseQuery
+ * text: "STRING_VALUE", // required
+ * },
+ * retrievalConfiguration: { // KnowledgeBaseRetrievalConfiguration
+ * vectorSearchConfiguration: { // KnowledgeBaseVectorSearchConfiguration
+ * numberOfResults: Number("int"), // required
+ * },
+ * },
+ * nextToken: "STRING_VALUE",
+ * };
+ * const command = new RetrieveCommand(input);
+ * const response = await client.send(command);
+ * // { // RetrieveResponse
+ * // retrievalResults: [ // KnowledgeBaseRetrievalResults // required
+ * // { // KnowledgeBaseRetrievalResult
+ * // content: { // RetrievalResultContent
+ * // text: "STRING_VALUE", // required
+ * // },
+ * // location: { // RetrievalResultLocation
+ * // type: "S3", // required
+ * // s3Location: { // RetrievalResultS3Location
+ * // uri: "STRING_VALUE",
+ * // },
+ * // },
+ * // score: Number("double"),
+ * // },
+ * // ],
+ * // nextToken: "STRING_VALUE",
+ * // };
+ *
+ * ```
+ *
+ * @param RetrieveCommandInput - {@link RetrieveCommandInput}
+ * @returns {@link RetrieveCommandOutput}
+ * @see {@link RetrieveCommandInput} for command's `input` shape.
+ * @see {@link RetrieveCommandOutput} for command's `response` shape.
+ * @see {@link BedrockAgentRuntimeClientResolvedConfig | config} for BedrockAgentRuntimeClient's `config` shape.
+ *
+ * @throws {@link AccessDeniedException} (client fault)
+ * This exception is thrown when a request is denied per access permissions
+ *
+ * @throws {@link BadGatewayException} (server fault)
+ * This exception is thrown when a request fails due to dependency like Lambda, Bedrock, STS resource
+ *
+ * @throws {@link ConflictException} (client fault)
+ * This exception is thrown when there is a conflict performing an operation
+ *
+ * @throws {@link DependencyFailedException} (client fault)
+ * This exception is thrown when a request fails due to dependency like Lambda, Bedrock, STS resource due to a customer fault (i.e. bad configuration)
+ *
+ * @throws {@link InternalServerException} (server fault)
+ * This exception is thrown if there was an unexpected error during processing of request
+ *
+ * @throws {@link ResourceNotFoundException} (client fault)
+ * This exception is thrown when a resource referenced by the operation does not exist
+ *
+ * @throws {@link ServiceQuotaExceededException} (client fault)
+ * This exception is thrown when a request is made beyond the service quota
+ *
+ * @throws {@link ThrottlingException} (client fault)
+ * This exception is thrown when the number of requests exceeds the limit
+ *
+ * @throws {@link ValidationException} (client fault)
+ * This exception is thrown when the request's input validation fails
+ *
+ * @throws {@link BedrockAgentRuntimeServiceException}
+ * Base exception class for all service exceptions from BedrockAgentRuntime service.
+ *
+ */
+export class RetrieveCommand extends $Command<
+ RetrieveCommandInput,
+ RetrieveCommandOutput,
+ BedrockAgentRuntimeClientResolvedConfig
+> {
+ public static getEndpointParameterInstructions(): EndpointParameterInstructions {
+ return {
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
+ Endpoint: { type: "builtInParams", name: "endpoint" },
+ Region: { type: "builtInParams", name: "region" },
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
+ };
+ }
+
+ /**
+ * @public
+ */
+ constructor(readonly input: RetrieveCommandInput) {
+ super();
+ }
+
+ /**
+ * @internal
+ */
+ resolveMiddleware(
+ clientStack: MiddlewareStack,
+ configuration: BedrockAgentRuntimeClientResolvedConfig,
+ options?: __HttpHandlerOptions
+ ): Handler {
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
+ this.middlewareStack.use(getEndpointPlugin(configuration, RetrieveCommand.getEndpointParameterInstructions()));
+
+ const stack = clientStack.concat(this.middlewareStack);
+
+ const { logger } = configuration;
+ const clientName = "BedrockAgentRuntimeClient";
+ const commandName = "RetrieveCommand";
+ const handlerExecutionContext: HandlerExecutionContext = {
+ logger,
+ clientName,
+ commandName,
+ inputFilterSensitiveLog: RetrieveRequestFilterSensitiveLog,
+ outputFilterSensitiveLog: RetrieveResponseFilterSensitiveLog,
+ [SMITHY_CONTEXT_KEY]: {
+ service: "AmazonBedrockAgentRunTimeService",
+ operation: "Retrieve",
+ },
+ };
+ const { requestHandler } = configuration;
+ return stack.resolve(
+ (request: FinalizeHandlerArguments) =>
+ requestHandler.handle(request.request as __HttpRequest, options || {}),
+ handlerExecutionContext
+ );
+ }
+
+ /**
+ * @internal
+ */
+ private serialize(input: RetrieveCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
+ return se_RetrieveCommand(input, context);
+ }
+
+ /**
+ * @internal
+ */
+ private deserialize(output: __HttpResponse, context: __SerdeContext): Promise {
+ return de_RetrieveCommand(output, context);
+ }
+}
diff --git a/clients/client-bedrock-agent-runtime/src/commands/index.ts b/clients/client-bedrock-agent-runtime/src/commands/index.ts
new file mode 100644
index 000000000000..63aba081cf07
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/commands/index.ts
@@ -0,0 +1,4 @@
+// smithy-typescript generated code
+export * from "./InvokeAgentCommand";
+export * from "./RetrieveAndGenerateCommand";
+export * from "./RetrieveCommand";
diff --git a/clients/client-bedrock-agent-runtime/src/endpoint/EndpointParameters.ts b/clients/client-bedrock-agent-runtime/src/endpoint/EndpointParameters.ts
new file mode 100644
index 000000000000..5f8d2e564e42
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/endpoint/EndpointParameters.ts
@@ -0,0 +1,34 @@
+// smithy-typescript generated code
+import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@smithy/types";
+
+/**
+ * @public
+ */
+export interface ClientInputEndpointParameters {
+ region?: string | Provider;
+ useDualstackEndpoint?: boolean | Provider;
+ useFipsEndpoint?: boolean | Provider;
+ endpoint?: string | Provider | Endpoint | Provider | EndpointV2 | Provider;
+}
+
+export type ClientResolvedEndpointParameters = ClientInputEndpointParameters & {
+ defaultSigningName: string;
+};
+
+export const resolveClientEndpointParameters = (
+ options: T & ClientInputEndpointParameters
+): T & ClientResolvedEndpointParameters => {
+ return {
+ ...options,
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
+ defaultSigningName: "bedrock",
+ };
+};
+
+export interface EndpointParameters extends __EndpointParameters {
+ Region?: string;
+ UseDualStack?: boolean;
+ UseFIPS?: boolean;
+ Endpoint?: string;
+}
diff --git a/clients/client-bedrock-agent-runtime/src/endpoint/endpointResolver.ts b/clients/client-bedrock-agent-runtime/src/endpoint/endpointResolver.ts
new file mode 100644
index 000000000000..5a2f95973187
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/endpoint/endpointResolver.ts
@@ -0,0 +1,16 @@
+// smithy-typescript generated code
+import { EndpointV2, Logger } from "@smithy/types";
+import { EndpointParams, resolveEndpoint } from "@smithy/util-endpoints";
+
+import { EndpointParameters } from "./EndpointParameters";
+import { ruleSet } from "./ruleset";
+
+export const defaultEndpointResolver = (
+ endpointParams: EndpointParameters,
+ context: { logger?: Logger } = {}
+): EndpointV2 => {
+ return resolveEndpoint(ruleSet, {
+ endpointParams: endpointParams as EndpointParams,
+ logger: context.logger,
+ });
+};
diff --git a/clients/client-bedrock-agent-runtime/src/endpoint/ruleset.ts b/clients/client-bedrock-agent-runtime/src/endpoint/ruleset.ts
new file mode 100644
index 000000000000..3cb2646d05da
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/endpoint/ruleset.ts
@@ -0,0 +1,32 @@
+// @ts-nocheck
+// generated code, do not edit
+import { RuleSetObject } from "@smithy/types";
+
+/* This file is compressed. Log this object
+ or see "smithy.rules#endpointRuleSet"
+ in codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json */
+
+const s="required",
+t="fn",
+u="argv",
+v="ref";
+const a=true,
+b="isSet",
+c="booleanEquals",
+d="error",
+e="endpoint",
+f="tree",
+g="PartitionResult",
+h={[s]:false,"type":"String"},
+i={[s]:true,"default":false,"type":"Boolean"},
+j={[v]:"Endpoint"},
+k={[t]:c,[u]:[{[v]:"UseFIPS"},true]},
+l={[t]:c,[u]:[{[v]:"UseDualStack"},true]},
+m={},
+n={[t]:"getAttr",[u]:[{[v]:g},"supportsFIPS"]},
+o={[t]:c,[u]:[true,{[t]:"getAttr",[u]:[{[v]:g},"supportsDualStack"]}]},
+p=[k],
+q=[l],
+r=[{[v]:"Region"}];
+const _data={version:"1.0",parameters:{Region:h,UseDualStack:i,UseFIPS:i,Endpoint:h},rules:[{conditions:[{[t]:b,[u]:[j]}],rules:[{conditions:p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:d},{rules:[{conditions:q,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:d},{endpoint:{url:j,properties:m,headers:m},type:e}],type:f}],type:f},{rules:[{conditions:[{[t]:b,[u]:r}],rules:[{conditions:[{[t]:"aws.partition",[u]:r,assign:g}],rules:[{conditions:[k,l],rules:[{conditions:[{[t]:c,[u]:[a,n]},o],rules:[{rules:[{endpoint:{url:"https://bedrock-agent-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:d}],type:f},{conditions:p,rules:[{conditions:[{[t]:c,[u]:[n,a]}],rules:[{rules:[{endpoint:{url:"https://bedrock-agent-runtime-fips.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f},{error:"FIPS is enabled but this partition does not support FIPS",type:d}],type:f},{conditions:q,rules:[{conditions:[o],rules:[{rules:[{endpoint:{url:"https://bedrock-agent-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f},{error:"DualStack is enabled but this partition does not support DualStack",type:d}],type:f},{rules:[{endpoint:{url:"https://bedrock-agent-runtime.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f}],type:f},{error:"Invalid Configuration: Missing Region",type:d}],type:f}]};
+export const ruleSet: RuleSetObject = _data;
diff --git a/clients/client-bedrock-agent-runtime/src/extensionConfiguration.ts b/clients/client-bedrock-agent-runtime/src/extensionConfiguration.ts
new file mode 100644
index 000000000000..08e8324703a4
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/extensionConfiguration.ts
@@ -0,0 +1,12 @@
+// smithy-typescript generated code
+import { AwsRegionExtensionConfiguration } from "@aws-sdk/types";
+import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http";
+import { DefaultExtensionConfiguration } from "@smithy/types";
+
+/**
+ * @internal
+ */
+export interface BedrockAgentRuntimeExtensionConfiguration
+ extends HttpHandlerExtensionConfiguration,
+ DefaultExtensionConfiguration,
+ AwsRegionExtensionConfiguration {}
diff --git a/clients/client-bedrock-agent-runtime/src/index.ts b/clients/client-bedrock-agent-runtime/src/index.ts
new file mode 100644
index 000000000000..a8dc9da688a8
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/index.ts
@@ -0,0 +1,19 @@
+// smithy-typescript generated code
+/* eslint-disable */
+/**
+ * Amazon Bedrock Agent
+ *
+ * @packageDocumentation
+ */
+export * from "./BedrockAgentRuntimeClient";
+export * from "./BedrockAgentRuntime";
+export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters";
+export { RuntimeExtension } from "./runtimeExtensions";
+export { BedrockAgentRuntimeExtensionConfiguration } from "./extensionConfiguration";
+export * from "./commands";
+export * from "./pagination";
+export * from "./models";
+
+import "@aws-sdk/util-endpoints";
+
+export { BedrockAgentRuntimeServiceException } from "./models/BedrockAgentRuntimeServiceException";
diff --git a/clients/client-bedrock-agent-runtime/src/models/BedrockAgentRuntimeServiceException.ts b/clients/client-bedrock-agent-runtime/src/models/BedrockAgentRuntimeServiceException.ts
new file mode 100644
index 000000000000..064f152d36dd
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/models/BedrockAgentRuntimeServiceException.ts
@@ -0,0 +1,22 @@
+// smithy-typescript generated code
+import {
+ ServiceException as __ServiceException,
+ ServiceExceptionOptions as __ServiceExceptionOptions,
+} from "@smithy/smithy-client";
+
+export { __ServiceException, __ServiceExceptionOptions };
+
+/**
+ * @public
+ *
+ * Base exception class for all service exceptions from BedrockAgentRuntime service.
+ */
+export class BedrockAgentRuntimeServiceException extends __ServiceException {
+ /**
+ * @internal
+ */
+ constructor(options: __ServiceExceptionOptions) {
+ super(options);
+ Object.setPrototypeOf(this, BedrockAgentRuntimeServiceException.prototype);
+ }
+}
diff --git a/clients/client-bedrock-agent-runtime/src/models/index.ts b/clients/client-bedrock-agent-runtime/src/models/index.ts
new file mode 100644
index 000000000000..9eaceb12865f
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/models/index.ts
@@ -0,0 +1,2 @@
+// smithy-typescript generated code
+export * from "./models_0";
diff --git a/clients/client-bedrock-agent-runtime/src/models/models_0.ts b/clients/client-bedrock-agent-runtime/src/models/models_0.ts
new file mode 100644
index 000000000000..8231e82c68ae
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/models/models_0.ts
@@ -0,0 +1,2056 @@
+// smithy-typescript generated code
+import { ExceptionOptionType as __ExceptionOptionType, SENSITIVE_STRING } from "@smithy/smithy-client";
+
+import { BedrockAgentRuntimeServiceException as __BaseException } from "./BedrockAgentRuntimeServiceException";
+
+/**
+ * @public
+ * This exception is thrown when a request is denied per access permissions
+ */
+export class AccessDeniedException extends __BaseException {
+ readonly name: "AccessDeniedException" = "AccessDeniedException";
+ readonly $fault: "client" = "client";
+ /**
+ * @internal
+ */
+ constructor(opts: __ExceptionOptionType) {
+ super({
+ name: "AccessDeniedException",
+ $fault: "client",
+ ...opts,
+ });
+ Object.setPrototypeOf(this, AccessDeniedException.prototype);
+ }
+}
+
+/**
+ * @public
+ * parameters included in action group invocation
+ */
+export interface Parameter {
+ /**
+ * @public
+ * Name of parameter
+ */
+ name?: string;
+
+ /**
+ * @public
+ * Type of parameter
+ */
+ type?: string;
+
+ /**
+ * @public
+ * Value of parameter
+ */
+ value?: string;
+}
+
+/**
+ * @public
+ * Request Body Content Map
+ */
+export interface RequestBody {
+ /**
+ * @public
+ * Content type paramter map
+ */
+ content?: Record;
+}
+
+/**
+ * @public
+ * input to lambda used in action group
+ */
+export interface ActionGroupInvocationInput {
+ /**
+ * @public
+ * Agent Trace Action Group Name
+ */
+ actionGroupName?: string;
+
+ /**
+ * @public
+ * Agent Trace Action Group Action verb
+ */
+ verb?: string;
+
+ /**
+ * @public
+ * Agent Trace Action Group API path
+ */
+ apiPath?: string;
+
+ /**
+ * @public
+ * list of parameters included in action group invocation
+ */
+ parameters?: Parameter[];
+
+ /**
+ * @public
+ * Request Body Content Map
+ */
+ requestBody?: RequestBody;
+}
+
+/**
+ * @public
+ * output from lambda used in action group
+ */
+export interface ActionGroupInvocationOutput {
+ /**
+ * @public
+ * Agent Trace Action Group Lambda Invocation Output String
+ */
+ text?: string;
+}
+
+/**
+ * @public
+ * This exception is thrown when a request fails due to dependency like Lambda, Bedrock, STS resource
+ */
+export class BadGatewayException extends __BaseException {
+ readonly name: "BadGatewayException" = "BadGatewayException";
+ readonly $fault: "server" = "server";
+ /**
+ * @public
+ * Non Blank String
+ */
+ resourceName?: string;
+
+ /**
+ * @internal
+ */
+ constructor(opts: __ExceptionOptionType) {
+ super({
+ name: "BadGatewayException",
+ $fault: "server",
+ ...opts,
+ });
+ Object.setPrototypeOf(this, BadGatewayException.prototype);
+ this.resourceName = opts.resourceName;
+ }
+}
+
+/**
+ * @public
+ * This exception is thrown when there is a conflict performing an operation
+ */
+export class ConflictException extends __BaseException {
+ readonly name: "ConflictException" = "ConflictException";
+ readonly $fault: "client" = "client";
+ /**
+ * @internal
+ */
+ constructor(opts: __ExceptionOptionType) {
+ super({
+ name: "ConflictException",
+ $fault: "client",
+ ...opts,
+ });
+ Object.setPrototypeOf(this, ConflictException.prototype);
+ }
+}
+
+/**
+ * @public
+ * This exception is thrown when a request fails due to dependency like Lambda, Bedrock, STS resource due to a customer fault (i.e. bad configuration)
+ */
+export class DependencyFailedException extends __BaseException {
+ readonly name: "DependencyFailedException" = "DependencyFailedException";
+ readonly $fault: "client" = "client";
+ /**
+ * @public
+ * Non Blank String
+ */
+ resourceName?: string;
+
+ /**
+ * @internal
+ */
+ constructor(opts: __ExceptionOptionType) {
+ super({
+ name: "DependencyFailedException",
+ $fault: "client",
+ ...opts,
+ });
+ Object.setPrototypeOf(this, DependencyFailedException.prototype);
+ this.resourceName = opts.resourceName;
+ }
+}
+
+/**
+ * @public
+ * This exception is thrown if there was an unexpected error during processing of request
+ */
+export class InternalServerException extends __BaseException {
+ readonly name: "InternalServerException" = "InternalServerException";
+ readonly $fault: "server" = "server";
+ /**
+ * @internal
+ */
+ constructor(opts: __ExceptionOptionType) {
+ super({
+ name: "InternalServerException",
+ $fault: "server",
+ ...opts,
+ });
+ Object.setPrototypeOf(this, InternalServerException.prototype);
+ }
+}
+
+/**
+ * @public
+ * Session state provided
+ */
+export interface SessionState {
+ /**
+ * @public
+ * Session Attributes
+ */
+ sessionAttributes?: Record;
+
+ /**
+ * @public
+ * Prompt Session Attributes
+ */
+ promptSessionAttributes?: Record;
+}
+
+/**
+ * @public
+ * InvokeAgent Request
+ */
+export interface InvokeAgentRequest {
+ /**
+ * @public
+ * Session state passed by customer. Base64 encoded json string representation of SessionState.
+ */
+ sessionState?: SessionState;
+
+ /**
+ * @public
+ * Identifier for Agent
+ */
+ agentId: string | undefined;
+
+ /**
+ * @public
+ * Identifier for Agent Alias
+ */
+ agentAliasId: string | undefined;
+
+ /**
+ * @public
+ * Identifier used for the current session
+ */
+ sessionId: string | undefined;
+
+ /**
+ * @public
+ * End current session
+ */
+ endSession?: boolean;
+
+ /**
+ * @public
+ * Enable agent trace events for improved debugging
+ */
+ enableTrace?: boolean;
+
+ /**
+ * @public
+ * Input data in the format specified in the Content-Type request header.
+ */
+ inputText: string | undefined;
+}
+
+/**
+ * @public
+ * Span of text
+ */
+export interface Span {
+ /**
+ * @public
+ * Start of span
+ */
+ start?: number;
+
+ /**
+ * @public
+ * End of span
+ */
+ end?: number;
+}
+
+/**
+ * @public
+ * Text response part
+ */
+export interface TextResponsePart {
+ /**
+ * @public
+ * Response part in text
+ */
+ text?: string;
+
+ /**
+ * @public
+ * Span of text
+ */
+ span?: Span;
+}
+
+/**
+ * @public
+ * Generate response part
+ */
+export interface GeneratedResponsePart {
+ /**
+ * @public
+ * Text response part
+ */
+ textResponsePart?: TextResponsePart;
+}
+
+/**
+ * @public
+ * Content of a retrieval result.
+ */
+export interface RetrievalResultContent {
+ /**
+ * @public
+ * Content of a retrieval result in text
+ */
+ text: string | undefined;
+}
+
+/**
+ * @public
+ * The S3 location of a retrieval result.
+ */
+export interface RetrievalResultS3Location {
+ /**
+ * @public
+ * URI of S3 location
+ */
+ uri?: string;
+}
+
+/**
+ * @public
+ * @enum
+ */
+export const RetrievalResultLocationType = {
+ S3: "S3",
+} as const;
+
+/**
+ * @public
+ */
+export type RetrievalResultLocationType =
+ (typeof RetrievalResultLocationType)[keyof typeof RetrievalResultLocationType];
+
+/**
+ * @public
+ * The source location of a retrieval result.
+ */
+export interface RetrievalResultLocation {
+ /**
+ * @public
+ * The location type of a retrieval result.
+ */
+ type: RetrievalResultLocationType | undefined;
+
+ /**
+ * @public
+ * The S3 location of a retrieval result.
+ */
+ s3Location?: RetrievalResultS3Location;
+}
+
+/**
+ * @public
+ * Retrieved reference
+ */
+export interface RetrievedReference {
+ /**
+ * @public
+ * Content of a retrieval result.
+ */
+ content?: RetrievalResultContent;
+
+ /**
+ * @public
+ * The source location of a retrieval result.
+ */
+ location?: RetrievalResultLocation;
+}
+
+/**
+ * @public
+ * Citation associated with the agent response
+ */
+export interface Citation {
+ /**
+ * @public
+ * Generate response part
+ */
+ generatedResponsePart?: GeneratedResponsePart;
+
+ /**
+ * @public
+ * list of retrieved references
+ */
+ retrievedReferences?: RetrievedReference[];
+}
+
+/**
+ * @public
+ * Citations associated with final agent response
+ */
+export interface Attribution {
+ /**
+ * @public
+ * List of citations
+ */
+ citations?: Citation[];
+}
+
+/**
+ * @public
+ * Base 64 endoded byte response
+ */
+export interface PayloadPart {
+ /**
+ * @public
+ * PartBody of the payload in bytes
+ */
+ bytes?: Uint8Array;
+
+ /**
+ * @public
+ * Citations associated with final agent response
+ */
+ attribution?: Attribution;
+}
+
+/**
+ * @public
+ * This exception is thrown when a resource referenced by the operation does not exist
+ */
+export class ResourceNotFoundException extends __BaseException {
+ readonly name: "ResourceNotFoundException" = "ResourceNotFoundException";
+ readonly $fault: "client" = "client";
+ /**
+ * @internal
+ */
+ constructor(opts: __ExceptionOptionType) {
+ super({
+ name: "ResourceNotFoundException",
+ $fault: "client",
+ ...opts,
+ });
+ Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
+ }
+}
+
+/**
+ * @public
+ * This exception is thrown when a request is made beyond the service quota
+ */
+export class ServiceQuotaExceededException extends __BaseException {
+ readonly name: "ServiceQuotaExceededException" = "ServiceQuotaExceededException";
+ readonly $fault: "client" = "client";
+ /**
+ * @internal
+ */
+ constructor(opts: __ExceptionOptionType) {
+ super({
+ name: "ServiceQuotaExceededException",
+ $fault: "client",
+ ...opts,
+ });
+ Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype);
+ }
+}
+
+/**
+ * @public
+ * This exception is thrown when the number of requests exceeds the limit
+ */
+export class ThrottlingException extends __BaseException {
+ readonly name: "ThrottlingException" = "ThrottlingException";
+ readonly $fault: "client" = "client";
+ /**
+ * @internal
+ */
+ constructor(opts: __ExceptionOptionType) {
+ super({
+ name: "ThrottlingException",
+ $fault: "client",
+ ...opts,
+ });
+ Object.setPrototypeOf(this, ThrottlingException.prototype);
+ }
+}
+
+/**
+ * @public
+ * Trace Part which is emitted when agent trace could not be generated
+ */
+export interface FailureTrace {
+ /**
+ * @public
+ * Identifier for trace
+ */
+ traceId?: string;
+
+ /**
+ * @public
+ * Agent Trace Failed Reason String
+ */
+ failureReason?: string;
+}
+
+/**
+ * @public
+ * @enum
+ */
+export const InvocationType = {
+ ACTION_GROUP: "ACTION_GROUP",
+ FINISH: "FINISH",
+ KNOWLEDGE_BASE: "KNOWLEDGE_BASE",
+} as const;
+
+/**
+ * @public
+ */
+export type InvocationType = (typeof InvocationType)[keyof typeof InvocationType];
+
+/**
+ * @public
+ * Input to lambda used in action group
+ */
+export interface KnowledgeBaseLookupInput {
+ /**
+ * @public
+ * Agent Trace Action Group Lambda Invocation Output String
+ */
+ text?: string;
+
+ /**
+ * @public
+ * Agent Trace Action Group Knowledge Base Id
+ */
+ knowledgeBaseId?: string;
+}
+
+/**
+ * @public
+ * Trace Part which contains input details for action group or knowledge base
+ */
+export interface InvocationInput {
+ /**
+ * @public
+ * Identifier for trace
+ */
+ traceId?: string;
+
+ /**
+ * @public
+ * types of invocations
+ */
+ invocationType?: InvocationType;
+
+ /**
+ * @public
+ * input to lambda used in action group
+ */
+ actionGroupInvocationInput?: ActionGroupInvocationInput;
+
+ /**
+ * @public
+ * Input to lambda used in action group
+ */
+ knowledgeBaseLookupInput?: KnowledgeBaseLookupInput;
+}
+
+/**
+ * @public
+ * Configurations for controlling the inference response of an InvokeAgent API call
+ */
+export interface InferenceConfiguration {
+ /**
+ * @public
+ * Controls randomness, higher values increase diversity
+ */
+ temperature?: number;
+
+ /**
+ * @public
+ * Cumulative probability cutoff for token selection
+ */
+ topP?: number;
+
+ /**
+ * @public
+ * Sample from the k most likely next tokens
+ */
+ topK?: number;
+
+ /**
+ * @public
+ * Maximum length of output
+ */
+ maximumLength?: number;
+
+ /**
+ * @public
+ * List of stop sequences
+ */
+ stopSequences?: string[];
+}
+
+/**
+ * @public
+ * @enum
+ */
+export const CreationMode = {
+ DEFAULT: "DEFAULT",
+ OVERRIDDEN: "OVERRIDDEN",
+} as const;
+
+/**
+ * @public
+ */
+export type CreationMode = (typeof CreationMode)[keyof typeof CreationMode];
+
+/**
+ * @public
+ * @enum
+ */
+export const PromptType = {
+ KNOWLEDGE_BASE_RESPONSE_GENERATION: "KNOWLEDGE_BASE_RESPONSE_GENERATION",
+ ORCHESTRATION: "ORCHESTRATION",
+ POST_PROCESSING: "POST_PROCESSING",
+ PRE_PROCESSING: "PRE_PROCESSING",
+} as const;
+
+/**
+ * @public
+ */
+export type PromptType = (typeof PromptType)[keyof typeof PromptType];
+
+/**
+ * @public
+ * Trace Part which contains information used to call Invoke Model
+ */
+export interface ModelInvocationInput {
+ /**
+ * @public
+ * Identifier for trace
+ */
+ traceId?: string;
+
+ /**
+ * @public
+ * Prompt Message
+ */
+ text?: string;
+
+ /**
+ * @public
+ * types of prompts
+ */
+ type?: PromptType;
+
+ /**
+ * @public
+ * Configurations for controlling the inference response of an InvokeAgent API call
+ */
+ inferenceConfiguration?: InferenceConfiguration;
+
+ /**
+ * @public
+ * ARN of a Lambda.
+ */
+ overrideLambda?: string;
+
+ /**
+ * @public
+ * indicates if agent uses default prompt or overriden prompt
+ */
+ promptCreationMode?: CreationMode;
+
+ /**
+ * @public
+ * indicates if agent uses default prompt or overriden prompt
+ */
+ parserMode?: CreationMode;
+}
+
+/**
+ * @public
+ * Agent finish output
+ */
+export interface FinalResponse {
+ /**
+ * @public
+ * Agent Trace Action Group Lambda Invocation Output String
+ */
+ text?: string;
+}
+
+/**
+ * @public
+ * Input to lambda used in action group
+ */
+export interface KnowledgeBaseLookupOutput {
+ /**
+ * @public
+ * list of retrieved references
+ */
+ retrievedReferences?: RetrievedReference[];
+}
+
+/**
+ * @public
+ * @enum
+ */
+export const Source = {
+ ACTION_GROUP: "ACTION_GROUP",
+ KNOWLEDGE_BASE: "KNOWLEDGE_BASE",
+ PARSER: "PARSER",
+} as const;
+
+/**
+ * @public
+ */
+export type Source = (typeof Source)[keyof typeof Source];
+
+/**
+ * @public
+ * Observation information if there were reprompts
+ */
+export interface RepromptResponse {
+ /**
+ * @public
+ * Reprompt response text
+ */
+ text?: string;
+
+ /**
+ * @public
+ * Parsing error source
+ */
+ source?: Source;
+}
+
+/**
+ * @public
+ * @enum
+ */
+export const Type = {
+ ACTION_GROUP: "ACTION_GROUP",
+ ASK_USER: "ASK_USER",
+ FINISH: "FINISH",
+ KNOWLEDGE_BASE: "KNOWLEDGE_BASE",
+ REPROMPT: "REPROMPT",
+} as const;
+
+/**
+ * @public
+ */
+export type Type = (typeof Type)[keyof typeof Type];
+
+/**
+ * @public
+ * Trace Part which contains output details for action group or knowledge base or final response
+ */
+export interface Observation {
+ /**
+ * @public
+ * Identifier for trace
+ */
+ traceId?: string;
+
+ /**
+ * @public
+ * types of observations
+ */
+ type?: Type;
+
+ /**
+ * @public
+ * output from lambda used in action group
+ */
+ actionGroupInvocationOutput?: ActionGroupInvocationOutput;
+
+ /**
+ * @public
+ * Input to lambda used in action group
+ */
+ knowledgeBaseLookupOutput?: KnowledgeBaseLookupOutput;
+
+ /**
+ * @public
+ * Agent finish output
+ */
+ finalResponse?: FinalResponse;
+
+ /**
+ * @public
+ * Observation information if there were reprompts
+ */
+ repromptResponse?: RepromptResponse;
+}
+
+/**
+ * @public
+ * Trace Part which contains information related to reasoning
+ */
+export interface Rationale {
+ /**
+ * @public
+ * Identifier for trace
+ */
+ traceId?: string;
+
+ /**
+ * @public
+ * Agent Trace Rationale String
+ */
+ text?: string;
+}
+
+/**
+ * @public
+ * Trace contains intermidate response during orchestration
+ */
+export type OrchestrationTrace =
+ | OrchestrationTrace.InvocationInputMember
+ | OrchestrationTrace.ModelInvocationInputMember
+ | OrchestrationTrace.ObservationMember
+ | OrchestrationTrace.RationaleMember
+ | OrchestrationTrace.$UnknownMember;
+
+/**
+ * @public
+ */
+export namespace OrchestrationTrace {
+ /**
+ * @public
+ * Trace Part which contains information related to reasoning
+ */
+ export interface RationaleMember {
+ rationale: Rationale;
+ invocationInput?: never;
+ observation?: never;
+ modelInvocationInput?: never;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ * Trace Part which contains input details for action group or knowledge base
+ */
+ export interface InvocationInputMember {
+ rationale?: never;
+ invocationInput: InvocationInput;
+ observation?: never;
+ modelInvocationInput?: never;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ * Trace Part which contains output details for action group or knowledge base or final response
+ */
+ export interface ObservationMember {
+ rationale?: never;
+ invocationInput?: never;
+ observation: Observation;
+ modelInvocationInput?: never;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ * Trace Part which contains information used to call Invoke Model
+ */
+ export interface ModelInvocationInputMember {
+ rationale?: never;
+ invocationInput?: never;
+ observation?: never;
+ modelInvocationInput: ModelInvocationInput;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ */
+ export interface $UnknownMember {
+ rationale?: never;
+ invocationInput?: never;
+ observation?: never;
+ modelInvocationInput?: never;
+ $unknown: [string, any];
+ }
+
+ export interface Visitor {
+ rationale: (value: Rationale) => T;
+ invocationInput: (value: InvocationInput) => T;
+ observation: (value: Observation) => T;
+ modelInvocationInput: (value: ModelInvocationInput) => T;
+ _: (name: string, value: any) => T;
+ }
+
+ export const visit = (value: OrchestrationTrace, visitor: Visitor): T => {
+ if (value.rationale !== undefined) return visitor.rationale(value.rationale);
+ if (value.invocationInput !== undefined) return visitor.invocationInput(value.invocationInput);
+ if (value.observation !== undefined) return visitor.observation(value.observation);
+ if (value.modelInvocationInput !== undefined) return visitor.modelInvocationInput(value.modelInvocationInput);
+ return visitor._(value.$unknown[0], value.$unknown[1]);
+ };
+}
+
+/**
+ * @public
+ * Trace Part which contains information if preprocessing was successful
+ */
+export interface PostProcessingParsedResponse {
+ /**
+ * @public
+ * Agent Trace Output String
+ */
+ text?: string;
+}
+
+/**
+ * @public
+ * Trace Part which contains information related to postprocessing
+ */
+export interface PostProcessingModelInvocationOutput {
+ /**
+ * @public
+ * Identifier for trace
+ */
+ traceId?: string;
+
+ /**
+ * @public
+ * Trace Part which contains information if preprocessing was successful
+ */
+ parsedResponse?: PostProcessingParsedResponse;
+}
+
+/**
+ * @public
+ * Trace Part which contains information related to post processing step
+ */
+export type PostProcessingTrace =
+ | PostProcessingTrace.ModelInvocationInputMember
+ | PostProcessingTrace.ModelInvocationOutputMember
+ | PostProcessingTrace.$UnknownMember;
+
+/**
+ * @public
+ */
+export namespace PostProcessingTrace {
+ /**
+ * @public
+ * Trace Part which contains information used to call Invoke Model
+ */
+ export interface ModelInvocationInputMember {
+ modelInvocationInput: ModelInvocationInput;
+ modelInvocationOutput?: never;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ * Trace Part which contains information related to postprocessing
+ */
+ export interface ModelInvocationOutputMember {
+ modelInvocationInput?: never;
+ modelInvocationOutput: PostProcessingModelInvocationOutput;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ */
+ export interface $UnknownMember {
+ modelInvocationInput?: never;
+ modelInvocationOutput?: never;
+ $unknown: [string, any];
+ }
+
+ export interface Visitor {
+ modelInvocationInput: (value: ModelInvocationInput) => T;
+ modelInvocationOutput: (value: PostProcessingModelInvocationOutput) => T;
+ _: (name: string, value: any) => T;
+ }
+
+ export const visit = (value: PostProcessingTrace, visitor: Visitor): T => {
+ if (value.modelInvocationInput !== undefined) return visitor.modelInvocationInput(value.modelInvocationInput);
+ if (value.modelInvocationOutput !== undefined) return visitor.modelInvocationOutput(value.modelInvocationOutput);
+ return visitor._(value.$unknown[0], value.$unknown[1]);
+ };
+}
+
+/**
+ * @public
+ * Trace Part which contains information if preprocessing was successful
+ */
+export interface PreProcessingParsedResponse {
+ /**
+ * @public
+ * Agent Trace Rationale String
+ */
+ rationale?: string;
+
+ /**
+ * @public
+ * Boolean value
+ */
+ isValid?: boolean;
+}
+
+/**
+ * @public
+ * Trace Part which contains information related to preprocessing
+ */
+export interface PreProcessingModelInvocationOutput {
+ /**
+ * @public
+ * Identifier for trace
+ */
+ traceId?: string;
+
+ /**
+ * @public
+ * Trace Part which contains information if preprocessing was successful
+ */
+ parsedResponse?: PreProcessingParsedResponse;
+}
+
+/**
+ * @public
+ * Trace Part which contains information related to preprocessing step
+ */
+export type PreProcessingTrace =
+ | PreProcessingTrace.ModelInvocationInputMember
+ | PreProcessingTrace.ModelInvocationOutputMember
+ | PreProcessingTrace.$UnknownMember;
+
+/**
+ * @public
+ */
+export namespace PreProcessingTrace {
+ /**
+ * @public
+ * Trace Part which contains information used to call Invoke Model
+ */
+ export interface ModelInvocationInputMember {
+ modelInvocationInput: ModelInvocationInput;
+ modelInvocationOutput?: never;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ * Trace Part which contains information related to preprocessing
+ */
+ export interface ModelInvocationOutputMember {
+ modelInvocationInput?: never;
+ modelInvocationOutput: PreProcessingModelInvocationOutput;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ */
+ export interface $UnknownMember {
+ modelInvocationInput?: never;
+ modelInvocationOutput?: never;
+ $unknown: [string, any];
+ }
+
+ export interface Visitor {
+ modelInvocationInput: (value: ModelInvocationInput) => T;
+ modelInvocationOutput: (value: PreProcessingModelInvocationOutput) => T;
+ _: (name: string, value: any) => T;
+ }
+
+ export const visit = (value: PreProcessingTrace, visitor: Visitor): T => {
+ if (value.modelInvocationInput !== undefined) return visitor.modelInvocationInput(value.modelInvocationInput);
+ if (value.modelInvocationOutput !== undefined) return visitor.modelInvocationOutput(value.modelInvocationOutput);
+ return visitor._(value.$unknown[0], value.$unknown[1]);
+ };
+}
+
+/**
+ * @public
+ * Trace contains intermidate response for customer
+ */
+export type Trace =
+ | Trace.FailureTraceMember
+ | Trace.OrchestrationTraceMember
+ | Trace.PostProcessingTraceMember
+ | Trace.PreProcessingTraceMember
+ | Trace.$UnknownMember;
+
+/**
+ * @public
+ */
+export namespace Trace {
+ /**
+ * @public
+ * Trace Part which contains information related to preprocessing step
+ */
+ export interface PreProcessingTraceMember {
+ preProcessingTrace: PreProcessingTrace;
+ orchestrationTrace?: never;
+ postProcessingTrace?: never;
+ failureTrace?: never;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ * Trace contains intermidate response during orchestration
+ */
+ export interface OrchestrationTraceMember {
+ preProcessingTrace?: never;
+ orchestrationTrace: OrchestrationTrace;
+ postProcessingTrace?: never;
+ failureTrace?: never;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ * Trace Part which contains information related to post processing step
+ */
+ export interface PostProcessingTraceMember {
+ preProcessingTrace?: never;
+ orchestrationTrace?: never;
+ postProcessingTrace: PostProcessingTrace;
+ failureTrace?: never;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ * Trace Part which is emitted when agent trace could not be generated
+ */
+ export interface FailureTraceMember {
+ preProcessingTrace?: never;
+ orchestrationTrace?: never;
+ postProcessingTrace?: never;
+ failureTrace: FailureTrace;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ */
+ export interface $UnknownMember {
+ preProcessingTrace?: never;
+ orchestrationTrace?: never;
+ postProcessingTrace?: never;
+ failureTrace?: never;
+ $unknown: [string, any];
+ }
+
+ export interface Visitor {
+ preProcessingTrace: (value: PreProcessingTrace) => T;
+ orchestrationTrace: (value: OrchestrationTrace) => T;
+ postProcessingTrace: (value: PostProcessingTrace) => T;
+ failureTrace: (value: FailureTrace) => T;
+ _: (name: string, value: any) => T;
+ }
+
+ export const visit = (value: Trace, visitor: Visitor): T => {
+ if (value.preProcessingTrace !== undefined) return visitor.preProcessingTrace(value.preProcessingTrace);
+ if (value.orchestrationTrace !== undefined) return visitor.orchestrationTrace(value.orchestrationTrace);
+ if (value.postProcessingTrace !== undefined) return visitor.postProcessingTrace(value.postProcessingTrace);
+ if (value.failureTrace !== undefined) return visitor.failureTrace(value.failureTrace);
+ return visitor._(value.$unknown[0], value.$unknown[1]);
+ };
+}
+
+/**
+ * @public
+ * Trace Part which contains intermidate response for customer
+ */
+export interface TracePart {
+ /**
+ * @public
+ * Identifier of the agent.
+ */
+ agentId?: string;
+
+ /**
+ * @public
+ * Identifier of the agent alias.
+ */
+ agentAliasId?: string;
+
+ /**
+ * @public
+ * Identifier of the session.
+ */
+ sessionId?: string;
+
+ /**
+ * @public
+ * Trace contains intermidate response for customer
+ */
+ trace?: Trace;
+}
+
+/**
+ * @public
+ * This exception is thrown when the request's input validation fails
+ */
+export class ValidationException extends __BaseException {
+ readonly name: "ValidationException" = "ValidationException";
+ readonly $fault: "client" = "client";
+ /**
+ * @internal
+ */
+ constructor(opts: __ExceptionOptionType) {
+ super({
+ name: "ValidationException",
+ $fault: "client",
+ ...opts,
+ });
+ Object.setPrototypeOf(this, ValidationException.prototype);
+ }
+}
+
+/**
+ * @public
+ * Response body of is a stream
+ */
+export type ResponseStream =
+ | ResponseStream.AccessDeniedExceptionMember
+ | ResponseStream.BadGatewayExceptionMember
+ | ResponseStream.ChunkMember
+ | ResponseStream.ConflictExceptionMember
+ | ResponseStream.DependencyFailedExceptionMember
+ | ResponseStream.InternalServerExceptionMember
+ | ResponseStream.ResourceNotFoundExceptionMember
+ | ResponseStream.ServiceQuotaExceededExceptionMember
+ | ResponseStream.ThrottlingExceptionMember
+ | ResponseStream.TraceMember
+ | ResponseStream.ValidationExceptionMember
+ | ResponseStream.$UnknownMember;
+
+/**
+ * @public
+ */
+export namespace ResponseStream {
+ /**
+ * @public
+ * Base 64 endoded byte response
+ */
+ export interface ChunkMember {
+ chunk: PayloadPart;
+ trace?: never;
+ internalServerException?: never;
+ validationException?: never;
+ resourceNotFoundException?: never;
+ serviceQuotaExceededException?: never;
+ throttlingException?: never;
+ accessDeniedException?: never;
+ conflictException?: never;
+ dependencyFailedException?: never;
+ badGatewayException?: never;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ * Trace Part which contains intermidate response for customer
+ */
+ export interface TraceMember {
+ chunk?: never;
+ trace: TracePart;
+ internalServerException?: never;
+ validationException?: never;
+ resourceNotFoundException?: never;
+ serviceQuotaExceededException?: never;
+ throttlingException?: never;
+ accessDeniedException?: never;
+ conflictException?: never;
+ dependencyFailedException?: never;
+ badGatewayException?: never;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ * This exception is thrown if there was an unexpected error during processing of request
+ */
+ export interface InternalServerExceptionMember {
+ chunk?: never;
+ trace?: never;
+ internalServerException: InternalServerException;
+ validationException?: never;
+ resourceNotFoundException?: never;
+ serviceQuotaExceededException?: never;
+ throttlingException?: never;
+ accessDeniedException?: never;
+ conflictException?: never;
+ dependencyFailedException?: never;
+ badGatewayException?: never;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ * This exception is thrown when the request's input validation fails
+ */
+ export interface ValidationExceptionMember {
+ chunk?: never;
+ trace?: never;
+ internalServerException?: never;
+ validationException: ValidationException;
+ resourceNotFoundException?: never;
+ serviceQuotaExceededException?: never;
+ throttlingException?: never;
+ accessDeniedException?: never;
+ conflictException?: never;
+ dependencyFailedException?: never;
+ badGatewayException?: never;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ * This exception is thrown when a resource referenced by the operation does not exist
+ */
+ export interface ResourceNotFoundExceptionMember {
+ chunk?: never;
+ trace?: never;
+ internalServerException?: never;
+ validationException?: never;
+ resourceNotFoundException: ResourceNotFoundException;
+ serviceQuotaExceededException?: never;
+ throttlingException?: never;
+ accessDeniedException?: never;
+ conflictException?: never;
+ dependencyFailedException?: never;
+ badGatewayException?: never;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ * This exception is thrown when a request is made beyond the service quota
+ */
+ export interface ServiceQuotaExceededExceptionMember {
+ chunk?: never;
+ trace?: never;
+ internalServerException?: never;
+ validationException?: never;
+ resourceNotFoundException?: never;
+ serviceQuotaExceededException: ServiceQuotaExceededException;
+ throttlingException?: never;
+ accessDeniedException?: never;
+ conflictException?: never;
+ dependencyFailedException?: never;
+ badGatewayException?: never;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ * This exception is thrown when the number of requests exceeds the limit
+ */
+ export interface ThrottlingExceptionMember {
+ chunk?: never;
+ trace?: never;
+ internalServerException?: never;
+ validationException?: never;
+ resourceNotFoundException?: never;
+ serviceQuotaExceededException?: never;
+ throttlingException: ThrottlingException;
+ accessDeniedException?: never;
+ conflictException?: never;
+ dependencyFailedException?: never;
+ badGatewayException?: never;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ * This exception is thrown when a request is denied per access permissions
+ */
+ export interface AccessDeniedExceptionMember {
+ chunk?: never;
+ trace?: never;
+ internalServerException?: never;
+ validationException?: never;
+ resourceNotFoundException?: never;
+ serviceQuotaExceededException?: never;
+ throttlingException?: never;
+ accessDeniedException: AccessDeniedException;
+ conflictException?: never;
+ dependencyFailedException?: never;
+ badGatewayException?: never;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ * This exception is thrown when there is a conflict performing an operation
+ */
+ export interface ConflictExceptionMember {
+ chunk?: never;
+ trace?: never;
+ internalServerException?: never;
+ validationException?: never;
+ resourceNotFoundException?: never;
+ serviceQuotaExceededException?: never;
+ throttlingException?: never;
+ accessDeniedException?: never;
+ conflictException: ConflictException;
+ dependencyFailedException?: never;
+ badGatewayException?: never;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ * This exception is thrown when a request fails due to dependency like Lambda, Bedrock, STS resource due to a customer fault (i.e. bad configuration)
+ */
+ export interface DependencyFailedExceptionMember {
+ chunk?: never;
+ trace?: never;
+ internalServerException?: never;
+ validationException?: never;
+ resourceNotFoundException?: never;
+ serviceQuotaExceededException?: never;
+ throttlingException?: never;
+ accessDeniedException?: never;
+ conflictException?: never;
+ dependencyFailedException: DependencyFailedException;
+ badGatewayException?: never;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ * This exception is thrown when a request fails due to dependency like Lambda, Bedrock, STS resource
+ */
+ export interface BadGatewayExceptionMember {
+ chunk?: never;
+ trace?: never;
+ internalServerException?: never;
+ validationException?: never;
+ resourceNotFoundException?: never;
+ serviceQuotaExceededException?: never;
+ throttlingException?: never;
+ accessDeniedException?: never;
+ conflictException?: never;
+ dependencyFailedException?: never;
+ badGatewayException: BadGatewayException;
+ $unknown?: never;
+ }
+
+ /**
+ * @public
+ */
+ export interface $UnknownMember {
+ chunk?: never;
+ trace?: never;
+ internalServerException?: never;
+ validationException?: never;
+ resourceNotFoundException?: never;
+ serviceQuotaExceededException?: never;
+ throttlingException?: never;
+ accessDeniedException?: never;
+ conflictException?: never;
+ dependencyFailedException?: never;
+ badGatewayException?: never;
+ $unknown: [string, any];
+ }
+
+ export interface Visitor {
+ chunk: (value: PayloadPart) => T;
+ trace: (value: TracePart) => T;
+ internalServerException: (value: InternalServerException) => T;
+ validationException: (value: ValidationException) => T;
+ resourceNotFoundException: (value: ResourceNotFoundException) => T;
+ serviceQuotaExceededException: (value: ServiceQuotaExceededException) => T;
+ throttlingException: (value: ThrottlingException) => T;
+ accessDeniedException: (value: AccessDeniedException) => T;
+ conflictException: (value: ConflictException) => T;
+ dependencyFailedException: (value: DependencyFailedException) => T;
+ badGatewayException: (value: BadGatewayException) => T;
+ _: (name: string, value: any) => T;
+ }
+
+ export const visit = (value: ResponseStream, visitor: Visitor): T => {
+ if (value.chunk !== undefined) return visitor.chunk(value.chunk);
+ if (value.trace !== undefined) return visitor.trace(value.trace);
+ if (value.internalServerException !== undefined)
+ return visitor.internalServerException(value.internalServerException);
+ if (value.validationException !== undefined) return visitor.validationException(value.validationException);
+ if (value.resourceNotFoundException !== undefined)
+ return visitor.resourceNotFoundException(value.resourceNotFoundException);
+ if (value.serviceQuotaExceededException !== undefined)
+ return visitor.serviceQuotaExceededException(value.serviceQuotaExceededException);
+ if (value.throttlingException !== undefined) return visitor.throttlingException(value.throttlingException);
+ if (value.accessDeniedException !== undefined) return visitor.accessDeniedException(value.accessDeniedException);
+ if (value.conflictException !== undefined) return visitor.conflictException(value.conflictException);
+ if (value.dependencyFailedException !== undefined)
+ return visitor.dependencyFailedException(value.dependencyFailedException);
+ if (value.badGatewayException !== undefined) return visitor.badGatewayException(value.badGatewayException);
+ return visitor._(value.$unknown[0], value.$unknown[1]);
+ };
+}
+
+/**
+ * @public
+ * InvokeAgent Response
+ */
+export interface InvokeAgentResponse {
+ /**
+ * @public
+ * Inference response from the model in the format specified in the Content-Type response header.
+ */
+ completion: AsyncIterable | undefined;
+
+ /**
+ * @public
+ * streaming response mimetype of the model
+ */
+ contentType: string | undefined;
+
+ /**
+ * @public
+ * streaming response mimetype of the model
+ */
+ sessionId: string | undefined;
+}
+
+/**
+ * @public
+ * Customer input of the turn
+ */
+export interface RetrieveAndGenerateInput {
+ /**
+ * @public
+ * Customer input of the turn in text
+ */
+ text: string | undefined;
+}
+
+/**
+ * @public
+ * Configurations for retrieval and generation for knowledge base.
+ */
+export interface KnowledgeBaseRetrieveAndGenerateConfiguration {
+ /**
+ * @public
+ * Identifier of the KnowledgeBase
+ */
+ knowledgeBaseId: string | undefined;
+
+ /**
+ * @public
+ * Arn of a Bedrock model.
+ */
+ modelArn: string | undefined;
+}
+
+/**
+ * @public
+ * @enum
+ */
+export const RetrieveAndGenerateType = {
+ KNOWLEDGE_BASE: "KNOWLEDGE_BASE",
+} as const;
+
+/**
+ * @public
+ */
+export type RetrieveAndGenerateType = (typeof RetrieveAndGenerateType)[keyof typeof RetrieveAndGenerateType];
+
+/**
+ * @public
+ * Configures the retrieval and generation for the session.
+ */
+export interface RetrieveAndGenerateConfiguration {
+ /**
+ * @public
+ * The type of RetrieveAndGenerate.
+ */
+ type: RetrieveAndGenerateType | undefined;
+
+ /**
+ * @public
+ * Configurations for retrieval and generation for knowledge base.
+ */
+ knowledgeBaseConfiguration?: KnowledgeBaseRetrieveAndGenerateConfiguration;
+}
+
+/**
+ * @public
+ * Configures common parameters of the session.
+ */
+export interface RetrieveAndGenerateSessionConfiguration {
+ /**
+ * @public
+ * The KMS key arn to encrypt the customer data of the session.
+ */
+ kmsKeyArn: string | undefined;
+}
+
+/**
+ * @public
+ */
+export interface RetrieveAndGenerateRequest {
+ /**
+ * @public
+ * Identifier of the session.
+ */
+ sessionId?: string;
+
+ /**
+ * @public
+ * Customer input of the turn
+ */
+ input: RetrieveAndGenerateInput | undefined;
+
+ /**
+ * @public
+ * Configures the retrieval and generation for the session.
+ */
+ retrieveAndGenerateConfiguration?: RetrieveAndGenerateConfiguration;
+
+ /**
+ * @public
+ * Configures common parameters of the session.
+ */
+ sessionConfiguration?: RetrieveAndGenerateSessionConfiguration;
+}
+
+/**
+ * @public
+ * Service response of the turn
+ */
+export interface RetrieveAndGenerateOutput {
+ /**
+ * @public
+ * Service response of the turn in text
+ */
+ text: string | undefined;
+}
+
+/**
+ * @public
+ */
+export interface RetrieveAndGenerateResponse {
+ /**
+ * @public
+ * Identifier of the session.
+ */
+ sessionId: string | undefined;
+
+ /**
+ * @public
+ * Service response of the turn
+ */
+ output: RetrieveAndGenerateOutput | undefined;
+
+ /**
+ * @public
+ * List of citations
+ */
+ citations?: Citation[];
+}
+
+/**
+ * @public
+ * Knowledge base vector search configuration
+ */
+export interface KnowledgeBaseVectorSearchConfiguration {
+ /**
+ * @public
+ * Top-K results to retrieve from knowledge base.
+ */
+ numberOfResults: number | undefined;
+}
+
+/**
+ * @public
+ * Search parameters for retrieving from knowledge base.
+ */
+export interface KnowledgeBaseRetrievalConfiguration {
+ /**
+ * @public
+ * Knowledge base vector search configuration
+ */
+ vectorSearchConfiguration: KnowledgeBaseVectorSearchConfiguration | undefined;
+}
+
+/**
+ * @public
+ * Knowledge base input query.
+ */
+export interface KnowledgeBaseQuery {
+ /**
+ * @public
+ * Knowledge base input query in text
+ */
+ text: string | undefined;
+}
+
+/**
+ * @public
+ */
+export interface RetrieveRequest {
+ /**
+ * @public
+ * Identifier of the KnowledgeBase
+ */
+ knowledgeBaseId: string | undefined;
+
+ /**
+ * @public
+ * Knowledge base input query.
+ */
+ retrievalQuery: KnowledgeBaseQuery | undefined;
+
+ /**
+ * @public
+ * Search parameters for retrieving from knowledge base.
+ */
+ retrievalConfiguration?: KnowledgeBaseRetrievalConfiguration;
+
+ /**
+ * @public
+ * Opaque continuation token of previous paginated response.
+ */
+ nextToken?: string;
+}
+
+/**
+ * @public
+ * Result item returned from a knowledge base retrieval.
+ */
+export interface KnowledgeBaseRetrievalResult {
+ /**
+ * @public
+ * Content of a retrieval result.
+ */
+ content: RetrievalResultContent | undefined;
+
+ /**
+ * @public
+ * The source location of a retrieval result.
+ */
+ location?: RetrievalResultLocation;
+
+ /**
+ * @public
+ * The relevance score of a result.
+ */
+ score?: number;
+}
+
+/**
+ * @public
+ */
+export interface RetrieveResponse {
+ /**
+ * @public
+ * List of knowledge base retrieval results
+ */
+ retrievalResults: KnowledgeBaseRetrievalResult[] | undefined;
+
+ /**
+ * @public
+ * Opaque continuation token of previous paginated response.
+ */
+ nextToken?: string;
+}
+
+/**
+ * @internal
+ */
+export const ActionGroupInvocationInputFilterSensitiveLog = (obj: ActionGroupInvocationInput): any => ({
+ ...obj,
+ ...(obj.actionGroupName && { actionGroupName: SENSITIVE_STRING }),
+ ...(obj.verb && { verb: SENSITIVE_STRING }),
+ ...(obj.apiPath && { apiPath: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const ActionGroupInvocationOutputFilterSensitiveLog = (obj: ActionGroupInvocationOutput): any => ({
+ ...obj,
+ ...(obj.text && { text: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const InvokeAgentRequestFilterSensitiveLog = (obj: InvokeAgentRequest): any => ({
+ ...obj,
+ ...(obj.inputText && { inputText: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const PayloadPartFilterSensitiveLog = (obj: PayloadPart): any => ({
+ ...obj,
+ ...(obj.bytes && { bytes: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const FailureTraceFilterSensitiveLog = (obj: FailureTrace): any => ({
+ ...obj,
+ ...(obj.failureReason && { failureReason: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const KnowledgeBaseLookupInputFilterSensitiveLog = (obj: KnowledgeBaseLookupInput): any => ({
+ ...obj,
+ ...(obj.text && { text: SENSITIVE_STRING }),
+ ...(obj.knowledgeBaseId && { knowledgeBaseId: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const InvocationInputFilterSensitiveLog = (obj: InvocationInput): any => ({
+ ...obj,
+ ...(obj.actionGroupInvocationInput && {
+ actionGroupInvocationInput: ActionGroupInvocationInputFilterSensitiveLog(obj.actionGroupInvocationInput),
+ }),
+ ...(obj.knowledgeBaseLookupInput && {
+ knowledgeBaseLookupInput: KnowledgeBaseLookupInputFilterSensitiveLog(obj.knowledgeBaseLookupInput),
+ }),
+});
+
+/**
+ * @internal
+ */
+export const ModelInvocationInputFilterSensitiveLog = (obj: ModelInvocationInput): any => ({
+ ...obj,
+ ...(obj.text && { text: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const FinalResponseFilterSensitiveLog = (obj: FinalResponse): any => ({
+ ...obj,
+ ...(obj.text && { text: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const RepromptResponseFilterSensitiveLog = (obj: RepromptResponse): any => ({
+ ...obj,
+ ...(obj.source && { source: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const ObservationFilterSensitiveLog = (obj: Observation): any => ({
+ ...obj,
+ ...(obj.actionGroupInvocationOutput && {
+ actionGroupInvocationOutput: ActionGroupInvocationOutputFilterSensitiveLog(obj.actionGroupInvocationOutput),
+ }),
+ ...(obj.finalResponse && { finalResponse: FinalResponseFilterSensitiveLog(obj.finalResponse) }),
+ ...(obj.repromptResponse && { repromptResponse: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const RationaleFilterSensitiveLog = (obj: Rationale): any => ({
+ ...obj,
+ ...(obj.text && { text: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const OrchestrationTraceFilterSensitiveLog = (obj: OrchestrationTrace): any => {
+ if (obj.rationale !== undefined) return { rationale: SENSITIVE_STRING };
+ if (obj.invocationInput !== undefined) return { invocationInput: SENSITIVE_STRING };
+ if (obj.observation !== undefined) return { observation: SENSITIVE_STRING };
+ if (obj.modelInvocationInput !== undefined) return { modelInvocationInput: SENSITIVE_STRING };
+ if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" };
+};
+
+/**
+ * @internal
+ */
+export const PostProcessingParsedResponseFilterSensitiveLog = (obj: PostProcessingParsedResponse): any => ({
+ ...obj,
+ ...(obj.text && { text: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const PostProcessingModelInvocationOutputFilterSensitiveLog = (
+ obj: PostProcessingModelInvocationOutput
+): any => ({
+ ...obj,
+ ...(obj.parsedResponse && { parsedResponse: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const PostProcessingTraceFilterSensitiveLog = (obj: PostProcessingTrace): any => {
+ if (obj.modelInvocationInput !== undefined) return { modelInvocationInput: SENSITIVE_STRING };
+ if (obj.modelInvocationOutput !== undefined) return { modelInvocationOutput: SENSITIVE_STRING };
+ if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" };
+};
+
+/**
+ * @internal
+ */
+export const PreProcessingParsedResponseFilterSensitiveLog = (obj: PreProcessingParsedResponse): any => ({
+ ...obj,
+ ...(obj.rationale && { rationale: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const PreProcessingModelInvocationOutputFilterSensitiveLog = (obj: PreProcessingModelInvocationOutput): any => ({
+ ...obj,
+ ...(obj.parsedResponse && { parsedResponse: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const PreProcessingTraceFilterSensitiveLog = (obj: PreProcessingTrace): any => {
+ if (obj.modelInvocationInput !== undefined) return { modelInvocationInput: SENSITIVE_STRING };
+ if (obj.modelInvocationOutput !== undefined) return { modelInvocationOutput: SENSITIVE_STRING };
+ if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" };
+};
+
+/**
+ * @internal
+ */
+export const TraceFilterSensitiveLog = (obj: Trace): any => {
+ if (obj.preProcessingTrace !== undefined) return { preProcessingTrace: SENSITIVE_STRING };
+ if (obj.orchestrationTrace !== undefined) return { orchestrationTrace: SENSITIVE_STRING };
+ if (obj.postProcessingTrace !== undefined) return { postProcessingTrace: SENSITIVE_STRING };
+ if (obj.failureTrace !== undefined) return { failureTrace: SENSITIVE_STRING };
+ if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" };
+};
+
+/**
+ * @internal
+ */
+export const TracePartFilterSensitiveLog = (obj: TracePart): any => ({
+ ...obj,
+ ...(obj.trace && { trace: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const ResponseStreamFilterSensitiveLog = (obj: ResponseStream): any => {
+ if (obj.chunk !== undefined) return { chunk: SENSITIVE_STRING };
+ if (obj.trace !== undefined) return { trace: SENSITIVE_STRING };
+ if (obj.internalServerException !== undefined) return { internalServerException: obj.internalServerException };
+ if (obj.validationException !== undefined) return { validationException: obj.validationException };
+ if (obj.resourceNotFoundException !== undefined) return { resourceNotFoundException: obj.resourceNotFoundException };
+ if (obj.serviceQuotaExceededException !== undefined)
+ return { serviceQuotaExceededException: obj.serviceQuotaExceededException };
+ if (obj.throttlingException !== undefined) return { throttlingException: obj.throttlingException };
+ if (obj.accessDeniedException !== undefined) return { accessDeniedException: obj.accessDeniedException };
+ if (obj.conflictException !== undefined) return { conflictException: obj.conflictException };
+ if (obj.dependencyFailedException !== undefined) return { dependencyFailedException: obj.dependencyFailedException };
+ if (obj.badGatewayException !== undefined) return { badGatewayException: obj.badGatewayException };
+ if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" };
+};
+
+/**
+ * @internal
+ */
+export const InvokeAgentResponseFilterSensitiveLog = (obj: InvokeAgentResponse): any => ({
+ ...obj,
+ ...(obj.completion && { completion: "STREAMING_CONTENT" }),
+});
+
+/**
+ * @internal
+ */
+export const RetrieveAndGenerateInputFilterSensitiveLog = (obj: RetrieveAndGenerateInput): any => ({
+ ...obj,
+});
+
+/**
+ * @internal
+ */
+export const RetrieveAndGenerateRequestFilterSensitiveLog = (obj: RetrieveAndGenerateRequest): any => ({
+ ...obj,
+ ...(obj.input && { input: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const RetrieveAndGenerateOutputFilterSensitiveLog = (obj: RetrieveAndGenerateOutput): any => ({
+ ...obj,
+});
+
+/**
+ * @internal
+ */
+export const RetrieveAndGenerateResponseFilterSensitiveLog = (obj: RetrieveAndGenerateResponse): any => ({
+ ...obj,
+ ...(obj.output && { output: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const KnowledgeBaseQueryFilterSensitiveLog = (obj: KnowledgeBaseQuery): any => ({
+ ...obj,
+});
+
+/**
+ * @internal
+ */
+export const RetrieveRequestFilterSensitiveLog = (obj: RetrieveRequest): any => ({
+ ...obj,
+ ...(obj.retrievalQuery && { retrievalQuery: SENSITIVE_STRING }),
+});
+
+/**
+ * @internal
+ */
+export const RetrieveResponseFilterSensitiveLog = (obj: RetrieveResponse): any => ({
+ ...obj,
+ ...(obj.retrievalResults && { retrievalResults: SENSITIVE_STRING }),
+});
diff --git a/clients/client-bedrock-agent-runtime/src/pagination/Interfaces.ts b/clients/client-bedrock-agent-runtime/src/pagination/Interfaces.ts
new file mode 100644
index 000000000000..230c24280714
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/pagination/Interfaces.ts
@@ -0,0 +1,11 @@
+// smithy-typescript generated code
+import { PaginationConfiguration } from "@smithy/types";
+
+import { BedrockAgentRuntimeClient } from "../BedrockAgentRuntimeClient";
+
+/**
+ * @public
+ */
+export interface BedrockAgentRuntimePaginationConfiguration extends PaginationConfiguration {
+ client: BedrockAgentRuntimeClient;
+}
diff --git a/clients/client-bedrock-agent-runtime/src/pagination/RetrievePaginator.ts b/clients/client-bedrock-agent-runtime/src/pagination/RetrievePaginator.ts
new file mode 100644
index 000000000000..a79865b40100
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/pagination/RetrievePaginator.ts
@@ -0,0 +1,45 @@
+// smithy-typescript generated code
+import { Paginator } from "@smithy/types";
+
+import { BedrockAgentRuntimeClient } from "../BedrockAgentRuntimeClient";
+import { RetrieveCommand, RetrieveCommandInput, RetrieveCommandOutput } from "../commands/RetrieveCommand";
+import { BedrockAgentRuntimePaginationConfiguration } from "./Interfaces";
+
+/**
+ * @internal
+ */
+const makePagedClientRequest = async (
+ client: BedrockAgentRuntimeClient,
+ input: RetrieveCommandInput,
+ ...args: any
+): Promise => {
+ // @ts-ignore
+ return await client.send(new RetrieveCommand(input), ...args);
+};
+/**
+ * @public
+ */
+export async function* paginateRetrieve(
+ config: BedrockAgentRuntimePaginationConfiguration,
+ input: RetrieveCommandInput,
+ ...additionalArguments: any
+): Paginator {
+ // ToDo: replace with actual type instead of typeof input.nextToken
+ let token: typeof input.nextToken | undefined = config.startingToken || undefined;
+ let hasNext = true;
+ let page: RetrieveCommandOutput;
+ while (hasNext) {
+ input.nextToken = token;
+ if (config.client instanceof BedrockAgentRuntimeClient) {
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
+ } else {
+ throw new Error("Invalid client, expected BedrockAgentRuntime | BedrockAgentRuntimeClient");
+ }
+ yield page;
+ const prevToken = token;
+ token = page.nextToken;
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
+ }
+ // @ts-ignore
+ return undefined;
+}
diff --git a/clients/client-bedrock-agent-runtime/src/pagination/index.ts b/clients/client-bedrock-agent-runtime/src/pagination/index.ts
new file mode 100644
index 000000000000..13f7ad2087e8
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/pagination/index.ts
@@ -0,0 +1,3 @@
+// smithy-typescript generated code
+export * from "./Interfaces";
+export * from "./RetrievePaginator";
diff --git a/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts b/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts
new file mode 100644
index 000000000000..5397d102ad6d
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts
@@ -0,0 +1,1039 @@
+// smithy-typescript generated code
+import { awsExpectUnion as __expectUnion } from "@aws-sdk/core";
+import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
+import {
+ _json,
+ collectBody,
+ decorateServiceException as __decorateServiceException,
+ expectInt32 as __expectInt32,
+ expectNonNull as __expectNonNull,
+ expectObject as __expectObject,
+ expectString as __expectString,
+ limitedParseDouble as __limitedParseDouble,
+ limitedParseFloat32 as __limitedParseFloat32,
+ map,
+ resolvedPath as __resolvedPath,
+ take,
+ withBaseException,
+} from "@smithy/smithy-client";
+import {
+ Endpoint as __Endpoint,
+ EventStreamSerdeContext as __EventStreamSerdeContext,
+ ResponseMetadata as __ResponseMetadata,
+ SerdeContext as __SerdeContext,
+} from "@smithy/types";
+
+import { InvokeAgentCommandInput, InvokeAgentCommandOutput } from "../commands/InvokeAgentCommand";
+import {
+ RetrieveAndGenerateCommandInput,
+ RetrieveAndGenerateCommandOutput,
+} from "../commands/RetrieveAndGenerateCommand";
+import { RetrieveCommandInput, RetrieveCommandOutput } from "../commands/RetrieveCommand";
+import { BedrockAgentRuntimeServiceException as __BaseException } from "../models/BedrockAgentRuntimeServiceException";
+import {
+ AccessDeniedException,
+ BadGatewayException,
+ ConflictException,
+ DependencyFailedException,
+ InferenceConfiguration,
+ InternalServerException,
+ KnowledgeBaseQuery,
+ KnowledgeBaseRetrievalConfiguration,
+ KnowledgeBaseRetrievalResult,
+ KnowledgeBaseRetrieveAndGenerateConfiguration,
+ KnowledgeBaseVectorSearchConfiguration,
+ ModelInvocationInput,
+ OrchestrationTrace,
+ PayloadPart,
+ PostProcessingTrace,
+ PreProcessingTrace,
+ ResourceNotFoundException,
+ ResponseStream,
+ RetrieveAndGenerateConfiguration,
+ RetrieveAndGenerateInput,
+ RetrieveAndGenerateSessionConfiguration,
+ ServiceQuotaExceededException,
+ SessionState,
+ ThrottlingException,
+ Trace,
+ TracePart,
+ ValidationException,
+} from "../models/models_0";
+
+/**
+ * serializeAws_restJson1InvokeAgentCommand
+ */
+export const se_InvokeAgentCommand = async (
+ input: InvokeAgentCommandInput,
+ context: __SerdeContext
+): Promise<__HttpRequest> => {
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
+ const headers: any = {
+ "content-type": "application/json",
+ };
+ let resolvedPath =
+ `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
+ "/agents/{agentId}/agentAliases/{agentAliasId}/sessions/{sessionId}/text";
+ resolvedPath = __resolvedPath(resolvedPath, input, "agentId", () => input.agentId!, "{agentId}", false);
+ resolvedPath = __resolvedPath(
+ resolvedPath,
+ input,
+ "agentAliasId",
+ () => input.agentAliasId!,
+ "{agentAliasId}",
+ false
+ );
+ resolvedPath = __resolvedPath(resolvedPath, input, "sessionId", () => input.sessionId!, "{sessionId}", false);
+ let body: any;
+ body = JSON.stringify(
+ take(input, {
+ enableTrace: [],
+ endSession: [],
+ inputText: [],
+ sessionState: (_) => _json(_),
+ })
+ );
+ return new __HttpRequest({
+ protocol,
+ hostname,
+ port,
+ method: "POST",
+ headers,
+ path: resolvedPath,
+ body,
+ });
+};
+
+/**
+ * serializeAws_restJson1RetrieveCommand
+ */
+export const se_RetrieveCommand = async (
+ input: RetrieveCommandInput,
+ context: __SerdeContext
+): Promise<__HttpRequest> => {
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
+ const headers: any = {
+ "content-type": "application/json",
+ };
+ let resolvedPath =
+ `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
+ "/knowledgebases/{knowledgeBaseId}/retrieve";
+ resolvedPath = __resolvedPath(
+ resolvedPath,
+ input,
+ "knowledgeBaseId",
+ () => input.knowledgeBaseId!,
+ "{knowledgeBaseId}",
+ false
+ );
+ let body: any;
+ body = JSON.stringify(
+ take(input, {
+ nextToken: [],
+ retrievalConfiguration: (_) => _json(_),
+ retrievalQuery: (_) => _json(_),
+ })
+ );
+ return new __HttpRequest({
+ protocol,
+ hostname,
+ port,
+ method: "POST",
+ headers,
+ path: resolvedPath,
+ body,
+ });
+};
+
+/**
+ * serializeAws_restJson1RetrieveAndGenerateCommand
+ */
+export const se_RetrieveAndGenerateCommand = async (
+ input: RetrieveAndGenerateCommandInput,
+ context: __SerdeContext
+): Promise<__HttpRequest> => {
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
+ const headers: any = {
+ "content-type": "application/json",
+ };
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/retrieveAndGenerate";
+ let body: any;
+ body = JSON.stringify(
+ take(input, {
+ input: (_) => _json(_),
+ retrieveAndGenerateConfiguration: (_) => _json(_),
+ sessionConfiguration: (_) => _json(_),
+ sessionId: [],
+ })
+ );
+ return new __HttpRequest({
+ protocol,
+ hostname,
+ port,
+ method: "POST",
+ headers,
+ path: resolvedPath,
+ body,
+ });
+};
+
+/**
+ * deserializeAws_restJson1InvokeAgentCommand
+ */
+export const de_InvokeAgentCommand = async (
+ output: __HttpResponse,
+ context: __SerdeContext & __EventStreamSerdeContext
+): Promise => {
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
+ return de_InvokeAgentCommandError(output, context);
+ }
+ const contents: any = map({
+ $metadata: deserializeMetadata(output),
+ contentType: [, output.headers["x-amzn-bedrock-agent-content-type"]],
+ sessionId: [, output.headers["x-amz-bedrock-agent-session-id"]],
+ });
+ const data: any = output.body;
+ contents.completion = de_ResponseStream(data, context);
+ return contents;
+};
+
+/**
+ * deserializeAws_restJson1InvokeAgentCommandError
+ */
+const de_InvokeAgentCommandError = async (
+ output: __HttpResponse,
+ context: __SerdeContext
+): Promise => {
+ const parsedOutput: any = {
+ ...output,
+ body: await parseErrorBody(output.body, context),
+ };
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
+ switch (errorCode) {
+ case "AccessDeniedException":
+ case "com.amazonaws.bedrockagentruntime#AccessDeniedException":
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
+ case "BadGatewayException":
+ case "com.amazonaws.bedrockagentruntime#BadGatewayException":
+ throw await de_BadGatewayExceptionRes(parsedOutput, context);
+ case "ConflictException":
+ case "com.amazonaws.bedrockagentruntime#ConflictException":
+ throw await de_ConflictExceptionRes(parsedOutput, context);
+ case "DependencyFailedException":
+ case "com.amazonaws.bedrockagentruntime#DependencyFailedException":
+ throw await de_DependencyFailedExceptionRes(parsedOutput, context);
+ case "InternalServerException":
+ case "com.amazonaws.bedrockagentruntime#InternalServerException":
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
+ case "ResourceNotFoundException":
+ case "com.amazonaws.bedrockagentruntime#ResourceNotFoundException":
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
+ case "ServiceQuotaExceededException":
+ case "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException":
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
+ case "ThrottlingException":
+ case "com.amazonaws.bedrockagentruntime#ThrottlingException":
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
+ case "ValidationException":
+ case "com.amazonaws.bedrockagentruntime#ValidationException":
+ throw await de_ValidationExceptionRes(parsedOutput, context);
+ default:
+ const parsedBody = parsedOutput.body;
+ return throwDefaultError({
+ output,
+ parsedBody,
+ errorCode,
+ });
+ }
+};
+
+/**
+ * deserializeAws_restJson1RetrieveCommand
+ */
+export const de_RetrieveCommand = async (
+ output: __HttpResponse,
+ context: __SerdeContext
+): Promise => {
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
+ return de_RetrieveCommandError(output, context);
+ }
+ const contents: any = map({
+ $metadata: deserializeMetadata(output),
+ });
+ const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
+ const doc = take(data, {
+ nextToken: __expectString,
+ retrievalResults: (_) => de_KnowledgeBaseRetrievalResults(_, context),
+ });
+ Object.assign(contents, doc);
+ return contents;
+};
+
+/**
+ * deserializeAws_restJson1RetrieveCommandError
+ */
+const de_RetrieveCommandError = async (
+ output: __HttpResponse,
+ context: __SerdeContext
+): Promise => {
+ const parsedOutput: any = {
+ ...output,
+ body: await parseErrorBody(output.body, context),
+ };
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
+ switch (errorCode) {
+ case "AccessDeniedException":
+ case "com.amazonaws.bedrockagentruntime#AccessDeniedException":
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
+ case "BadGatewayException":
+ case "com.amazonaws.bedrockagentruntime#BadGatewayException":
+ throw await de_BadGatewayExceptionRes(parsedOutput, context);
+ case "ConflictException":
+ case "com.amazonaws.bedrockagentruntime#ConflictException":
+ throw await de_ConflictExceptionRes(parsedOutput, context);
+ case "DependencyFailedException":
+ case "com.amazonaws.bedrockagentruntime#DependencyFailedException":
+ throw await de_DependencyFailedExceptionRes(parsedOutput, context);
+ case "InternalServerException":
+ case "com.amazonaws.bedrockagentruntime#InternalServerException":
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
+ case "ResourceNotFoundException":
+ case "com.amazonaws.bedrockagentruntime#ResourceNotFoundException":
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
+ case "ServiceQuotaExceededException":
+ case "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException":
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
+ case "ThrottlingException":
+ case "com.amazonaws.bedrockagentruntime#ThrottlingException":
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
+ case "ValidationException":
+ case "com.amazonaws.bedrockagentruntime#ValidationException":
+ throw await de_ValidationExceptionRes(parsedOutput, context);
+ default:
+ const parsedBody = parsedOutput.body;
+ return throwDefaultError({
+ output,
+ parsedBody,
+ errorCode,
+ });
+ }
+};
+
+/**
+ * deserializeAws_restJson1RetrieveAndGenerateCommand
+ */
+export const de_RetrieveAndGenerateCommand = async (
+ output: __HttpResponse,
+ context: __SerdeContext
+): Promise => {
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
+ return de_RetrieveAndGenerateCommandError(output, context);
+ }
+ const contents: any = map({
+ $metadata: deserializeMetadata(output),
+ });
+ const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
+ const doc = take(data, {
+ citations: _json,
+ output: _json,
+ sessionId: __expectString,
+ });
+ Object.assign(contents, doc);
+ return contents;
+};
+
+/**
+ * deserializeAws_restJson1RetrieveAndGenerateCommandError
+ */
+const de_RetrieveAndGenerateCommandError = async (
+ output: __HttpResponse,
+ context: __SerdeContext
+): Promise => {
+ const parsedOutput: any = {
+ ...output,
+ body: await parseErrorBody(output.body, context),
+ };
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
+ switch (errorCode) {
+ case "AccessDeniedException":
+ case "com.amazonaws.bedrockagentruntime#AccessDeniedException":
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
+ case "BadGatewayException":
+ case "com.amazonaws.bedrockagentruntime#BadGatewayException":
+ throw await de_BadGatewayExceptionRes(parsedOutput, context);
+ case "ConflictException":
+ case "com.amazonaws.bedrockagentruntime#ConflictException":
+ throw await de_ConflictExceptionRes(parsedOutput, context);
+ case "DependencyFailedException":
+ case "com.amazonaws.bedrockagentruntime#DependencyFailedException":
+ throw await de_DependencyFailedExceptionRes(parsedOutput, context);
+ case "InternalServerException":
+ case "com.amazonaws.bedrockagentruntime#InternalServerException":
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
+ case "ResourceNotFoundException":
+ case "com.amazonaws.bedrockagentruntime#ResourceNotFoundException":
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
+ case "ServiceQuotaExceededException":
+ case "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException":
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
+ case "ThrottlingException":
+ case "com.amazonaws.bedrockagentruntime#ThrottlingException":
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
+ case "ValidationException":
+ case "com.amazonaws.bedrockagentruntime#ValidationException":
+ throw await de_ValidationExceptionRes(parsedOutput, context);
+ default:
+ const parsedBody = parsedOutput.body;
+ return throwDefaultError({
+ output,
+ parsedBody,
+ errorCode,
+ });
+ }
+};
+
+const throwDefaultError = withBaseException(__BaseException);
+/**
+ * deserializeAws_restJson1AccessDeniedExceptionRes
+ */
+const de_AccessDeniedExceptionRes = async (
+ parsedOutput: any,
+ context: __SerdeContext
+): Promise => {
+ const contents: any = map({});
+ const data: any = parsedOutput.body;
+ const doc = take(data, {
+ message: __expectString,
+ });
+ Object.assign(contents, doc);
+ const exception = new AccessDeniedException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents,
+ });
+ return __decorateServiceException(exception, parsedOutput.body);
+};
+
+/**
+ * deserializeAws_restJson1BadGatewayExceptionRes
+ */
+const de_BadGatewayExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => {
+ const contents: any = map({});
+ const data: any = parsedOutput.body;
+ const doc = take(data, {
+ message: __expectString,
+ resourceName: __expectString,
+ });
+ Object.assign(contents, doc);
+ const exception = new BadGatewayException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents,
+ });
+ return __decorateServiceException(exception, parsedOutput.body);
+};
+
+/**
+ * deserializeAws_restJson1ConflictExceptionRes
+ */
+const de_ConflictExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => {
+ const contents: any = map({});
+ const data: any = parsedOutput.body;
+ const doc = take(data, {
+ message: __expectString,
+ });
+ Object.assign(contents, doc);
+ const exception = new ConflictException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents,
+ });
+ return __decorateServiceException(exception, parsedOutput.body);
+};
+
+/**
+ * deserializeAws_restJson1DependencyFailedExceptionRes
+ */
+const de_DependencyFailedExceptionRes = async (
+ parsedOutput: any,
+ context: __SerdeContext
+): Promise => {
+ const contents: any = map({});
+ const data: any = parsedOutput.body;
+ const doc = take(data, {
+ message: __expectString,
+ resourceName: __expectString,
+ });
+ Object.assign(contents, doc);
+ const exception = new DependencyFailedException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents,
+ });
+ return __decorateServiceException(exception, parsedOutput.body);
+};
+
+/**
+ * deserializeAws_restJson1InternalServerExceptionRes
+ */
+const de_InternalServerExceptionRes = async (
+ parsedOutput: any,
+ context: __SerdeContext
+): Promise => {
+ const contents: any = map({});
+ const data: any = parsedOutput.body;
+ const doc = take(data, {
+ message: __expectString,
+ });
+ Object.assign(contents, doc);
+ const exception = new InternalServerException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents,
+ });
+ return __decorateServiceException(exception, parsedOutput.body);
+};
+
+/**
+ * deserializeAws_restJson1ResourceNotFoundExceptionRes
+ */
+const de_ResourceNotFoundExceptionRes = async (
+ parsedOutput: any,
+ context: __SerdeContext
+): Promise => {
+ const contents: any = map({});
+ const data: any = parsedOutput.body;
+ const doc = take(data, {
+ message: __expectString,
+ });
+ Object.assign(contents, doc);
+ const exception = new ResourceNotFoundException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents,
+ });
+ return __decorateServiceException(exception, parsedOutput.body);
+};
+
+/**
+ * deserializeAws_restJson1ServiceQuotaExceededExceptionRes
+ */
+const de_ServiceQuotaExceededExceptionRes = async (
+ parsedOutput: any,
+ context: __SerdeContext
+): Promise => {
+ const contents: any = map({});
+ const data: any = parsedOutput.body;
+ const doc = take(data, {
+ message: __expectString,
+ });
+ Object.assign(contents, doc);
+ const exception = new ServiceQuotaExceededException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents,
+ });
+ return __decorateServiceException(exception, parsedOutput.body);
+};
+
+/**
+ * deserializeAws_restJson1ThrottlingExceptionRes
+ */
+const de_ThrottlingExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => {
+ const contents: any = map({});
+ const data: any = parsedOutput.body;
+ const doc = take(data, {
+ message: __expectString,
+ });
+ Object.assign(contents, doc);
+ const exception = new ThrottlingException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents,
+ });
+ return __decorateServiceException(exception, parsedOutput.body);
+};
+
+/**
+ * deserializeAws_restJson1ValidationExceptionRes
+ */
+const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => {
+ const contents: any = map({});
+ const data: any = parsedOutput.body;
+ const doc = take(data, {
+ message: __expectString,
+ });
+ Object.assign(contents, doc);
+ const exception = new ValidationException({
+ $metadata: deserializeMetadata(parsedOutput),
+ ...contents,
+ });
+ return __decorateServiceException(exception, parsedOutput.body);
+};
+
+/**
+ * deserializeAws_restJson1ResponseStream
+ */
+const de_ResponseStream = (
+ output: any,
+ context: __SerdeContext & __EventStreamSerdeContext
+): AsyncIterable => {
+ return context.eventStreamMarshaller.deserialize(output, async (event) => {
+ if (event["chunk"] != null) {
+ return {
+ chunk: await de_PayloadPart_event(event["chunk"], context),
+ };
+ }
+ if (event["trace"] != null) {
+ return {
+ trace: await de_TracePart_event(event["trace"], context),
+ };
+ }
+ if (event["internalServerException"] != null) {
+ return {
+ internalServerException: await de_InternalServerException_event(event["internalServerException"], context),
+ };
+ }
+ if (event["validationException"] != null) {
+ return {
+ validationException: await de_ValidationException_event(event["validationException"], context),
+ };
+ }
+ if (event["resourceNotFoundException"] != null) {
+ return {
+ resourceNotFoundException: await de_ResourceNotFoundException_event(
+ event["resourceNotFoundException"],
+ context
+ ),
+ };
+ }
+ if (event["serviceQuotaExceededException"] != null) {
+ return {
+ serviceQuotaExceededException: await de_ServiceQuotaExceededException_event(
+ event["serviceQuotaExceededException"],
+ context
+ ),
+ };
+ }
+ if (event["throttlingException"] != null) {
+ return {
+ throttlingException: await de_ThrottlingException_event(event["throttlingException"], context),
+ };
+ }
+ if (event["accessDeniedException"] != null) {
+ return {
+ accessDeniedException: await de_AccessDeniedException_event(event["accessDeniedException"], context),
+ };
+ }
+ if (event["conflictException"] != null) {
+ return {
+ conflictException: await de_ConflictException_event(event["conflictException"], context),
+ };
+ }
+ if (event["dependencyFailedException"] != null) {
+ return {
+ dependencyFailedException: await de_DependencyFailedException_event(
+ event["dependencyFailedException"],
+ context
+ ),
+ };
+ }
+ if (event["badGatewayException"] != null) {
+ return {
+ badGatewayException: await de_BadGatewayException_event(event["badGatewayException"], context),
+ };
+ }
+ return { $unknown: output };
+ });
+};
+const de_AccessDeniedException_event = async (output: any, context: __SerdeContext): Promise => {
+ const parsedOutput: any = {
+ ...output,
+ body: await parseBody(output.body, context),
+ };
+ return de_AccessDeniedExceptionRes(parsedOutput, context);
+};
+const de_BadGatewayException_event = async (output: any, context: __SerdeContext): Promise => {
+ const parsedOutput: any = {
+ ...output,
+ body: await parseBody(output.body, context),
+ };
+ return de_BadGatewayExceptionRes(parsedOutput, context);
+};
+const de_ConflictException_event = async (output: any, context: __SerdeContext): Promise => {
+ const parsedOutput: any = {
+ ...output,
+ body: await parseBody(output.body, context),
+ };
+ return de_ConflictExceptionRes(parsedOutput, context);
+};
+const de_DependencyFailedException_event = async (
+ output: any,
+ context: __SerdeContext
+): Promise => {
+ const parsedOutput: any = {
+ ...output,
+ body: await parseBody(output.body, context),
+ };
+ return de_DependencyFailedExceptionRes(parsedOutput, context);
+};
+const de_InternalServerException_event = async (
+ output: any,
+ context: __SerdeContext
+): Promise => {
+ const parsedOutput: any = {
+ ...output,
+ body: await parseBody(output.body, context),
+ };
+ return de_InternalServerExceptionRes(parsedOutput, context);
+};
+const de_PayloadPart_event = async (output: any, context: __SerdeContext): Promise => {
+ const contents: PayloadPart = {} as any;
+ const data: any = await parseBody(output.body, context);
+ Object.assign(contents, de_PayloadPart(data, context));
+ return contents;
+};
+const de_ResourceNotFoundException_event = async (
+ output: any,
+ context: __SerdeContext
+): Promise => {
+ const parsedOutput: any = {
+ ...output,
+ body: await parseBody(output.body, context),
+ };
+ return de_ResourceNotFoundExceptionRes(parsedOutput, context);
+};
+const de_ServiceQuotaExceededException_event = async (
+ output: any,
+ context: __SerdeContext
+): Promise => {
+ const parsedOutput: any = {
+ ...output,
+ body: await parseBody(output.body, context),
+ };
+ return de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
+};
+const de_ThrottlingException_event = async (output: any, context: __SerdeContext): Promise => {
+ const parsedOutput: any = {
+ ...output,
+ body: await parseBody(output.body, context),
+ };
+ return de_ThrottlingExceptionRes(parsedOutput, context);
+};
+const de_TracePart_event = async (output: any, context: __SerdeContext): Promise => {
+ const contents: TracePart = {} as any;
+ const data: any = await parseBody(output.body, context);
+ Object.assign(contents, de_TracePart(data, context));
+ return contents;
+};
+const de_ValidationException_event = async (output: any, context: __SerdeContext): Promise => {
+ const parsedOutput: any = {
+ ...output,
+ body: await parseBody(output.body, context),
+ };
+ return de_ValidationExceptionRes(parsedOutput, context);
+};
+// se_KnowledgeBaseQuery omitted.
+
+// se_KnowledgeBaseRetrievalConfiguration omitted.
+
+// se_KnowledgeBaseRetrieveAndGenerateConfiguration omitted.
+
+// se_KnowledgeBaseVectorSearchConfiguration omitted.
+
+// se_PromptSessionAttributesMap omitted.
+
+// se_RetrieveAndGenerateConfiguration omitted.
+
+// se_RetrieveAndGenerateInput omitted.
+
+// se_RetrieveAndGenerateSessionConfiguration omitted.
+
+// se_SessionAttributesMap omitted.
+
+// se_SessionState omitted.
+
+// de_ActionGroupInvocationInput omitted.
+
+// de_ActionGroupInvocationOutput omitted.
+
+// de_Attribution omitted.
+
+// de_Citation omitted.
+
+// de_Citations omitted.
+
+// de_ContentMap omitted.
+
+// de_FailureTrace omitted.
+
+// de_FinalResponse omitted.
+
+// de_GeneratedResponsePart omitted.
+
+/**
+ * deserializeAws_restJson1InferenceConfiguration
+ */
+const de_InferenceConfiguration = (output: any, context: __SerdeContext): InferenceConfiguration => {
+ return take(output, {
+ maximumLength: __expectInt32,
+ stopSequences: _json,
+ temperature: __limitedParseFloat32,
+ topK: __expectInt32,
+ topP: __limitedParseFloat32,
+ }) as any;
+};
+
+// de_InvocationInput omitted.
+
+// de_KnowledgeBaseLookupInput omitted.
+
+// de_KnowledgeBaseLookupOutput omitted.
+
+/**
+ * deserializeAws_restJson1KnowledgeBaseRetrievalResult
+ */
+const de_KnowledgeBaseRetrievalResult = (output: any, context: __SerdeContext): KnowledgeBaseRetrievalResult => {
+ return take(output, {
+ content: _json,
+ location: _json,
+ score: __limitedParseDouble,
+ }) as any;
+};
+
+/**
+ * deserializeAws_restJson1KnowledgeBaseRetrievalResults
+ */
+const de_KnowledgeBaseRetrievalResults = (output: any, context: __SerdeContext): KnowledgeBaseRetrievalResult[] => {
+ const retVal = (output || [])
+ .filter((e: any) => e != null)
+ .map((entry: any) => {
+ return de_KnowledgeBaseRetrievalResult(entry, context);
+ });
+ return retVal;
+};
+
+/**
+ * deserializeAws_restJson1ModelInvocationInput
+ */
+const de_ModelInvocationInput = (output: any, context: __SerdeContext): ModelInvocationInput => {
+ return take(output, {
+ inferenceConfiguration: (_: any) => de_InferenceConfiguration(_, context),
+ overrideLambda: __expectString,
+ parserMode: __expectString,
+ promptCreationMode: __expectString,
+ text: __expectString,
+ traceId: __expectString,
+ type: __expectString,
+ }) as any;
+};
+
+// de_Observation omitted.
+
+/**
+ * deserializeAws_restJson1OrchestrationTrace
+ */
+const de_OrchestrationTrace = (output: any, context: __SerdeContext): OrchestrationTrace => {
+ if (output.invocationInput != null) {
+ return {
+ invocationInput: _json(output.invocationInput),
+ };
+ }
+ if (output.modelInvocationInput != null) {
+ return {
+ modelInvocationInput: de_ModelInvocationInput(output.modelInvocationInput, context),
+ };
+ }
+ if (output.observation != null) {
+ return {
+ observation: _json(output.observation),
+ };
+ }
+ if (output.rationale != null) {
+ return {
+ rationale: _json(output.rationale),
+ };
+ }
+ return { $unknown: Object.entries(output)[0] };
+};
+
+// de_Parameter omitted.
+
+// de_Parameters omitted.
+
+/**
+ * deserializeAws_restJson1PayloadPart
+ */
+const de_PayloadPart = (output: any, context: __SerdeContext): PayloadPart => {
+ return take(output, {
+ attribution: _json,
+ bytes: context.base64Decoder,
+ }) as any;
+};
+
+// de_PostProcessingModelInvocationOutput omitted.
+
+// de_PostProcessingParsedResponse omitted.
+
+/**
+ * deserializeAws_restJson1PostProcessingTrace
+ */
+const de_PostProcessingTrace = (output: any, context: __SerdeContext): PostProcessingTrace => {
+ if (output.modelInvocationInput != null) {
+ return {
+ modelInvocationInput: de_ModelInvocationInput(output.modelInvocationInput, context),
+ };
+ }
+ if (output.modelInvocationOutput != null) {
+ return {
+ modelInvocationOutput: _json(output.modelInvocationOutput),
+ };
+ }
+ return { $unknown: Object.entries(output)[0] };
+};
+
+// de_PreProcessingModelInvocationOutput omitted.
+
+// de_PreProcessingParsedResponse omitted.
+
+/**
+ * deserializeAws_restJson1PreProcessingTrace
+ */
+const de_PreProcessingTrace = (output: any, context: __SerdeContext): PreProcessingTrace => {
+ if (output.modelInvocationInput != null) {
+ return {
+ modelInvocationInput: de_ModelInvocationInput(output.modelInvocationInput, context),
+ };
+ }
+ if (output.modelInvocationOutput != null) {
+ return {
+ modelInvocationOutput: _json(output.modelInvocationOutput),
+ };
+ }
+ return { $unknown: Object.entries(output)[0] };
+};
+
+// de_Rationale omitted.
+
+// de_RepromptResponse omitted.
+
+// de_RequestBody omitted.
+
+// de_RetrievalResultContent omitted.
+
+// de_RetrievalResultLocation omitted.
+
+// de_RetrievalResultS3Location omitted.
+
+// de_RetrieveAndGenerateOutput omitted.
+
+// de_RetrievedReference omitted.
+
+// de_RetrievedReferences omitted.
+
+// de_Span omitted.
+
+// de_StopSequences omitted.
+
+// de_TextResponsePart omitted.
+
+/**
+ * deserializeAws_restJson1Trace
+ */
+const de_Trace = (output: any, context: __SerdeContext): Trace => {
+ if (output.failureTrace != null) {
+ return {
+ failureTrace: _json(output.failureTrace),
+ };
+ }
+ if (output.orchestrationTrace != null) {
+ return {
+ orchestrationTrace: de_OrchestrationTrace(__expectUnion(output.orchestrationTrace), context),
+ };
+ }
+ if (output.postProcessingTrace != null) {
+ return {
+ postProcessingTrace: de_PostProcessingTrace(__expectUnion(output.postProcessingTrace), context),
+ };
+ }
+ if (output.preProcessingTrace != null) {
+ return {
+ preProcessingTrace: de_PreProcessingTrace(__expectUnion(output.preProcessingTrace), context),
+ };
+ }
+ return { $unknown: Object.entries(output)[0] };
+};
+
+/**
+ * deserializeAws_restJson1TracePart
+ */
+const de_TracePart = (output: any, context: __SerdeContext): TracePart => {
+ return take(output, {
+ agentAliasId: __expectString,
+ agentId: __expectString,
+ sessionId: __expectString,
+ trace: (_: any) => de_Trace(__expectUnion(_), context),
+ }) as any;
+};
+
+const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
+ httpStatusCode: output.statusCode,
+ requestId:
+ output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
+ extendedRequestId: output.headers["x-amz-id-2"],
+ cfId: output.headers["x-amz-cf-id"],
+});
+
+// Encode Uint8Array data into string with utf-8.
+const collectBodyString = (streamBody: any, context: __SerdeContext): Promise =>
+ collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
+
+const isSerializableHeaderValue = (value: any): boolean =>
+ value !== undefined &&
+ value !== null &&
+ value !== "" &&
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
+
+const parseBody = (streamBody: any, context: __SerdeContext): any =>
+ collectBodyString(streamBody, context).then((encoded) => {
+ if (encoded.length) {
+ return JSON.parse(encoded);
+ }
+ return {};
+ });
+
+const parseErrorBody = async (errorBody: any, context: __SerdeContext) => {
+ const value = await parseBody(errorBody, context);
+ value.message = value.message ?? value.Message;
+ return value;
+};
+
+/**
+ * Load an error code for the aws.rest-json-1.1 protocol.
+ */
+const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => {
+ const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
+
+ const sanitizeErrorCode = (rawValue: string | number): string => {
+ let cleanValue = rawValue;
+ if (typeof cleanValue === "number") {
+ cleanValue = cleanValue.toString();
+ }
+ if (cleanValue.indexOf(",") >= 0) {
+ cleanValue = cleanValue.split(",")[0];
+ }
+ if (cleanValue.indexOf(":") >= 0) {
+ cleanValue = cleanValue.split(":")[0];
+ }
+ if (cleanValue.indexOf("#") >= 0) {
+ cleanValue = cleanValue.split("#")[1];
+ }
+ return cleanValue;
+ };
+
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
+ if (headerKey !== undefined) {
+ return sanitizeErrorCode(output.headers[headerKey]);
+ }
+
+ if (data.code !== undefined) {
+ return sanitizeErrorCode(data.code);
+ }
+
+ if (data["__type"] !== undefined) {
+ return sanitizeErrorCode(data["__type"]);
+ }
+};
diff --git a/clients/client-bedrock-agent-runtime/src/runtimeConfig.browser.ts b/clients/client-bedrock-agent-runtime/src/runtimeConfig.browser.ts
new file mode 100644
index 000000000000..22627768d256
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/runtimeConfig.browser.ts
@@ -0,0 +1,46 @@
+// smithy-typescript generated code
+// @ts-ignore: package.json will be imported from dist folders
+import packageInfo from "../package.json"; // eslint-disable-line
+
+import { Sha256 } from "@aws-crypto/sha256-browser";
+import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
+import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver";
+import { eventStreamSerdeProvider } from "@smithy/eventstream-serde-browser";
+import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
+import { invalidProvider } from "@smithy/invalid-dependency";
+import { calculateBodyLength } from "@smithy/util-body-length-browser";
+import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry";
+import { BedrockAgentRuntimeClientConfig } from "./BedrockAgentRuntimeClient";
+import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
+import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
+import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser";
+
+/**
+ * @internal
+ */
+export const getRuntimeConfig = (config: BedrockAgentRuntimeClientConfig) => {
+ const defaultsMode = resolveDefaultsModeConfig(config);
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
+ const clientSharedValues = getSharedRuntimeConfig(config);
+ return {
+ ...clientSharedValues,
+ ...config,
+ runtime: "browser",
+ defaultsMode,
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
+ credentialDefaultProvider:
+ config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))),
+ defaultUserAgentProvider:
+ config?.defaultUserAgentProvider ??
+ defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
+ eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
+ maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
+ region: config?.region ?? invalidProvider("Region is missing"),
+ requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
+ retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
+ sha256: config?.sha256 ?? Sha256,
+ streamCollector: config?.streamCollector ?? streamCollector,
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
+ useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
+ };
+};
diff --git a/clients/client-bedrock-agent-runtime/src/runtimeConfig.native.ts b/clients/client-bedrock-agent-runtime/src/runtimeConfig.native.ts
new file mode 100644
index 000000000000..6d14993e3b1f
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/runtimeConfig.native.ts
@@ -0,0 +1,18 @@
+// smithy-typescript generated code
+import { Sha256 } from "@aws-crypto/sha256-js";
+
+import { BedrockAgentRuntimeClientConfig } from "./BedrockAgentRuntimeClient";
+import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
+
+/**
+ * @internal
+ */
+export const getRuntimeConfig = (config: BedrockAgentRuntimeClientConfig) => {
+ const browserDefaults = getBrowserRuntimeConfig(config);
+ return {
+ ...browserDefaults,
+ ...config,
+ runtime: "react-native",
+ sha256: config?.sha256 ?? Sha256,
+ };
+};
diff --git a/clients/client-bedrock-agent-runtime/src/runtimeConfig.shared.ts b/clients/client-bedrock-agent-runtime/src/runtimeConfig.shared.ts
new file mode 100644
index 000000000000..f6bf4a1e4e2b
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/runtimeConfig.shared.ts
@@ -0,0 +1,27 @@
+// smithy-typescript generated code
+import { NoOpLogger } from "@smithy/smithy-client";
+import { parseUrl } from "@smithy/url-parser";
+import { fromBase64, toBase64 } from "@smithy/util-base64";
+import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
+
+import { BedrockAgentRuntimeClientConfig } from "./BedrockAgentRuntimeClient";
+import { defaultEndpointResolver } from "./endpoint/endpointResolver";
+
+/**
+ * @internal
+ */
+export const getRuntimeConfig = (config: BedrockAgentRuntimeClientConfig) => {
+ return {
+ apiVersion: "2023-07-26",
+ base64Decoder: config?.base64Decoder ?? fromBase64,
+ base64Encoder: config?.base64Encoder ?? toBase64,
+ disableHostPrefix: config?.disableHostPrefix ?? false,
+ endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
+ extensions: config?.extensions ?? [],
+ logger: config?.logger ?? new NoOpLogger(),
+ serviceId: config?.serviceId ?? "Bedrock Agent Runtime",
+ urlParser: config?.urlParser ?? parseUrl,
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
+ utf8Encoder: config?.utf8Encoder ?? toUtf8,
+ };
+};
diff --git a/clients/client-bedrock-agent-runtime/src/runtimeConfig.ts b/clients/client-bedrock-agent-runtime/src/runtimeConfig.ts
new file mode 100644
index 000000000000..62490f87db15
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/runtimeConfig.ts
@@ -0,0 +1,63 @@
+// smithy-typescript generated code
+// @ts-ignore: package.json will be imported from dist folders
+import packageInfo from "../package.json"; // eslint-disable-line
+
+import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
+import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core";
+import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
+import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
+import {
+ NODE_REGION_CONFIG_FILE_OPTIONS,
+ NODE_REGION_CONFIG_OPTIONS,
+ NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,
+ NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,
+} from "@smithy/config-resolver";
+import { eventStreamSerdeProvider } from "@smithy/eventstream-serde-node";
+import { Hash } from "@smithy/hash-node";
+import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
+import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
+import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
+import { calculateBodyLength } from "@smithy/util-body-length-node";
+import { DEFAULT_RETRY_MODE } from "@smithy/util-retry";
+import { BedrockAgentRuntimeClientConfig } from "./BedrockAgentRuntimeClient";
+import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
+import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
+import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node";
+import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client";
+
+/**
+ * @internal
+ */
+export const getRuntimeConfig = (config: BedrockAgentRuntimeClientConfig) => {
+ emitWarningIfUnsupportedVersion(process.version);
+ const defaultsMode = resolveDefaultsModeConfig(config);
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
+ const clientSharedValues = getSharedRuntimeConfig(config);
+ awsCheckVersion(process.version);
+ return {
+ ...clientSharedValues,
+ ...config,
+ runtime: "node",
+ defaultsMode,
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
+ credentialDefaultProvider:
+ config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
+ defaultUserAgentProvider:
+ config?.defaultUserAgentProvider ??
+ defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
+ eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
+ maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
+ region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
+ requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
+ retryMode:
+ config?.retryMode ??
+ loadNodeConfig({
+ ...NODE_RETRY_MODE_CONFIG_OPTIONS,
+ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
+ }),
+ sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
+ streamCollector: config?.streamCollector ?? streamCollector,
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
+ useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
+ };
+};
diff --git a/clients/client-bedrock-agent-runtime/src/runtimeExtensions.ts b/clients/client-bedrock-agent-runtime/src/runtimeExtensions.ts
new file mode 100644
index 000000000000..e233d553e3e8
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/src/runtimeExtensions.ts
@@ -0,0 +1,45 @@
+// smithy-typescript generated code
+import {
+ getAwsRegionExtensionConfiguration,
+ resolveAwsRegionExtensionConfiguration,
+} from "@aws-sdk/region-config-resolver";
+import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http";
+import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client";
+
+import { BedrockAgentRuntimeExtensionConfiguration } from "./extensionConfiguration";
+
+/**
+ * @public
+ */
+export interface RuntimeExtension {
+ configure(extensionConfiguration: BedrockAgentRuntimeExtensionConfiguration): void;
+}
+
+/**
+ * @public
+ */
+export interface RuntimeExtensionsConfig {
+ extensions: RuntimeExtension[];
+}
+
+const asPartial = >(t: T) => t;
+
+/**
+ * @internal
+ */
+export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => {
+ const extensionConfiguration: BedrockAgentRuntimeExtensionConfiguration = {
+ ...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
+ ...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
+ ...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
+ };
+
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
+
+ return {
+ ...runtimeConfig,
+ ...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
+ ...resolveDefaultRuntimeConfig(extensionConfiguration),
+ ...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
+ };
+};
diff --git a/clients/client-bedrock-agent-runtime/tsconfig.cjs.json b/clients/client-bedrock-agent-runtime/tsconfig.cjs.json
new file mode 100644
index 000000000000..3567d85ba846
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/tsconfig.cjs.json
@@ -0,0 +1,6 @@
+{
+ "extends": "./tsconfig",
+ "compilerOptions": {
+ "outDir": "dist-cjs"
+ }
+}
diff --git a/clients/client-bedrock-agent-runtime/tsconfig.es.json b/clients/client-bedrock-agent-runtime/tsconfig.es.json
new file mode 100644
index 000000000000..809f57bde65e
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/tsconfig.es.json
@@ -0,0 +1,8 @@
+{
+ "extends": "./tsconfig",
+ "compilerOptions": {
+ "lib": ["dom"],
+ "module": "esnext",
+ "outDir": "dist-es"
+ }
+}
diff --git a/clients/client-bedrock-agent-runtime/tsconfig.json b/clients/client-bedrock-agent-runtime/tsconfig.json
new file mode 100644
index 000000000000..344909de2128
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/tsconfig.json
@@ -0,0 +1,13 @@
+{
+ "extends": "@tsconfig/node14/tsconfig.json",
+ "compilerOptions": {
+ "downlevelIteration": true,
+ "importHelpers": true,
+ "incremental": true,
+ "removeComments": true,
+ "resolveJsonModule": true,
+ "rootDir": "src",
+ "useUnknownInCatchVariables": false
+ },
+ "exclude": ["test/"]
+}
diff --git a/clients/client-bedrock-agent-runtime/tsconfig.types.json b/clients/client-bedrock-agent-runtime/tsconfig.types.json
new file mode 100644
index 000000000000..4c3dfa7b3d25
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/tsconfig.types.json
@@ -0,0 +1,10 @@
+{
+ "extends": "./tsconfig",
+ "compilerOptions": {
+ "removeComments": false,
+ "declaration": true,
+ "declarationDir": "dist-types",
+ "emitDeclarationOnly": true
+ },
+ "exclude": ["test/**/*", "dist-types/**/*"]
+}
diff --git a/clients/client-bedrock-agent-runtime/typedoc.json b/clients/client-bedrock-agent-runtime/typedoc.json
new file mode 100644
index 000000000000..8a364aa93b69
--- /dev/null
+++ b/clients/client-bedrock-agent-runtime/typedoc.json
@@ -0,0 +1,6 @@
+{
+ "extends": ["../../typedoc.client.json"],
+ "entryPoints": ["src/index.ts"],
+ "out": "docs",
+ "readme": "README.md"
+}
diff --git a/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json b/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json
new file mode 100644
index 000000000000..cbf69dedd640
--- /dev/null
+++ b/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json
@@ -0,0 +1,2454 @@
+{
+ "smithy": "2.0",
+ "shapes": {
+ "com.amazonaws.bedrockagentruntime#AccessDeniedException": {
+ "type": "structure",
+ "members": {
+ "message": {
+ "target": "com.amazonaws.bedrockagentruntime#NonBlankString"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "This exception is thrown when a request is denied per access permissions",
+ "smithy.api#error": "client",
+ "smithy.api#httpError": 403
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#ActionGroupInvocationInput": {
+ "type": "structure",
+ "members": {
+ "actionGroupName": {
+ "target": "com.amazonaws.bedrockagentruntime#ActionGroupName"
+ },
+ "verb": {
+ "target": "com.amazonaws.bedrockagentruntime#Verb"
+ },
+ "apiPath": {
+ "target": "com.amazonaws.bedrockagentruntime#ApiPath"
+ },
+ "parameters": {
+ "target": "com.amazonaws.bedrockagentruntime#Parameters"
+ },
+ "requestBody": {
+ "target": "com.amazonaws.bedrockagentruntime#RequestBody"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "input to lambda used in action group"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#ActionGroupInvocationOutput": {
+ "type": "structure",
+ "members": {
+ "text": {
+ "target": "com.amazonaws.bedrockagentruntime#ActionGroupOutputString"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "output from lambda used in action group"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#ActionGroupName": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Agent Trace Action Group Name",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#ActionGroupOutputString": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Agent Trace Action Group Lambda Invocation Output String",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#AgentAliasId": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Identifier of the agent alias.",
+ "smithy.api#length": {
+ "max": 10
+ },
+ "smithy.api#pattern": "^[0-9a-zA-Z]+$"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#AgentId": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Identifier of the agent.",
+ "smithy.api#length": {
+ "max": 10
+ },
+ "smithy.api#pattern": "^[0-9a-zA-Z]+$"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#AmazonBedrockAgentRunTimeService": {
+ "type": "service",
+ "version": "2023-07-26",
+ "resources": [
+ {
+ "target": "com.amazonaws.bedrockagentruntime#InferenceResource"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateResource"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#RetrieveResource"
+ }
+ ],
+ "traits": {
+ "aws.api#service": {
+ "sdkId": "Bedrock Agent Runtime",
+ "arnNamespace": "bedrock",
+ "endpointPrefix": "bedrock-agent-runtime",
+ "cloudTrailEventSource": "bedrock.amazonaws.com"
+ },
+ "aws.auth#sigv4": {
+ "name": "bedrock"
+ },
+ "aws.protocols#restJson1": {},
+ "smithy.api#documentation": "Amazon Bedrock Agent",
+ "smithy.api#title": "Agents for Amazon Bedrock Runtime",
+ "smithy.rules#endpointRuleSet": {
+ "version": "1.0",
+ "parameters": {
+ "Region": {
+ "builtIn": "AWS::Region",
+ "required": false,
+ "documentation": "The AWS region used to dispatch the request.",
+ "type": "String"
+ },
+ "UseDualStack": {
+ "builtIn": "AWS::UseDualStack",
+ "required": true,
+ "default": false,
+ "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.",
+ "type": "Boolean"
+ },
+ "UseFIPS": {
+ "builtIn": "AWS::UseFIPS",
+ "required": true,
+ "default": false,
+ "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.",
+ "type": "Boolean"
+ },
+ "Endpoint": {
+ "builtIn": "SDK::Endpoint",
+ "required": false,
+ "documentation": "Override the endpoint used to send this request",
+ "type": "String"
+ }
+ },
+ "rules": [
+ {
+ "conditions": [
+ {
+ "fn": "isSet",
+ "argv": [
+ {
+ "ref": "Endpoint"
+ }
+ ]
+ }
+ ],
+ "rules": [
+ {
+ "conditions": [
+ {
+ "fn": "booleanEquals",
+ "argv": [
+ {
+ "ref": "UseFIPS"
+ },
+ true
+ ]
+ }
+ ],
+ "error": "Invalid Configuration: FIPS and custom endpoint are not supported",
+ "type": "error"
+ },
+ {
+ "conditions": [],
+ "rules": [
+ {
+ "conditions": [
+ {
+ "fn": "booleanEquals",
+ "argv": [
+ {
+ "ref": "UseDualStack"
+ },
+ true
+ ]
+ }
+ ],
+ "error": "Invalid Configuration: Dualstack and custom endpoint are not supported",
+ "type": "error"
+ },
+ {
+ "conditions": [],
+ "endpoint": {
+ "url": {
+ "ref": "Endpoint"
+ },
+ "properties": {},
+ "headers": {}
+ },
+ "type": "endpoint"
+ }
+ ],
+ "type": "tree"
+ }
+ ],
+ "type": "tree"
+ },
+ {
+ "conditions": [],
+ "rules": [
+ {
+ "conditions": [
+ {
+ "fn": "isSet",
+ "argv": [
+ {
+ "ref": "Region"
+ }
+ ]
+ }
+ ],
+ "rules": [
+ {
+ "conditions": [
+ {
+ "fn": "aws.partition",
+ "argv": [
+ {
+ "ref": "Region"
+ }
+ ],
+ "assign": "PartitionResult"
+ }
+ ],
+ "rules": [
+ {
+ "conditions": [
+ {
+ "fn": "booleanEquals",
+ "argv": [
+ {
+ "ref": "UseFIPS"
+ },
+ true
+ ]
+ },
+ {
+ "fn": "booleanEquals",
+ "argv": [
+ {
+ "ref": "UseDualStack"
+ },
+ true
+ ]
+ }
+ ],
+ "rules": [
+ {
+ "conditions": [
+ {
+ "fn": "booleanEquals",
+ "argv": [
+ true,
+ {
+ "fn": "getAttr",
+ "argv": [
+ {
+ "ref": "PartitionResult"
+ },
+ "supportsFIPS"
+ ]
+ }
+ ]
+ },
+ {
+ "fn": "booleanEquals",
+ "argv": [
+ true,
+ {
+ "fn": "getAttr",
+ "argv": [
+ {
+ "ref": "PartitionResult"
+ },
+ "supportsDualStack"
+ ]
+ }
+ ]
+ }
+ ],
+ "rules": [
+ {
+ "conditions": [],
+ "rules": [
+ {
+ "conditions": [],
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
+ "properties": {},
+ "headers": {}
+ },
+ "type": "endpoint"
+ }
+ ],
+ "type": "tree"
+ }
+ ],
+ "type": "tree"
+ },
+ {
+ "conditions": [],
+ "error": "FIPS and DualStack are enabled, but this partition does not support one or both",
+ "type": "error"
+ }
+ ],
+ "type": "tree"
+ },
+ {
+ "conditions": [
+ {
+ "fn": "booleanEquals",
+ "argv": [
+ {
+ "ref": "UseFIPS"
+ },
+ true
+ ]
+ }
+ ],
+ "rules": [
+ {
+ "conditions": [
+ {
+ "fn": "booleanEquals",
+ "argv": [
+ {
+ "fn": "getAttr",
+ "argv": [
+ {
+ "ref": "PartitionResult"
+ },
+ "supportsFIPS"
+ ]
+ },
+ true
+ ]
+ }
+ ],
+ "rules": [
+ {
+ "conditions": [],
+ "rules": [
+ {
+ "conditions": [],
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime-fips.{Region}.{PartitionResult#dnsSuffix}",
+ "properties": {},
+ "headers": {}
+ },
+ "type": "endpoint"
+ }
+ ],
+ "type": "tree"
+ }
+ ],
+ "type": "tree"
+ },
+ {
+ "conditions": [],
+ "error": "FIPS is enabled but this partition does not support FIPS",
+ "type": "error"
+ }
+ ],
+ "type": "tree"
+ },
+ {
+ "conditions": [
+ {
+ "fn": "booleanEquals",
+ "argv": [
+ {
+ "ref": "UseDualStack"
+ },
+ true
+ ]
+ }
+ ],
+ "rules": [
+ {
+ "conditions": [
+ {
+ "fn": "booleanEquals",
+ "argv": [
+ true,
+ {
+ "fn": "getAttr",
+ "argv": [
+ {
+ "ref": "PartitionResult"
+ },
+ "supportsDualStack"
+ ]
+ }
+ ]
+ }
+ ],
+ "rules": [
+ {
+ "conditions": [],
+ "rules": [
+ {
+ "conditions": [],
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}",
+ "properties": {},
+ "headers": {}
+ },
+ "type": "endpoint"
+ }
+ ],
+ "type": "tree"
+ }
+ ],
+ "type": "tree"
+ },
+ {
+ "conditions": [],
+ "error": "DualStack is enabled but this partition does not support DualStack",
+ "type": "error"
+ }
+ ],
+ "type": "tree"
+ },
+ {
+ "conditions": [],
+ "rules": [
+ {
+ "conditions": [],
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime.{Region}.{PartitionResult#dnsSuffix}",
+ "properties": {},
+ "headers": {}
+ },
+ "type": "endpoint"
+ }
+ ],
+ "type": "tree"
+ }
+ ],
+ "type": "tree"
+ }
+ ],
+ "type": "tree"
+ },
+ {
+ "conditions": [],
+ "error": "Invalid Configuration: Missing Region",
+ "type": "error"
+ }
+ ],
+ "type": "tree"
+ }
+ ]
+ },
+ "smithy.rules#endpointTests": {
+ "testCases": [
+ {
+ "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled",
+ "expect": {
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime-fips.us-east-1.api.aws"
+ }
+ },
+ "params": {
+ "Region": "us-east-1",
+ "UseFIPS": true,
+ "UseDualStack": true
+ }
+ },
+ {
+ "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled",
+ "expect": {
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime-fips.us-east-1.amazonaws.com"
+ }
+ },
+ "params": {
+ "Region": "us-east-1",
+ "UseFIPS": true,
+ "UseDualStack": false
+ }
+ },
+ {
+ "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled",
+ "expect": {
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime.us-east-1.api.aws"
+ }
+ },
+ "params": {
+ "Region": "us-east-1",
+ "UseFIPS": false,
+ "UseDualStack": true
+ }
+ },
+ {
+ "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled",
+ "expect": {
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime.us-east-1.amazonaws.com"
+ }
+ },
+ "params": {
+ "Region": "us-east-1",
+ "UseFIPS": false,
+ "UseDualStack": false
+ }
+ },
+ {
+ "documentation": "For region cn-north-1 with FIPS enabled and DualStack enabled",
+ "expect": {
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime-fips.cn-north-1.api.amazonwebservices.com.cn"
+ }
+ },
+ "params": {
+ "Region": "cn-north-1",
+ "UseFIPS": true,
+ "UseDualStack": true
+ }
+ },
+ {
+ "documentation": "For region cn-north-1 with FIPS enabled and DualStack disabled",
+ "expect": {
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime-fips.cn-north-1.amazonaws.com.cn"
+ }
+ },
+ "params": {
+ "Region": "cn-north-1",
+ "UseFIPS": true,
+ "UseDualStack": false
+ }
+ },
+ {
+ "documentation": "For region cn-north-1 with FIPS disabled and DualStack enabled",
+ "expect": {
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime.cn-north-1.api.amazonwebservices.com.cn"
+ }
+ },
+ "params": {
+ "Region": "cn-north-1",
+ "UseFIPS": false,
+ "UseDualStack": true
+ }
+ },
+ {
+ "documentation": "For region cn-north-1 with FIPS disabled and DualStack disabled",
+ "expect": {
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime.cn-north-1.amazonaws.com.cn"
+ }
+ },
+ "params": {
+ "Region": "cn-north-1",
+ "UseFIPS": false,
+ "UseDualStack": false
+ }
+ },
+ {
+ "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack enabled",
+ "expect": {
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime-fips.us-gov-east-1.api.aws"
+ }
+ },
+ "params": {
+ "Region": "us-gov-east-1",
+ "UseFIPS": true,
+ "UseDualStack": true
+ }
+ },
+ {
+ "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack disabled",
+ "expect": {
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime-fips.us-gov-east-1.amazonaws.com"
+ }
+ },
+ "params": {
+ "Region": "us-gov-east-1",
+ "UseFIPS": true,
+ "UseDualStack": false
+ }
+ },
+ {
+ "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack enabled",
+ "expect": {
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime.us-gov-east-1.api.aws"
+ }
+ },
+ "params": {
+ "Region": "us-gov-east-1",
+ "UseFIPS": false,
+ "UseDualStack": true
+ }
+ },
+ {
+ "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack disabled",
+ "expect": {
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime.us-gov-east-1.amazonaws.com"
+ }
+ },
+ "params": {
+ "Region": "us-gov-east-1",
+ "UseFIPS": false,
+ "UseDualStack": false
+ }
+ },
+ {
+ "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack enabled",
+ "expect": {
+ "error": "FIPS and DualStack are enabled, but this partition does not support one or both"
+ },
+ "params": {
+ "Region": "us-iso-east-1",
+ "UseFIPS": true,
+ "UseDualStack": true
+ }
+ },
+ {
+ "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled",
+ "expect": {
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime-fips.us-iso-east-1.c2s.ic.gov"
+ }
+ },
+ "params": {
+ "Region": "us-iso-east-1",
+ "UseFIPS": true,
+ "UseDualStack": false
+ }
+ },
+ {
+ "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack enabled",
+ "expect": {
+ "error": "DualStack is enabled but this partition does not support DualStack"
+ },
+ "params": {
+ "Region": "us-iso-east-1",
+ "UseFIPS": false,
+ "UseDualStack": true
+ }
+ },
+ {
+ "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled",
+ "expect": {
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime.us-iso-east-1.c2s.ic.gov"
+ }
+ },
+ "params": {
+ "Region": "us-iso-east-1",
+ "UseFIPS": false,
+ "UseDualStack": false
+ }
+ },
+ {
+ "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack enabled",
+ "expect": {
+ "error": "FIPS and DualStack are enabled, but this partition does not support one or both"
+ },
+ "params": {
+ "Region": "us-isob-east-1",
+ "UseFIPS": true,
+ "UseDualStack": true
+ }
+ },
+ {
+ "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack disabled",
+ "expect": {
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime-fips.us-isob-east-1.sc2s.sgov.gov"
+ }
+ },
+ "params": {
+ "Region": "us-isob-east-1",
+ "UseFIPS": true,
+ "UseDualStack": false
+ }
+ },
+ {
+ "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack enabled",
+ "expect": {
+ "error": "DualStack is enabled but this partition does not support DualStack"
+ },
+ "params": {
+ "Region": "us-isob-east-1",
+ "UseFIPS": false,
+ "UseDualStack": true
+ }
+ },
+ {
+ "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack disabled",
+ "expect": {
+ "endpoint": {
+ "url": "https://bedrock-agent-runtime.us-isob-east-1.sc2s.sgov.gov"
+ }
+ },
+ "params": {
+ "Region": "us-isob-east-1",
+ "UseFIPS": false,
+ "UseDualStack": false
+ }
+ },
+ {
+ "documentation": "For custom endpoint with region set and fips disabled and dualstack disabled",
+ "expect": {
+ "endpoint": {
+ "url": "https://example.com"
+ }
+ },
+ "params": {
+ "Region": "us-east-1",
+ "UseFIPS": false,
+ "UseDualStack": false,
+ "Endpoint": "https://example.com"
+ }
+ },
+ {
+ "documentation": "For custom endpoint with region not set and fips disabled and dualstack disabled",
+ "expect": {
+ "endpoint": {
+ "url": "https://example.com"
+ }
+ },
+ "params": {
+ "UseFIPS": false,
+ "UseDualStack": false,
+ "Endpoint": "https://example.com"
+ }
+ },
+ {
+ "documentation": "For custom endpoint with fips enabled and dualstack disabled",
+ "expect": {
+ "error": "Invalid Configuration: FIPS and custom endpoint are not supported"
+ },
+ "params": {
+ "Region": "us-east-1",
+ "UseFIPS": true,
+ "UseDualStack": false,
+ "Endpoint": "https://example.com"
+ }
+ },
+ {
+ "documentation": "For custom endpoint with fips disabled and dualstack enabled",
+ "expect": {
+ "error": "Invalid Configuration: Dualstack and custom endpoint are not supported"
+ },
+ "params": {
+ "Region": "us-east-1",
+ "UseFIPS": false,
+ "UseDualStack": true,
+ "Endpoint": "https://example.com"
+ }
+ },
+ {
+ "documentation": "Missing region",
+ "expect": {
+ "error": "Invalid Configuration: Missing Region"
+ }
+ }
+ ],
+ "version": "1.0"
+ }
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#ApiPath": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Agent Trace Action Group API path",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#Attribution": {
+ "type": "structure",
+ "members": {
+ "citations": {
+ "target": "com.amazonaws.bedrockagentruntime#Citations"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Citations associated with final agent response"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#BadGatewayException": {
+ "type": "structure",
+ "members": {
+ "message": {
+ "target": "com.amazonaws.bedrockagentruntime#NonBlankString"
+ },
+ "resourceName": {
+ "target": "com.amazonaws.bedrockagentruntime#NonBlankString"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "This exception is thrown when a request fails due to dependency like Lambda, Bedrock, STS resource",
+ "smithy.api#error": "server",
+ "smithy.api#httpError": 502
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#BedrockModelArn": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Arn of a Bedrock model.",
+ "smithy.api#length": {
+ "min": 20,
+ "max": 1011
+ },
+ "smithy.api#pattern": "^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}))$"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#Citation": {
+ "type": "structure",
+ "members": {
+ "generatedResponsePart": {
+ "target": "com.amazonaws.bedrockagentruntime#GeneratedResponsePart"
+ },
+ "retrievedReferences": {
+ "target": "com.amazonaws.bedrockagentruntime#RetrievedReferences"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Citation associated with the agent response"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#Citations": {
+ "type": "list",
+ "member": {
+ "target": "com.amazonaws.bedrockagentruntime#Citation"
+ },
+ "traits": {
+ "smithy.api#documentation": "List of citations"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#ConflictException": {
+ "type": "structure",
+ "members": {
+ "message": {
+ "target": "com.amazonaws.bedrockagentruntime#NonBlankString"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "This exception is thrown when there is a conflict performing an operation",
+ "smithy.api#error": "client",
+ "smithy.api#httpError": 409
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#ContentMap": {
+ "type": "map",
+ "key": {
+ "target": "smithy.api#String"
+ },
+ "value": {
+ "target": "com.amazonaws.bedrockagentruntime#Parameters"
+ },
+ "traits": {
+ "smithy.api#documentation": "Content type paramter map"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#CreationMode": {
+ "type": "enum",
+ "members": {
+ "DEFAULT": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "DEFAULT"
+ }
+ },
+ "OVERRIDDEN": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "OVERRIDDEN"
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "indicates if agent uses default prompt or overriden prompt"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#DependencyFailedException": {
+ "type": "structure",
+ "members": {
+ "message": {
+ "target": "com.amazonaws.bedrockagentruntime#NonBlankString"
+ },
+ "resourceName": {
+ "target": "com.amazonaws.bedrockagentruntime#NonBlankString"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "This exception is thrown when a request fails due to dependency like Lambda, Bedrock, STS resource due to a customer fault (i.e. bad configuration)",
+ "smithy.api#error": "client",
+ "smithy.api#httpError": 424
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#FailureReasonString": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Agent Trace Failed Reason String",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#FailureTrace": {
+ "type": "structure",
+ "members": {
+ "traceId": {
+ "target": "com.amazonaws.bedrockagentruntime#TraceId"
+ },
+ "failureReason": {
+ "target": "com.amazonaws.bedrockagentruntime#FailureReasonString"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Trace Part which is emitted when agent trace could not be generated",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#FinalResponse": {
+ "type": "structure",
+ "members": {
+ "text": {
+ "target": "com.amazonaws.bedrockagentruntime#FinalResponseString"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Agent finish output"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#FinalResponseString": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Agent Trace Action Group Lambda Invocation Output String",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#GeneratedResponsePart": {
+ "type": "structure",
+ "members": {
+ "textResponsePart": {
+ "target": "com.amazonaws.bedrockagentruntime#TextResponsePart"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Generate response part"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#InferenceConfiguration": {
+ "type": "structure",
+ "members": {
+ "temperature": {
+ "target": "com.amazonaws.bedrockagentruntime#Temperature"
+ },
+ "topP": {
+ "target": "com.amazonaws.bedrockagentruntime#TopP"
+ },
+ "topK": {
+ "target": "com.amazonaws.bedrockagentruntime#TopK"
+ },
+ "maximumLength": {
+ "target": "com.amazonaws.bedrockagentruntime#MaximumLength"
+ },
+ "stopSequences": {
+ "target": "com.amazonaws.bedrockagentruntime#StopSequences"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Configurations for controlling the inference response of an InvokeAgent API call"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#InferenceResource": {
+ "type": "resource",
+ "operations": [
+ {
+ "target": "com.amazonaws.bedrockagentruntime#InvokeAgent"
+ }
+ ]
+ },
+ "com.amazonaws.bedrockagentruntime#InputText": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Model text input",
+ "smithy.api#length": {
+ "max": 25000000
+ },
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#InternalServerException": {
+ "type": "structure",
+ "members": {
+ "message": {
+ "target": "com.amazonaws.bedrockagentruntime#NonBlankString"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "This exception is thrown if there was an unexpected error during processing of request",
+ "smithy.api#error": "server",
+ "smithy.api#httpError": 500
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#InvocationInput": {
+ "type": "structure",
+ "members": {
+ "traceId": {
+ "target": "com.amazonaws.bedrockagentruntime#TraceId"
+ },
+ "invocationType": {
+ "target": "com.amazonaws.bedrockagentruntime#InvocationType"
+ },
+ "actionGroupInvocationInput": {
+ "target": "com.amazonaws.bedrockagentruntime#ActionGroupInvocationInput"
+ },
+ "knowledgeBaseLookupInput": {
+ "target": "com.amazonaws.bedrockagentruntime#KnowledgeBaseLookupInput"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Trace Part which contains input details for action group or knowledge base",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#InvocationType": {
+ "type": "enum",
+ "members": {
+ "ACTION_GROUP": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "ACTION_GROUP"
+ }
+ },
+ "KNOWLEDGE_BASE": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "KNOWLEDGE_BASE"
+ }
+ },
+ "FINISH": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "FINISH"
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "types of invocations"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#InvokeAgent": {
+ "type": "operation",
+ "input": {
+ "target": "com.amazonaws.bedrockagentruntime#InvokeAgentRequest"
+ },
+ "output": {
+ "target": "com.amazonaws.bedrockagentruntime#InvokeAgentResponse"
+ },
+ "errors": [
+ {
+ "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#BadGatewayException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#ConflictException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#DependencyFailedException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#InternalServerException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#ResourceNotFoundException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#ThrottlingException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#ValidationException"
+ }
+ ],
+ "traits": {
+ "smithy.api#documentation": "Invokes the specified Bedrock model to run inference using the input provided in the request body.",
+ "smithy.api#http": {
+ "code": 200,
+ "method": "POST",
+ "uri": "/agents/{agentId}/agentAliases/{agentAliasId}/sessions/{sessionId}/text"
+ }
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#InvokeAgentRequest": {
+ "type": "structure",
+ "members": {
+ "sessionState": {
+ "target": "com.amazonaws.bedrockagentruntime#SessionState",
+ "traits": {
+ "smithy.api#documentation": "Session state passed by customer. Base64 encoded json string representation of SessionState."
+ }
+ },
+ "agentId": {
+ "target": "com.amazonaws.bedrockagentruntime#AgentId",
+ "traits": {
+ "smithy.api#documentation": "Identifier for Agent",
+ "smithy.api#httpLabel": {},
+ "smithy.api#required": {}
+ }
+ },
+ "agentAliasId": {
+ "target": "com.amazonaws.bedrockagentruntime#AgentAliasId",
+ "traits": {
+ "smithy.api#documentation": "Identifier for Agent Alias",
+ "smithy.api#httpLabel": {},
+ "smithy.api#required": {}
+ }
+ },
+ "sessionId": {
+ "target": "com.amazonaws.bedrockagentruntime#SessionId",
+ "traits": {
+ "smithy.api#documentation": "Identifier used for the current session",
+ "smithy.api#httpLabel": {},
+ "smithy.api#required": {}
+ }
+ },
+ "endSession": {
+ "target": "smithy.api#Boolean",
+ "traits": {
+ "smithy.api#documentation": "End current session"
+ }
+ },
+ "enableTrace": {
+ "target": "smithy.api#Boolean",
+ "traits": {
+ "smithy.api#documentation": "Enable agent trace events for improved debugging"
+ }
+ },
+ "inputText": {
+ "target": "com.amazonaws.bedrockagentruntime#InputText",
+ "traits": {
+ "smithy.api#documentation": "Input data in the format specified in the Content-Type request header.",
+ "smithy.api#required": {}
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "InvokeAgent Request",
+ "smithy.api#input": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#InvokeAgentResponse": {
+ "type": "structure",
+ "members": {
+ "completion": {
+ "target": "com.amazonaws.bedrockagentruntime#ResponseStream",
+ "traits": {
+ "smithy.api#documentation": "Inference response from the model in the format specified in the Content-Type response header.",
+ "smithy.api#httpPayload": {},
+ "smithy.api#required": {}
+ }
+ },
+ "contentType": {
+ "target": "com.amazonaws.bedrockagentruntime#MimeType",
+ "traits": {
+ "smithy.api#documentation": "streaming response mimetype of the model",
+ "smithy.api#httpHeader": "x-amzn-bedrock-agent-content-type",
+ "smithy.api#required": {}
+ }
+ },
+ "sessionId": {
+ "target": "com.amazonaws.bedrockagentruntime#SessionId",
+ "traits": {
+ "smithy.api#documentation": "streaming response mimetype of the model",
+ "smithy.api#httpHeader": "x-amz-bedrock-agent-session-id",
+ "smithy.api#required": {}
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "InvokeAgent Response",
+ "smithy.api#output": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#KmsKeyArn": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "A KMS key ARN",
+ "smithy.api#length": {
+ "min": 1,
+ "max": 2048
+ },
+ "smithy.api#pattern": "^arn:aws(|-cn|-us-gov):kms:[a-zA-Z0-9-]*:[0-9]{12}:key/[a-zA-Z0-9-]{36}$"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#KnowledgeBaseId": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Identifier of the KnowledgeBase",
+ "smithy.api#length": {
+ "max": 10
+ },
+ "smithy.api#pattern": "^[0-9a-zA-Z]+$"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#KnowledgeBaseLookupInput": {
+ "type": "structure",
+ "members": {
+ "text": {
+ "target": "com.amazonaws.bedrockagentruntime#KnowledgeBaseLookupInputString"
+ },
+ "knowledgeBaseId": {
+ "target": "com.amazonaws.bedrockagentruntime#TraceKnowledgeBaseId"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Input to lambda used in action group"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#KnowledgeBaseLookupInputString": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Agent Trace Action Group Lambda Invocation Output String",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#KnowledgeBaseLookupOutput": {
+ "type": "structure",
+ "members": {
+ "retrievedReferences": {
+ "target": "com.amazonaws.bedrockagentruntime#RetrievedReferences"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Input to lambda used in action group"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#KnowledgeBaseQuery": {
+ "type": "structure",
+ "members": {
+ "text": {
+ "target": "smithy.api#String",
+ "traits": {
+ "smithy.api#documentation": "Knowledge base input query in text",
+ "smithy.api#length": {
+ "max": 1000
+ },
+ "smithy.api#required": {}
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Knowledge base input query.",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#KnowledgeBaseRetrievalConfiguration": {
+ "type": "structure",
+ "members": {
+ "vectorSearchConfiguration": {
+ "target": "com.amazonaws.bedrockagentruntime#KnowledgeBaseVectorSearchConfiguration",
+ "traits": {
+ "smithy.api#required": {}
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Search parameters for retrieving from knowledge base."
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#KnowledgeBaseRetrievalResult": {
+ "type": "structure",
+ "members": {
+ "content": {
+ "target": "com.amazonaws.bedrockagentruntime#RetrievalResultContent",
+ "traits": {
+ "smithy.api#required": {}
+ }
+ },
+ "location": {
+ "target": "com.amazonaws.bedrockagentruntime#RetrievalResultLocation"
+ },
+ "score": {
+ "target": "smithy.api#Double",
+ "traits": {
+ "smithy.api#documentation": "The relevance score of a result."
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Result item returned from a knowledge base retrieval."
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#KnowledgeBaseRetrievalResults": {
+ "type": "list",
+ "member": {
+ "target": "com.amazonaws.bedrockagentruntime#KnowledgeBaseRetrievalResult"
+ },
+ "traits": {
+ "smithy.api#documentation": "List of knowledge base retrieval results",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#KnowledgeBaseRetrieveAndGenerateConfiguration": {
+ "type": "structure",
+ "members": {
+ "knowledgeBaseId": {
+ "target": "com.amazonaws.bedrockagentruntime#KnowledgeBaseId",
+ "traits": {
+ "smithy.api#required": {}
+ }
+ },
+ "modelArn": {
+ "target": "com.amazonaws.bedrockagentruntime#BedrockModelArn",
+ "traits": {
+ "smithy.api#required": {}
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Configurations for retrieval and generation for knowledge base."
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#KnowledgeBaseVectorSearchConfiguration": {
+ "type": "structure",
+ "members": {
+ "numberOfResults": {
+ "target": "smithy.api#Integer",
+ "traits": {
+ "smithy.api#documentation": "Top-K results to retrieve from knowledge base.",
+ "smithy.api#range": {
+ "min": 1,
+ "max": 10
+ },
+ "smithy.api#required": {}
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Knowledge base vector search configuration"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#LambdaArn": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "ARN of a Lambda."
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#MaximumLength": {
+ "type": "integer",
+ "traits": {
+ "smithy.api#documentation": "Maximum length of output",
+ "smithy.api#range": {
+ "min": 0,
+ "max": 4096
+ }
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#MimeType": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Content type of the request"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#ModelInvocationInput": {
+ "type": "structure",
+ "members": {
+ "traceId": {
+ "target": "com.amazonaws.bedrockagentruntime#TraceId"
+ },
+ "text": {
+ "target": "com.amazonaws.bedrockagentruntime#PromptText"
+ },
+ "type": {
+ "target": "com.amazonaws.bedrockagentruntime#PromptType"
+ },
+ "inferenceConfiguration": {
+ "target": "com.amazonaws.bedrockagentruntime#InferenceConfiguration"
+ },
+ "overrideLambda": {
+ "target": "com.amazonaws.bedrockagentruntime#LambdaArn"
+ },
+ "promptCreationMode": {
+ "target": "com.amazonaws.bedrockagentruntime#CreationMode"
+ },
+ "parserMode": {
+ "target": "com.amazonaws.bedrockagentruntime#CreationMode"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Trace Part which contains information used to call Invoke Model",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#NextToken": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Opaque continuation token of previous paginated response.",
+ "smithy.api#length": {
+ "min": 1,
+ "max": 2048
+ },
+ "smithy.api#pattern": "^\\S*$"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#NonBlankString": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Non Blank String",
+ "smithy.api#pattern": "^[\\s\\S]*$"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#Observation": {
+ "type": "structure",
+ "members": {
+ "traceId": {
+ "target": "com.amazonaws.bedrockagentruntime#TraceId"
+ },
+ "type": {
+ "target": "com.amazonaws.bedrockagentruntime#Type"
+ },
+ "actionGroupInvocationOutput": {
+ "target": "com.amazonaws.bedrockagentruntime#ActionGroupInvocationOutput"
+ },
+ "knowledgeBaseLookupOutput": {
+ "target": "com.amazonaws.bedrockagentruntime#KnowledgeBaseLookupOutput"
+ },
+ "finalResponse": {
+ "target": "com.amazonaws.bedrockagentruntime#FinalResponse"
+ },
+ "repromptResponse": {
+ "target": "com.amazonaws.bedrockagentruntime#RepromptResponse"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Trace Part which contains output details for action group or knowledge base or final response",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#OrchestrationTrace": {
+ "type": "union",
+ "members": {
+ "rationale": {
+ "target": "com.amazonaws.bedrockagentruntime#Rationale"
+ },
+ "invocationInput": {
+ "target": "com.amazonaws.bedrockagentruntime#InvocationInput"
+ },
+ "observation": {
+ "target": "com.amazonaws.bedrockagentruntime#Observation"
+ },
+ "modelInvocationInput": {
+ "target": "com.amazonaws.bedrockagentruntime#ModelInvocationInput"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Trace contains intermidate response during orchestration",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#OutputString": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Agent Trace Output String",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#Parameter": {
+ "type": "structure",
+ "members": {
+ "name": {
+ "target": "smithy.api#String",
+ "traits": {
+ "smithy.api#documentation": "Name of parameter"
+ }
+ },
+ "type": {
+ "target": "smithy.api#String",
+ "traits": {
+ "smithy.api#documentation": "Type of parameter"
+ }
+ },
+ "value": {
+ "target": "smithy.api#String",
+ "traits": {
+ "smithy.api#documentation": "Value of parameter"
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "parameters included in action group invocation"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#Parameters": {
+ "type": "list",
+ "member": {
+ "target": "com.amazonaws.bedrockagentruntime#Parameter"
+ },
+ "traits": {
+ "smithy.api#documentation": "list of parameters included in action group invocation"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#PartBody": {
+ "type": "blob",
+ "traits": {
+ "smithy.api#documentation": "PartBody of the payload in bytes",
+ "smithy.api#length": {
+ "max": 1000000
+ },
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#PayloadPart": {
+ "type": "structure",
+ "members": {
+ "bytes": {
+ "target": "com.amazonaws.bedrockagentruntime#PartBody"
+ },
+ "attribution": {
+ "target": "com.amazonaws.bedrockagentruntime#Attribution"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Base 64 endoded byte response",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#PostProcessingModelInvocationOutput": {
+ "type": "structure",
+ "members": {
+ "traceId": {
+ "target": "com.amazonaws.bedrockagentruntime#TraceId"
+ },
+ "parsedResponse": {
+ "target": "com.amazonaws.bedrockagentruntime#PostProcessingParsedResponse"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Trace Part which contains information related to postprocessing",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#PostProcessingParsedResponse": {
+ "type": "structure",
+ "members": {
+ "text": {
+ "target": "com.amazonaws.bedrockagentruntime#OutputString"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Trace Part which contains information if preprocessing was successful",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#PostProcessingTrace": {
+ "type": "union",
+ "members": {
+ "modelInvocationInput": {
+ "target": "com.amazonaws.bedrockagentruntime#ModelInvocationInput"
+ },
+ "modelInvocationOutput": {
+ "target": "com.amazonaws.bedrockagentruntime#PostProcessingModelInvocationOutput"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Trace Part which contains information related to post processing step",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#PreProcessingModelInvocationOutput": {
+ "type": "structure",
+ "members": {
+ "traceId": {
+ "target": "com.amazonaws.bedrockagentruntime#TraceId"
+ },
+ "parsedResponse": {
+ "target": "com.amazonaws.bedrockagentruntime#PreProcessingParsedResponse"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Trace Part which contains information related to preprocessing",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#PreProcessingParsedResponse": {
+ "type": "structure",
+ "members": {
+ "rationale": {
+ "target": "com.amazonaws.bedrockagentruntime#RationaleString"
+ },
+ "isValid": {
+ "target": "smithy.api#Boolean",
+ "traits": {
+ "smithy.api#documentation": "Boolean value"
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Trace Part which contains information if preprocessing was successful",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#PreProcessingTrace": {
+ "type": "union",
+ "members": {
+ "modelInvocationInput": {
+ "target": "com.amazonaws.bedrockagentruntime#ModelInvocationInput"
+ },
+ "modelInvocationOutput": {
+ "target": "com.amazonaws.bedrockagentruntime#PreProcessingModelInvocationOutput"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Trace Part which contains information related to preprocessing step",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#PromptSessionAttributesMap": {
+ "type": "map",
+ "key": {
+ "target": "smithy.api#String"
+ },
+ "value": {
+ "target": "smithy.api#String"
+ },
+ "traits": {
+ "smithy.api#documentation": "Session attributes that go to the prompt"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#PromptText": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Prompt Message",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#PromptType": {
+ "type": "enum",
+ "members": {
+ "PRE_PROCESSING": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "PRE_PROCESSING"
+ }
+ },
+ "ORCHESTRATION": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "ORCHESTRATION"
+ }
+ },
+ "KNOWLEDGE_BASE_RESPONSE_GENERATION": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "KNOWLEDGE_BASE_RESPONSE_GENERATION"
+ }
+ },
+ "POST_PROCESSING": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "POST_PROCESSING"
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "types of prompts"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#Rationale": {
+ "type": "structure",
+ "members": {
+ "traceId": {
+ "target": "com.amazonaws.bedrockagentruntime#TraceId"
+ },
+ "text": {
+ "target": "com.amazonaws.bedrockagentruntime#RationaleString"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Trace Part which contains information related to reasoning",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RationaleString": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Agent Trace Rationale String",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RepromptResponse": {
+ "type": "structure",
+ "members": {
+ "text": {
+ "target": "smithy.api#String",
+ "traits": {
+ "smithy.api#documentation": "Reprompt response text"
+ }
+ },
+ "source": {
+ "target": "com.amazonaws.bedrockagentruntime#Source"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Observation information if there were reprompts",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RequestBody": {
+ "type": "structure",
+ "members": {
+ "content": {
+ "target": "com.amazonaws.bedrockagentruntime#ContentMap"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Request Body Content Map"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#ResourceNotFoundException": {
+ "type": "structure",
+ "members": {
+ "message": {
+ "target": "com.amazonaws.bedrockagentruntime#NonBlankString"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "This exception is thrown when a resource referenced by the operation does not exist",
+ "smithy.api#error": "client",
+ "smithy.api#httpError": 404
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#ResponseStream": {
+ "type": "union",
+ "members": {
+ "chunk": {
+ "target": "com.amazonaws.bedrockagentruntime#PayloadPart"
+ },
+ "trace": {
+ "target": "com.amazonaws.bedrockagentruntime#TracePart"
+ },
+ "internalServerException": {
+ "target": "com.amazonaws.bedrockagentruntime#InternalServerException"
+ },
+ "validationException": {
+ "target": "com.amazonaws.bedrockagentruntime#ValidationException"
+ },
+ "resourceNotFoundException": {
+ "target": "com.amazonaws.bedrockagentruntime#ResourceNotFoundException"
+ },
+ "serviceQuotaExceededException": {
+ "target": "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"
+ },
+ "throttlingException": {
+ "target": "com.amazonaws.bedrockagentruntime#ThrottlingException"
+ },
+ "accessDeniedException": {
+ "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException"
+ },
+ "conflictException": {
+ "target": "com.amazonaws.bedrockagentruntime#ConflictException"
+ },
+ "dependencyFailedException": {
+ "target": "com.amazonaws.bedrockagentruntime#DependencyFailedException"
+ },
+ "badGatewayException": {
+ "target": "com.amazonaws.bedrockagentruntime#BadGatewayException"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Response body of is a stream",
+ "smithy.api#streaming": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RetrievalResultContent": {
+ "type": "structure",
+ "members": {
+ "text": {
+ "target": "smithy.api#String",
+ "traits": {
+ "smithy.api#documentation": "Content of a retrieval result in text",
+ "smithy.api#required": {}
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Content of a retrieval result."
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RetrievalResultLocation": {
+ "type": "structure",
+ "members": {
+ "type": {
+ "target": "com.amazonaws.bedrockagentruntime#RetrievalResultLocationType",
+ "traits": {
+ "smithy.api#required": {}
+ }
+ },
+ "s3Location": {
+ "target": "com.amazonaws.bedrockagentruntime#RetrievalResultS3Location"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "The source location of a retrieval result."
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RetrievalResultLocationType": {
+ "type": "enum",
+ "members": {
+ "S3": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "S3"
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "The location type of a retrieval result."
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RetrievalResultS3Location": {
+ "type": "structure",
+ "members": {
+ "uri": {
+ "target": "smithy.api#String",
+ "traits": {
+ "smithy.api#documentation": "URI of S3 location"
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "The S3 location of a retrieval result."
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#Retrieve": {
+ "type": "operation",
+ "input": {
+ "target": "com.amazonaws.bedrockagentruntime#RetrieveRequest"
+ },
+ "output": {
+ "target": "com.amazonaws.bedrockagentruntime#RetrieveResponse"
+ },
+ "errors": [
+ {
+ "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#BadGatewayException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#ConflictException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#DependencyFailedException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#InternalServerException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#ResourceNotFoundException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#ThrottlingException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#ValidationException"
+ }
+ ],
+ "traits": {
+ "smithy.api#documentation": "Retrieve from knowledge base.",
+ "smithy.api#http": {
+ "code": 200,
+ "method": "POST",
+ "uri": "/knowledgebases/{knowledgeBaseId}/retrieve"
+ },
+ "smithy.api#paginated": {
+ "inputToken": "nextToken",
+ "outputToken": "nextToken",
+ "items": "retrievalResults"
+ },
+ "smithy.api#readonly": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RetrieveAndGenerate": {
+ "type": "operation",
+ "input": {
+ "target": "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateRequest"
+ },
+ "output": {
+ "target": "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateResponse"
+ },
+ "errors": [
+ {
+ "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#BadGatewayException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#ConflictException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#DependencyFailedException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#InternalServerException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#ResourceNotFoundException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#ThrottlingException"
+ },
+ {
+ "target": "com.amazonaws.bedrockagentruntime#ValidationException"
+ }
+ ],
+ "traits": {
+ "smithy.api#documentation": "RetrieveAndGenerate API",
+ "smithy.api#http": {
+ "code": 200,
+ "method": "POST",
+ "uri": "/retrieveAndGenerate"
+ }
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateConfiguration": {
+ "type": "structure",
+ "members": {
+ "type": {
+ "target": "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateType",
+ "traits": {
+ "smithy.api#required": {}
+ }
+ },
+ "knowledgeBaseConfiguration": {
+ "target": "com.amazonaws.bedrockagentruntime#KnowledgeBaseRetrieveAndGenerateConfiguration"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Configures the retrieval and generation for the session."
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateInput": {
+ "type": "structure",
+ "members": {
+ "text": {
+ "target": "smithy.api#String",
+ "traits": {
+ "smithy.api#documentation": "Customer input of the turn in text",
+ "smithy.api#length": {
+ "max": 1000
+ },
+ "smithy.api#required": {}
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Customer input of the turn",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateOutput": {
+ "type": "structure",
+ "members": {
+ "text": {
+ "target": "smithy.api#String",
+ "traits": {
+ "smithy.api#documentation": "Service response of the turn in text",
+ "smithy.api#required": {}
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Service response of the turn",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateRequest": {
+ "type": "structure",
+ "members": {
+ "sessionId": {
+ "target": "com.amazonaws.bedrockagentruntime#SessionId"
+ },
+ "input": {
+ "target": "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateInput",
+ "traits": {
+ "smithy.api#required": {}
+ }
+ },
+ "retrieveAndGenerateConfiguration": {
+ "target": "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateConfiguration"
+ },
+ "sessionConfiguration": {
+ "target": "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateSessionConfiguration"
+ }
+ },
+ "traits": {
+ "smithy.api#input": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateResource": {
+ "type": "resource",
+ "operations": [
+ {
+ "target": "com.amazonaws.bedrockagentruntime#RetrieveAndGenerate"
+ }
+ ]
+ },
+ "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateResponse": {
+ "type": "structure",
+ "members": {
+ "sessionId": {
+ "target": "com.amazonaws.bedrockagentruntime#SessionId",
+ "traits": {
+ "smithy.api#required": {}
+ }
+ },
+ "output": {
+ "target": "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateOutput",
+ "traits": {
+ "smithy.api#required": {}
+ }
+ },
+ "citations": {
+ "target": "com.amazonaws.bedrockagentruntime#Citations"
+ }
+ },
+ "traits": {
+ "smithy.api#output": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateSessionConfiguration": {
+ "type": "structure",
+ "members": {
+ "kmsKeyArn": {
+ "target": "com.amazonaws.bedrockagentruntime#KmsKeyArn",
+ "traits": {
+ "smithy.api#documentation": "The KMS key arn to encrypt the customer data of the session.",
+ "smithy.api#required": {}
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Configures common parameters of the session."
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateType": {
+ "type": "enum",
+ "members": {
+ "KNOWLEDGE_BASE": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "KNOWLEDGE_BASE"
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "The type of RetrieveAndGenerate."
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RetrieveRequest": {
+ "type": "structure",
+ "members": {
+ "knowledgeBaseId": {
+ "target": "com.amazonaws.bedrockagentruntime#KnowledgeBaseId",
+ "traits": {
+ "smithy.api#httpLabel": {},
+ "smithy.api#required": {}
+ }
+ },
+ "retrievalQuery": {
+ "target": "com.amazonaws.bedrockagentruntime#KnowledgeBaseQuery",
+ "traits": {
+ "smithy.api#required": {}
+ }
+ },
+ "retrievalConfiguration": {
+ "target": "com.amazonaws.bedrockagentruntime#KnowledgeBaseRetrievalConfiguration"
+ },
+ "nextToken": {
+ "target": "com.amazonaws.bedrockagentruntime#NextToken"
+ }
+ },
+ "traits": {
+ "smithy.api#input": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RetrieveResource": {
+ "type": "resource",
+ "operations": [
+ {
+ "target": "com.amazonaws.bedrockagentruntime#Retrieve"
+ }
+ ]
+ },
+ "com.amazonaws.bedrockagentruntime#RetrieveResponse": {
+ "type": "structure",
+ "members": {
+ "retrievalResults": {
+ "target": "com.amazonaws.bedrockagentruntime#KnowledgeBaseRetrievalResults",
+ "traits": {
+ "smithy.api#required": {}
+ }
+ },
+ "nextToken": {
+ "target": "com.amazonaws.bedrockagentruntime#NextToken"
+ }
+ },
+ "traits": {
+ "smithy.api#output": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RetrievedReference": {
+ "type": "structure",
+ "members": {
+ "content": {
+ "target": "com.amazonaws.bedrockagentruntime#RetrievalResultContent"
+ },
+ "location": {
+ "target": "com.amazonaws.bedrockagentruntime#RetrievalResultLocation"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Retrieved reference"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#RetrievedReferences": {
+ "type": "list",
+ "member": {
+ "target": "com.amazonaws.bedrockagentruntime#RetrievedReference"
+ },
+ "traits": {
+ "smithy.api#documentation": "list of retrieved references"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException": {
+ "type": "structure",
+ "members": {
+ "message": {
+ "target": "com.amazonaws.bedrockagentruntime#NonBlankString"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "This exception is thrown when a request is made beyond the service quota",
+ "smithy.api#error": "client",
+ "smithy.api#httpError": 400
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#SessionAttributesMap": {
+ "type": "map",
+ "key": {
+ "target": "smithy.api#String"
+ },
+ "value": {
+ "target": "smithy.api#String"
+ },
+ "traits": {
+ "smithy.api#documentation": "Session attributes are pass through attributes passed to the action group"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#SessionId": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Identifier of the session.",
+ "smithy.api#length": {
+ "min": 2,
+ "max": 100
+ },
+ "smithy.api#pattern": "^[0-9a-zA-Z._:-]+$"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#SessionState": {
+ "type": "structure",
+ "members": {
+ "sessionAttributes": {
+ "target": "com.amazonaws.bedrockagentruntime#SessionAttributesMap",
+ "traits": {
+ "smithy.api#documentation": "Session Attributes"
+ }
+ },
+ "promptSessionAttributes": {
+ "target": "com.amazonaws.bedrockagentruntime#PromptSessionAttributesMap",
+ "traits": {
+ "smithy.api#documentation": "Prompt Session Attributes"
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Session state provided"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#Source": {
+ "type": "enum",
+ "members": {
+ "ACTION_GROUP": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "ACTION_GROUP"
+ }
+ },
+ "KNOWLEDGE_BASE": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "KNOWLEDGE_BASE"
+ }
+ },
+ "PARSER": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "PARSER"
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Parsing error source",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#Span": {
+ "type": "structure",
+ "members": {
+ "start": {
+ "target": "smithy.api#Integer",
+ "traits": {
+ "smithy.api#documentation": "Start of span",
+ "smithy.api#range": {
+ "min": 0
+ }
+ }
+ },
+ "end": {
+ "target": "smithy.api#Integer",
+ "traits": {
+ "smithy.api#documentation": "End of span",
+ "smithy.api#range": {
+ "min": 0
+ }
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Span of text"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#StopSequences": {
+ "type": "list",
+ "member": {
+ "target": "smithy.api#String"
+ },
+ "traits": {
+ "smithy.api#documentation": "List of stop sequences",
+ "smithy.api#length": {
+ "min": 0,
+ "max": 4
+ }
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#Temperature": {
+ "type": "float",
+ "traits": {
+ "smithy.api#documentation": "Controls randomness, higher values increase diversity",
+ "smithy.api#range": {
+ "min": 0,
+ "max": 1
+ }
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#TextResponsePart": {
+ "type": "structure",
+ "members": {
+ "text": {
+ "target": "smithy.api#String",
+ "traits": {
+ "smithy.api#documentation": "Response part in text"
+ }
+ },
+ "span": {
+ "target": "com.amazonaws.bedrockagentruntime#Span"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Text response part"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#ThrottlingException": {
+ "type": "structure",
+ "members": {
+ "message": {
+ "target": "com.amazonaws.bedrockagentruntime#NonBlankString"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "This exception is thrown when the number of requests exceeds the limit",
+ "smithy.api#error": "client",
+ "smithy.api#httpError": 429
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#TopK": {
+ "type": "integer",
+ "traits": {
+ "smithy.api#documentation": "Sample from the k most likely next tokens",
+ "smithy.api#range": {
+ "min": 0,
+ "max": 500
+ }
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#TopP": {
+ "type": "float",
+ "traits": {
+ "smithy.api#documentation": "Cumulative probability cutoff for token selection",
+ "smithy.api#range": {
+ "min": 0,
+ "max": 1
+ }
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#Trace": {
+ "type": "union",
+ "members": {
+ "preProcessingTrace": {
+ "target": "com.amazonaws.bedrockagentruntime#PreProcessingTrace"
+ },
+ "orchestrationTrace": {
+ "target": "com.amazonaws.bedrockagentruntime#OrchestrationTrace"
+ },
+ "postProcessingTrace": {
+ "target": "com.amazonaws.bedrockagentruntime#PostProcessingTrace"
+ },
+ "failureTrace": {
+ "target": "com.amazonaws.bedrockagentruntime#FailureTrace"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Trace contains intermidate response for customer",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#TraceId": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Identifier for trace",
+ "smithy.api#length": {
+ "min": 2,
+ "max": 16
+ }
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#TraceKnowledgeBaseId": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Agent Trace Action Group Knowledge Base Id",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#TracePart": {
+ "type": "structure",
+ "members": {
+ "agentId": {
+ "target": "com.amazonaws.bedrockagentruntime#AgentId"
+ },
+ "agentAliasId": {
+ "target": "com.amazonaws.bedrockagentruntime#AgentAliasId"
+ },
+ "sessionId": {
+ "target": "com.amazonaws.bedrockagentruntime#SessionId"
+ },
+ "trace": {
+ "target": "com.amazonaws.bedrockagentruntime#Trace"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "Trace Part which contains intermidate response for customer",
+ "smithy.api#sensitive": {}
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#Type": {
+ "type": "enum",
+ "members": {
+ "ACTION_GROUP": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "ACTION_GROUP"
+ }
+ },
+ "KNOWLEDGE_BASE": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "KNOWLEDGE_BASE"
+ }
+ },
+ "FINISH": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "FINISH"
+ }
+ },
+ "ASK_USER": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "ASK_USER"
+ }
+ },
+ "REPROMPT": {
+ "target": "smithy.api#Unit",
+ "traits": {
+ "smithy.api#enumValue": "REPROMPT"
+ }
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "types of observations"
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#ValidationException": {
+ "type": "structure",
+ "members": {
+ "message": {
+ "target": "com.amazonaws.bedrockagentruntime#NonBlankString"
+ }
+ },
+ "traits": {
+ "smithy.api#documentation": "This exception is thrown when the request's input validation fails",
+ "smithy.api#error": "client",
+ "smithy.api#httpError": 400
+ }
+ },
+ "com.amazonaws.bedrockagentruntime#Verb": {
+ "type": "string",
+ "traits": {
+ "smithy.api#documentation": "Agent Trace Action Group Action verb",
+ "smithy.api#sensitive": {}
+ }
+ }
+ }
+}