From 8cc610482d61041e10d2904042a8e877727ef128 Mon Sep 17 00:00:00 2001
From: awstools To activate trace enablement, turn To stream agent responses, make sure that only orchestration prompt is enabled. Agent streaming is not supported for the following steps:
+ *
+ *
+ * Agent with 1 Knowledge base and End a conversation by setting An internal server error occurred. Retry your request.
+ * The model specified in the request is not ready to serve inference requests. The AWS SDK
+ * will automatically retry the operation up to 5 times. For information about configuring
+ * automatic retries, see Retry behavior in the AWS SDKs and Tools
+ * reference guide.
+ * The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again. To allow your agent to generate, run, and troubleshoot code when trying to complete a task, set this field to During orchestration, if your agent determines that it needs to invoke an API in an action group, but doesn't have enough information to complete the API request,
- * it will invoke this action group instead and return an Observation reprompting the user for more information.enableTrace
to true
. Trace enablement helps you follow the agent's reasoning process that led it to the information it processed, the actions it took, and the final result it yielded. For more information, see Trace enablement.
+ *
+ * Pre-processing
+ * Post-processing
+ * User Input
not enabledendSession
to true
.AMAZON.CodeInterpreter
. You must
* leave the description
, apiSchema
, and actionGroupExecutor
fields blank for this action group.
The response body from the API operation. The key of the object is the content type (currently, only TEXT
is supported). The response may be returned directly or from the Lambda function.
Controls the final response state returned to end user when API/Function execution failed. When this state is FAILURE, the request would fail with dependency failure exception. When this state is REPROMPT, the API/function response will be sent to model for re-prompt
* @public */ - responseBody?: Recordhttp status code from API execution response (for example: 200, 400, 500).
@@ -632,10 +632,10 @@ export interface ApiResult { httpStatusCode?: number | undefined; /** - *Controls the final response state returned to end user when API/Function execution failed. When this state is FAILURE, the request would fail with dependency failure exception. When this state is REPROMPT, the API/function response will be sent to model for re-prompt
+ *The response body from the API operation. The key of the object is the content type (currently, only TEXT
is supported). The response may be returned directly or from the Lambda function.
The agent's ID.
@@ -1334,6 +1334,44 @@ export interface FlowInput { content: FlowInputContent | undefined; } +/** + * @public + * @enum + */ +export const PerformanceConfigLatency = { + OPTIMIZED: "optimized", + STANDARD: "standard", +} as const; + +/** + * @public + */ +export type PerformanceConfigLatency = (typeof PerformanceConfigLatency)[keyof typeof PerformanceConfigLatency]; + +/** + *Performance settings for a model.
+ * @public + */ +export interface PerformanceConfiguration { + /** + *To use a latency-optimized version of the model, set to optimized
.
The performance configuration for a model called with InvokeFlow.
+ * @public + */ +export interface ModelPerformanceConfiguration { + /** + *The latency configuration for the model.
+ * @public + */ + performanceConfig?: PerformanceConfiguration | undefined; +} + /** * @public */ @@ -1361,6 +1399,12 @@ export interface InvokeFlowRequest { * @public */ enableTrace?: boolean | undefined; + + /** + *Model performance settings for the request.
+ * @public + */ + modelPerformanceConfiguration?: ModelPerformanceConfiguration | undefined; } /** @@ -2328,6 +2372,18 @@ export interface GenerateQueryResponse { queries?: GeneratedQuery[] | undefined; } +/** + *Settings for a model called with InvokeAgent.
+ * @public + */ +export interface BedrockModelConfigurations { + /** + *The performance configuration for the model.
+ * @public + */ + performanceConfig?: PerformanceConfiguration | undefined; +} + /** *A content block.
* @public @@ -2790,8 +2846,7 @@ export interface VectorSearchRerankingConfiguration { /** *- * Configurations for streaming. - *
+ * Configurations for streaming. * @public */ export interface StreamingConfigurations { @@ -3333,6 +3388,31 @@ export interface FilePart { files?: OutputFile[] | undefined; } +/** + *+ * The model specified in the request is not ready to serve inference requests. The AWS SDK + * will automatically retry the operation up to 5 times. For information about configuring + * automatic retries, see Retry behavior in the AWS SDKs and Tools + * reference guide. + *
+ * @public + */ +export class ModelNotReadyException extends __BaseException { + readonly name: "ModelNotReadyException" = "ModelNotReadyException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionTypeDetails about a caller.
* @public @@ -5049,6 +5129,7 @@ export type ResponseStream = | ResponseStream.DependencyFailedExceptionMember | ResponseStream.FilesMember | ResponseStream.InternalServerExceptionMember + | ResponseStream.ModelNotReadyExceptionMember | ResponseStream.ResourceNotFoundExceptionMember | ResponseStream.ReturnControlMember | ResponseStream.ServiceQuotaExceededExceptionMember @@ -5078,6 +5159,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + modelNotReadyException?: never; files?: never; $unknown?: never; } @@ -5099,6 +5181,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + modelNotReadyException?: never; files?: never; $unknown?: never; } @@ -5120,6 +5203,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + modelNotReadyException?: never; files?: never; $unknown?: never; } @@ -5141,6 +5225,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + modelNotReadyException?: never; files?: never; $unknown?: never; } @@ -5162,6 +5247,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + modelNotReadyException?: never; files?: never; $unknown?: never; } @@ -5183,6 +5269,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + modelNotReadyException?: never; files?: never; $unknown?: never; } @@ -5204,6 +5291,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + modelNotReadyException?: never; files?: never; $unknown?: never; } @@ -5225,6 +5313,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + modelNotReadyException?: never; files?: never; $unknown?: never; } @@ -5246,6 +5335,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + modelNotReadyException?: never; files?: never; $unknown?: never; } @@ -5267,6 +5357,7 @@ export namespace ResponseStream { conflictException: ConflictException; dependencyFailedException?: never; badGatewayException?: never; + modelNotReadyException?: never; files?: never; $unknown?: never; } @@ -5288,6 +5379,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException: DependencyFailedException; badGatewayException?: never; + modelNotReadyException?: never; files?: never; $unknown?: never; } @@ -5309,6 +5401,34 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException: BadGatewayException; + modelNotReadyException?: never; + files?: never; + $unknown?: never; + } + + /** + *+ * The model specified in the request is not ready to serve Inference requests. The AWS SDK + * will automatically retry the operation up to 5 times. For information about configuring + * automatic retries, see Retry behavior in the AWS SDKs and Tools + * reference guide. + *
+ * @public + */ + export interface ModelNotReadyExceptionMember { + chunk?: never; + trace?: never; + returnControl?: never; + internalServerException?: never; + validationException?: never; + resourceNotFoundException?: never; + serviceQuotaExceededException?: never; + throttlingException?: never; + accessDeniedException?: never; + conflictException?: never; + dependencyFailedException?: never; + badGatewayException?: never; + modelNotReadyException: ModelNotReadyException; files?: never; $unknown?: never; } @@ -5330,6 +5450,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + modelNotReadyException?: never; files: FilePart; $unknown?: never; } @@ -5350,6 +5471,7 @@ export namespace ResponseStream { conflictException?: never; dependencyFailedException?: never; badGatewayException?: never; + modelNotReadyException?: never; files?: never; $unknown: [string, any]; } @@ -5367,6 +5489,7 @@ export namespace ResponseStream { conflictException: (value: ConflictException) => T; dependencyFailedException: (value: DependencyFailedException) => T; badGatewayException: (value: BadGatewayException) => T; + modelNotReadyException: (value: ModelNotReadyException) => T; files: (value: FilePart) => T; _: (name: string, value: any) => T; } @@ -5388,6 +5511,7 @@ export namespace ResponseStream { if (value.dependencyFailedException !== undefined) return visitor.dependencyFailedException(value.dependencyFailedException); if (value.badGatewayException !== undefined) return visitor.badGatewayException(value.badGatewayException); + if (value.modelNotReadyException !== undefined) return visitor.modelNotReadyException(value.modelNotReadyException); if (value.files !== undefined) return visitor.files(value.files); return visitor._(value.$unknown[0], value.$unknown[1]); }; @@ -5422,6 +5546,18 @@ export interface InvokeAgentResponse { memoryId?: string | undefined; } +/** + *Settings for a model called with InvokeInlineAgent.
+ * @public + */ +export interface InlineBedrockModelConfigurations { + /** + *The latency configuration for the model.
+ * @public + */ + performanceConfig?: PerformanceConfiguration | undefined; +} + /** ** The configuration details for the guardrail. @@ -6086,6 +6222,12 @@ export interface DeleteAgentMemoryRequest { * @public */ memoryId?: string | undefined; + + /** + *
The unique session identifier of the memory.
+ * @public + */ + sessionId?: string | undefined; } /** @@ -6972,6 +7114,12 @@ export interface ExternalSourcesGenerationConfiguration { * @public */ additionalModelRequestFields?: RecordThe latency configuration for the model.
+ * @public + */ + performanceConfig?: PerformanceConfiguration | undefined; } /** @@ -7108,6 +7256,12 @@ export interface GenerationConfiguration { * @public */ additionalModelRequestFields?: RecordThe latency configuration for the model.
+ * @public + */ + performanceConfig?: PerformanceConfiguration | undefined; } /** @@ -7165,6 +7319,12 @@ export interface OrchestrationConfiguration { * @public */ queryTransformationConfiguration?: QueryTransformationConfiguration | undefined; + + /** + *The latency configuration for the model.
+ * @public + */ + performanceConfig?: PerformanceConfiguration | undefined; } /** @@ -8484,6 +8644,12 @@ export interface InvokeInlineAgentRequest { * @public */ promptOverrideConfiguration?: PromptOverrideConfiguration | undefined; + + /** + *Model settings for the request.
+ * @public + */ + bedrockModelConfigurations?: InlineBedrockModelConfigurations | undefined; } /** @@ -8653,10 +8819,19 @@ export interface InvokeAgentRequest { */ memoryId?: string | undefined; + /** + *Model performance settings for the request.
+ * @public + */ + bedrockModelConfigurations?: BedrockModelConfigurations | undefined; + /** ** Specifies the configurations for streaming. *
+ *To use agent streaming, you need permissions to perform the bedrock:InvokeModelWithResponseStream
action.
\n To allow your agent to request the user for additional information when trying to complete a task, set this field to AMAZON.UserInput
. \n You must leave the description
, apiSchema
, and actionGroupExecutor
fields blank for this action group.\n
To allow your agent to generate, run, and troubleshoot code when trying to complete a task, set this field to AMAZON.CodeInterpreter
. You must \n leave the description
, apiSchema
, and actionGroupExecutor
fields blank for this action group.
During orchestration, if your agent determines that it needs to invoke an API in an action group, but doesn't have enough information to complete the API request,\n it will invoke this action group instead and return an Observation reprompting the user for more information.
" + "smithy.api#documentation": "\n To allow your agent to request the user for additional information when trying to complete a task, set this field to AMAZON.UserInput
. \n You must leave the description
, apiSchema
, and actionGroupExecutor
fields blank for this action group.\n
To allow your agent to generate, run, and troubleshoot code when trying to complete a task, set this field to AMAZON.CodeInterpreter
. You must \n leave the description
, apiSchema
, and actionGroupExecutor
fields blank for this action group.
During orchestration, if your agent determines that it needs to invoke an API in an action group, but doesn't have enough information to complete the API request,\n it will invoke this action group instead and return an Observation reprompting the user for more information.
" } }, "actionGroupExecutor": { @@ -1279,10 +1279,10 @@ "smithy.api#documentation": "Controls the API operations or functions to invoke based on the user confirmation.
" } }, - "responseBody": { - "target": "com.amazonaws.bedrockagentruntime#ResponseBody", + "responseState": { + "target": "com.amazonaws.bedrockagentruntime#ResponseState", "traits": { - "smithy.api#documentation": "The response body from the API operation. The key of the object is the content type (currently, only TEXT
is supported). The response may be returned directly or from the Lambda function.
Controls the final response state returned to end user when API/Function execution failed. When this state is FAILURE, the request would fail with dependency failure exception. When this state is REPROMPT, the API/function response will be sent to model for re-prompt
" } }, "httpStatusCode": { @@ -1291,10 +1291,10 @@ "smithy.api#documentation": "http status code from API execution response (for example: 200, 400, 500).
" } }, - "responseState": { - "target": "com.amazonaws.bedrockagentruntime#ResponseState", + "responseBody": { + "target": "com.amazonaws.bedrockagentruntime#ResponseBody", "traits": { - "smithy.api#documentation": "Controls the final response state returned to end user when API/Function execution failed. When this state is FAILURE, the request would fail with dependency failure exception. When this state is REPROMPT, the API/function response will be sent to model for re-prompt
" + "smithy.api#documentation": "The response body from the API operation. The key of the object is the content type (currently, only TEXT
is supported). The response may be returned directly or from the Lambda function.
The performance configuration for the model.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Settings for a model called with InvokeAgent.
" + } + }, "com.amazonaws.bedrockagentruntime#BedrockRerankingConfiguration": { "type": "structure", "members": { @@ -1873,6 +1887,13 @@ "smithy.api#documentation": "The unique identifier of the memory.
", "smithy.api#httpQuery": "memoryId" } + }, + "sessionId": { + "target": "com.amazonaws.bedrockagentruntime#SessionId", + "traits": { + "smithy.api#documentation": "The unique session identifier of the memory.
", + "smithy.api#httpQuery": "sessionId" + } } }, "traits": { @@ -2004,6 +2025,12 @@ "traits": { "smithy.api#documentation": "Additional model parameters and their corresponding values not included in the textInferenceConfig structure for an external source. Takes in custom model parameters specific to the language model being used.
" } + }, + "performanceConfig": { + "target": "com.amazonaws.bedrockagentruntime#PerformanceConfiguration", + "traits": { + "smithy.api#documentation": "The latency configuration for the model.
" + } } }, "traits": { @@ -3098,6 +3125,12 @@ "traits": { "smithy.api#documentation": "Additional model parameters and corresponding values not included in the textInferenceConfig structure for a knowledge base. This allows users to provide custom model parameters specific to the language model being used.
" } + }, + "performanceConfig": { + "target": "com.amazonaws.bedrockagentruntime#PerformanceConfiguration", + "traits": { + "smithy.api#documentation": "The latency configuration for the model.
" + } } }, "traits": { @@ -4308,6 +4341,20 @@ "smithy.api#sensitive": {} } }, + "com.amazonaws.bedrockagentruntime#InlineBedrockModelConfigurations": { + "type": "structure", + "members": { + "performanceConfig": { + "target": "com.amazonaws.bedrockagentruntime#PerformanceConfiguration", + "traits": { + "smithy.api#documentation": "The latency configuration for the model.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Settings for a model called with InvokeInlineAgent.
" + } + }, "com.amazonaws.bedrockagentruntime#InlineSessionState": { "type": "structure", "members": { @@ -4593,6 +4640,9 @@ { "target": "com.amazonaws.bedrockagentruntime#InternalServerException" }, + { + "target": "com.amazonaws.bedrockagentruntime#ModelNotReadyException" + }, { "target": "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" }, @@ -4607,7 +4657,7 @@ } ], "traits": { - "smithy.api#documentation": "The CLI doesn't support streaming operations in Amazon Bedrock, including InvokeAgent
.
Sends a prompt for the agent to process and respond to. Note the following fields for the request:
\nTo continue the same conversation with an agent, use the same sessionId
value in the request.
To activate trace enablement, turn enableTrace
to true
. Trace enablement helps you follow the agent's reasoning process that led it to the information it processed, the actions it took, and the final result it yielded. For more information, see Trace enablement.
End a conversation by setting endSession
to true
.
In the sessionState
object, you can include attributes for the session or prompt or, if you configured an action group to return control, results from invocation of the action group.
The response is returned in the bytes
field of the chunk
object.
The attribution
object contains citations for parts of the response.
If you set enableTrace
to true
in the request, you can trace the agent's steps and reasoning process that led it to the response.
If the action predicted was configured to return control, the response returns parameters for the action, elicited from the user, in the returnControl
field.
Errors are also surfaced in the response.
\nThe CLI doesn't support streaming operations in Amazon Bedrock, including InvokeAgent
.
Sends a prompt for the agent to process and respond to. Note the following fields for the request:
\nTo continue the same conversation with an agent, use the same sessionId
value in the request.
To activate trace enablement, turn enableTrace
to true
. Trace enablement helps you follow the agent's reasoning process that led it to the information it processed, the actions it took, and the final result it yielded. For more information, see Trace enablement.
To stream agent responses, make sure that only orchestration prompt is enabled. Agent streaming is not supported for the following steps:\n
\n\n Pre-processing
\n
\n Post-processing
\n
Agent with 1 Knowledge base and User Input
not enabled
End a conversation by setting endSession
to true
.
In the sessionState
object, you can include attributes for the session or prompt or, if you configured an action group to return control, results from invocation of the action group.
The response is returned in the bytes
field of the chunk
object.
The attribution
object contains citations for parts of the response.
If you set enableTrace
to true
in the request, you can trace the agent's steps and reasoning process that led it to the response.
If the action predicted was configured to return control, the response returns parameters for the action, elicited from the user, in the returnControl
field.
Errors are also surfaced in the response.
\nThe unique identifier of the agent memory.
" } }, + "bedrockModelConfigurations": { + "target": "com.amazonaws.bedrockagentruntime#BedrockModelConfigurations", + "traits": { + "smithy.api#documentation": "Model performance settings for the request.
" + } + }, "streamingConfigurations": { "target": "com.amazonaws.bedrockagentruntime#StreamingConfigurations", "traits": { - "smithy.api#documentation": "\n Specifies the configurations for streaming.\n
" + "smithy.api#documentation": "\n Specifies the configurations for streaming.\n
\nTo use agent streaming, you need permissions to perform the bedrock:InvokeModelWithResponseStream
action.
Specifies whether to return the trace for the flow or not. Traces track inputs and outputs for nodes in the flow. For more information, see Track each step in your prompt flow by viewing its trace in Amazon Bedrock.
" } + }, + "modelPerformanceConfiguration": { + "target": "com.amazonaws.bedrockagentruntime#ModelPerformanceConfiguration", + "traits": { + "smithy.api#documentation": "Model performance settings for the request.
" + } } }, "traits": { @@ -4958,6 +5020,12 @@ "traits": { "smithy.api#documentation": "\n Configurations for advanced prompts used to override the default prompts to enhance the accuracy of the inline agent.\n
" } + }, + "bedrockModelConfigurations": { + "target": "com.amazonaws.bedrockagentruntime#InlineBedrockModelConfigurations", + "traits": { + "smithy.api#documentation": "Model settings for the request.
" + } } }, "traits": { @@ -5607,6 +5675,33 @@ "smithy.api#sensitive": {} } }, + "com.amazonaws.bedrockagentruntime#ModelNotReadyException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.bedrockagentruntime#NonBlankString" + } + }, + "traits": { + "smithy.api#documentation": "\n The model specified in the request is not ready to serve inference requests. The AWS SDK\n will automatically retry the operation up to 5 times. For information about configuring\n automatic retries, see Retry behavior in the AWS SDKs and Tools\n reference guide.\n
", + "smithy.api#error": "client", + "smithy.api#httpError": 424 + } + }, + "com.amazonaws.bedrockagentruntime#ModelPerformanceConfiguration": { + "type": "structure", + "members": { + "performanceConfig": { + "target": "com.amazonaws.bedrockagentruntime#PerformanceConfiguration", + "traits": { + "smithy.api#documentation": "The latency configuration for the model.
" + } + } + }, + "traits": { + "smithy.api#documentation": "The performance configuration for a model called with InvokeFlow.
" + } + }, "com.amazonaws.bedrockagentruntime#Name": { "type": "string", "traits": { @@ -5952,6 +6047,12 @@ "traits": { "smithy.api#documentation": "To split up the prompt and retrieve multiple sources, set the transformation type to\n QUERY_DECOMPOSITION
.
The latency configuration for the model.
" + } } }, "traits": { @@ -6246,6 +6347,38 @@ } } }, + "com.amazonaws.bedrockagentruntime#PerformanceConfigLatency": { + "type": "enum", + "members": { + "STANDARD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "standard" + } + }, + "OPTIMIZED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "optimized" + } + } + } + }, + "com.amazonaws.bedrockagentruntime#PerformanceConfiguration": { + "type": "structure", + "members": { + "latency": { + "target": "com.amazonaws.bedrockagentruntime#PerformanceConfigLatency", + "traits": { + "smithy.api#default": "standard", + "smithy.api#documentation": "To use a latency-optimized version of the model, set to optimized
.
Performance settings for a model.
" + } + }, "com.amazonaws.bedrockagentruntime#PostProcessingModelInvocationOutput": { "type": "structure", "members": { @@ -7251,6 +7384,12 @@ "smithy.api#documentation": "There was an issue with a dependency due to a server issue. Retry your request.
" } }, + "modelNotReadyException": { + "target": "com.amazonaws.bedrockagentruntime#ModelNotReadyException", + "traits": { + "smithy.api#documentation": "\n The model specified in the request is not ready to serve Inference requests. The AWS SDK\n will automatically retry the operation up to 5 times. For information about configuring\n automatic retries, see Retry behavior in the AWS SDKs and Tools\n reference guide.\n
" + } + }, "files": { "target": "com.amazonaws.bedrockagentruntime#FilePart", "traits": { @@ -8721,7 +8860,7 @@ } }, "traits": { - "smithy.api#documentation": "\n Configurations for streaming.\n
" + "smithy.api#documentation": "\n Configurations for streaming.
" } }, "com.amazonaws.bedrockagentruntime#SummaryText": {