Invokes an alias of a flow to run the inputs that you specify and return the output of each node as a stream. If there's an error, the error is returned. For more information, see Test a flow in Amazon Bedrock in the Amazon Bedrock User Guide.
+ *Invokes an alias of a flow to run the inputs that you specify and return the output of each node as a stream. If there's an error, the error is returned. For more information, see Test a flow in Amazon Bedrock in the Amazon Bedrock User Guide.
*The CLI doesn't support streaming operations in Amazon Bedrock, including InvokeFlow
.
Optimizes a prompt for the task that you specify. For more information, see Optimize a prompt in the Amazon Bedrock User Guide.
+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockAgentRuntimeClient, OptimizePromptCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import + * // const { BedrockAgentRuntimeClient, OptimizePromptCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import + * const client = new BedrockAgentRuntimeClient(config); + * const input = { // OptimizePromptRequest + * input: { // InputPrompt Union: only one key present + * textPrompt: { // TextPrompt + * text: "STRING_VALUE", // required + * }, + * }, + * targetModelId: "STRING_VALUE", // required + * }; + * const command = new OptimizePromptCommand(input); + * const response = await client.send(command); + * // { // OptimizePromptResponse + * // optimizedPrompt: { // OptimizedPromptStream Union: only one key present + * // optimizedPromptEvent: { // OptimizedPromptEvent + * // optimizedPrompt: { // OptimizedPrompt Union: only one key present + * // textPrompt: { // TextPrompt + * // text: "STRING_VALUE", // required + * // }, + * // }, + * // }, + * // analyzePromptEvent: { // AnalyzePromptEvent + * // message: "STRING_VALUE", + * // }, + * // internalServerException: { // InternalServerException + * // message: "STRING_VALUE", + * // }, + * // throttlingException: { // ThrottlingException + * // message: "STRING_VALUE", + * // }, + * // validationException: { // ValidationException + * // message: "STRING_VALUE", + * // }, + * // dependencyFailedException: { // DependencyFailedException + * // message: "STRING_VALUE", + * // resourceName: "STRING_VALUE", + * // }, + * // accessDeniedException: { // AccessDeniedException + * // message: "STRING_VALUE", + * // }, + * // badGatewayException: { // BadGatewayException + * // message: "STRING_VALUE", + * // resourceName: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param OptimizePromptCommandInput - {@link OptimizePromptCommandInput} + * @returns {@link OptimizePromptCommandOutput} + * @see {@link OptimizePromptCommandInput} for command's `input` shape. + * @see {@link OptimizePromptCommandOutput} for command's `response` shape. + * @see {@link BedrockAgentRuntimeClientResolvedConfig | config} for BedrockAgentRuntimeClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *The request is denied because of missing access permissions. Check your permissions and retry your request.
+ * + * @throws {@link BadGatewayException} (server fault) + *There was an issue with a dependency due to a server issue. Retry your request.
+ * + * @throws {@link DependencyFailedException} (client fault) + *There was an issue with a dependency. Check the resource configurations and retry the request.
+ * + * @throws {@link InternalServerException} (server fault) + *An internal server error occurred. Retry your request.
+ * + * @throws {@link ThrottlingException} (client fault) + *The number of requests exceeds the limit. Resubmit your request later.
+ * + * @throws {@link ValidationException} (client fault) + *Input validation failed. Check your request parameters and retry the request.
+ * + * @throws {@link BedrockAgentRuntimeServiceException} + *Base exception class for all service exceptions from BedrockAgentRuntime service.
+ * + * @public + */ +export class OptimizePromptCommand extends $Command + .classBuilder< + OptimizePromptCommandInput, + OptimizePromptCommandOutput, + BedrockAgentRuntimeClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BedrockAgentRuntimeClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonBedrockAgentRunTimeService", "OptimizePrompt", { + /** + * @internal + */ + eventStream: { + output: true, + }, + }) + .n("BedrockAgentRuntimeClient", "OptimizePromptCommand") + .f(OptimizePromptRequestFilterSensitiveLog, OptimizePromptResponseFilterSensitiveLog) + .ser(se_OptimizePromptCommand) + .de(de_OptimizePromptCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: OptimizePromptRequest; + output: OptimizePromptResponse; + }; + sdk: { + input: OptimizePromptCommandInput; + output: OptimizePromptCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-agent-runtime/src/commands/index.ts b/clients/client-bedrock-agent-runtime/src/commands/index.ts index 58f87c23227c4..50b2d4137bcf6 100644 --- a/clients/client-bedrock-agent-runtime/src/commands/index.ts +++ b/clients/client-bedrock-agent-runtime/src/commands/index.ts @@ -3,5 +3,6 @@ export * from "./DeleteAgentMemoryCommand"; export * from "./GetAgentMemoryCommand"; export * from "./InvokeAgentCommand"; export * from "./InvokeFlowCommand"; +export * from "./OptimizePromptCommand"; export * from "./RetrieveAndGenerateCommand"; export * from "./RetrieveCommand"; diff --git a/clients/client-bedrock-agent-runtime/src/models/models_0.ts b/clients/client-bedrock-agent-runtime/src/models/models_0.ts index bdd8aaf4d0973..b173075c1c197 100644 --- a/clients/client-bedrock-agent-runtime/src/models/models_0.ts +++ b/clients/client-bedrock-agent-runtime/src/models/models_0.ts @@ -76,7 +76,7 @@ export interface RequestBody { } /** - *Contains information about the action group being invoked. For more information about the possible structures, see the InvocationInput tab in OrchestrationTrace in the Amazon Bedrock User Guide.
+ *Contains information about the action group being invoked. For more information about the possible structures, see the InvocationInput tab in OrchestrationTrace in the Amazon Bedrock User Guide.
* @public */ export interface ActionGroupInvocationInput { @@ -4143,6 +4143,335 @@ export interface GetAgentMemoryResponse { memoryContents?: Memory[] | undefined; } +/** + *Contains information about the text prompt to optimize.
+ * @public + */ +export interface TextPrompt { + /** + *The text in the text prompt to optimize.
+ * @public + */ + text: string | undefined; +} + +/** + *Contains information about the prompt to optimize.
+ * @public + */ +export type InputPrompt = InputPrompt.TextPromptMember | InputPrompt.$UnknownMember; + +/** + * @public + */ +export namespace InputPrompt { + /** + *Contains information about the text prompt to optimize.
+ * @public + */ + export interface TextPromptMember { + textPrompt: TextPrompt; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + textPrompt?: never; + $unknown: [string, any]; + } + + export interface VisitorContains the prompt to optimize.
+ * @public + */ + input: InputPrompt | undefined; + + /** + *The unique identifier of the model that you want to optimize the prompt for.
+ * @public + */ + targetModelId: string | undefined; +} + +/** + *An event in which the prompt was analyzed in preparation for optimization.
+ * @public + */ +export interface AnalyzePromptEvent { + /** + *A message describing the analysis of the prompt.
+ * @public + */ + message?: string | undefined; +} + +/** + *Contains information about the optimized prompt.
+ * @public + */ +export type OptimizedPrompt = OptimizedPrompt.TextPromptMember | OptimizedPrompt.$UnknownMember; + +/** + * @public + */ +export namespace OptimizedPrompt { + /** + *Contains information about the text in the prompt that was optimized.
+ * @public + */ + export interface TextPromptMember { + textPrompt: TextPrompt; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + textPrompt?: never; + $unknown: [string, any]; + } + + export interface VisitorAn event in which the prompt was optimized.
+ * @public + */ +export interface OptimizedPromptEvent { + /** + *Contains information about the optimized prompt.
+ * @public + */ + optimizedPrompt?: OptimizedPrompt | undefined; +} + +/** + *The stream containing events in the prompt optimization process.
+ * @public + */ +export type OptimizedPromptStream = + | OptimizedPromptStream.AccessDeniedExceptionMember + | OptimizedPromptStream.AnalyzePromptEventMember + | OptimizedPromptStream.BadGatewayExceptionMember + | OptimizedPromptStream.DependencyFailedExceptionMember + | OptimizedPromptStream.InternalServerExceptionMember + | OptimizedPromptStream.OptimizedPromptEventMember + | OptimizedPromptStream.ThrottlingExceptionMember + | OptimizedPromptStream.ValidationExceptionMember + | OptimizedPromptStream.$UnknownMember; + +/** + * @public + */ +export namespace OptimizedPromptStream { + /** + *An event in which the prompt was optimized.
+ * @public + */ + export interface OptimizedPromptEventMember { + optimizedPromptEvent: OptimizedPromptEvent; + analyzePromptEvent?: never; + internalServerException?: never; + throttlingException?: never; + validationException?: never; + dependencyFailedException?: never; + accessDeniedException?: never; + badGatewayException?: never; + $unknown?: never; + } + + /** + *An event in which the prompt was analyzed in preparation for optimization.
+ * @public + */ + export interface AnalyzePromptEventMember { + optimizedPromptEvent?: never; + analyzePromptEvent: AnalyzePromptEvent; + internalServerException?: never; + throttlingException?: never; + validationException?: never; + dependencyFailedException?: never; + accessDeniedException?: never; + badGatewayException?: never; + $unknown?: never; + } + + /** + *An internal server error occurred. Retry your request.
+ * @public + */ + export interface InternalServerExceptionMember { + optimizedPromptEvent?: never; + analyzePromptEvent?: never; + internalServerException: InternalServerException; + throttlingException?: never; + validationException?: never; + dependencyFailedException?: never; + accessDeniedException?: never; + badGatewayException?: never; + $unknown?: never; + } + + /** + *Your request was throttled because of service-wide limitations. Resubmit your request later or in a different region. You can also purchase Provisioned Throughput to increase the rate or number of tokens you can process.
+ * @public + */ + export interface ThrottlingExceptionMember { + optimizedPromptEvent?: never; + analyzePromptEvent?: never; + internalServerException?: never; + throttlingException: ThrottlingException; + validationException?: never; + dependencyFailedException?: never; + accessDeniedException?: never; + badGatewayException?: never; + $unknown?: never; + } + + /** + *Input validation failed. Check your request parameters and retry the request.
+ * @public + */ + export interface ValidationExceptionMember { + optimizedPromptEvent?: never; + analyzePromptEvent?: never; + internalServerException?: never; + throttlingException?: never; + validationException: ValidationException; + dependencyFailedException?: never; + accessDeniedException?: never; + badGatewayException?: never; + $unknown?: never; + } + + /** + *There was an issue with a dependency. Check the resource configurations and retry the request.
+ * @public + */ + export interface DependencyFailedExceptionMember { + optimizedPromptEvent?: never; + analyzePromptEvent?: never; + internalServerException?: never; + throttlingException?: never; + validationException?: never; + dependencyFailedException: DependencyFailedException; + accessDeniedException?: never; + badGatewayException?: never; + $unknown?: never; + } + + /** + *The request is denied because of missing access permissions. Check your permissions and retry your request.
+ * @public + */ + export interface AccessDeniedExceptionMember { + optimizedPromptEvent?: never; + analyzePromptEvent?: never; + internalServerException?: never; + throttlingException?: never; + validationException?: never; + dependencyFailedException?: never; + accessDeniedException: AccessDeniedException; + badGatewayException?: never; + $unknown?: never; + } + + /** + *There was an issue with a dependency due to a server issue. Retry your request.
+ * @public + */ + export interface BadGatewayExceptionMember { + optimizedPromptEvent?: never; + analyzePromptEvent?: never; + internalServerException?: never; + throttlingException?: never; + validationException?: never; + dependencyFailedException?: never; + accessDeniedException?: never; + badGatewayException: BadGatewayException; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + optimizedPromptEvent?: never; + analyzePromptEvent?: never; + internalServerException?: never; + throttlingException?: never; + validationException?: never; + dependencyFailedException?: never; + accessDeniedException?: never; + badGatewayException?: never; + $unknown: [string, any]; + } + + export interface VisitorThe prompt after being optimized for the task.
+ * @public + */ + optimizedPrompt: AsyncIterableContains the query made to the knowledge base.
*This data type is used in the following API operations:
@@ -6038,6 +6367,75 @@ export const InvokeAgentResponseFilterSensitiveLog = (obj: InvokeAgentResponse): ...(obj.completion && { completion: "STREAMING_CONTENT" }), }); +/** + * @internal + */ +export const TextPromptFilterSensitiveLog = (obj: TextPrompt): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const InputPromptFilterSensitiveLog = (obj: InputPrompt): any => { + if (obj.textPrompt !== undefined) return { textPrompt: SENSITIVE_STRING }; + if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; +}; + +/** + * @internal + */ +export const OptimizePromptRequestFilterSensitiveLog = (obj: OptimizePromptRequest): any => ({ + ...obj, + ...(obj.input && { input: InputPromptFilterSensitiveLog(obj.input) }), +}); + +/** + * @internal + */ +export const AnalyzePromptEventFilterSensitiveLog = (obj: AnalyzePromptEvent): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const OptimizedPromptFilterSensitiveLog = (obj: OptimizedPrompt): any => { + if (obj.textPrompt !== undefined) return { textPrompt: SENSITIVE_STRING }; + if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; +}; + +/** + * @internal + */ +export const OptimizedPromptEventFilterSensitiveLog = (obj: OptimizedPromptEvent): any => ({ + ...obj, + ...(obj.optimizedPrompt && { optimizedPrompt: OptimizedPromptFilterSensitiveLog(obj.optimizedPrompt) }), +}); + +/** + * @internal + */ +export const OptimizedPromptStreamFilterSensitiveLog = (obj: OptimizedPromptStream): any => { + if (obj.optimizedPromptEvent !== undefined) return { optimizedPromptEvent: SENSITIVE_STRING }; + if (obj.analyzePromptEvent !== undefined) return { analyzePromptEvent: SENSITIVE_STRING }; + if (obj.internalServerException !== undefined) return { internalServerException: obj.internalServerException }; + if (obj.throttlingException !== undefined) return { throttlingException: obj.throttlingException }; + if (obj.validationException !== undefined) return { validationException: obj.validationException }; + if (obj.dependencyFailedException !== undefined) return { dependencyFailedException: obj.dependencyFailedException }; + if (obj.accessDeniedException !== undefined) return { accessDeniedException: obj.accessDeniedException }; + if (obj.badGatewayException !== undefined) return { badGatewayException: obj.badGatewayException }; + if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; +}; + +/** + * @internal + */ +export const OptimizePromptResponseFilterSensitiveLog = (obj: OptimizePromptResponse): any => ({ + ...obj, + ...(obj.optimizedPrompt && { optimizedPrompt: "STREAMING_CONTENT" }), +}); + /** * @internal */ diff --git a/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts b/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts index 2b9bb25e50b09..9f613591dc484 100644 --- a/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts @@ -37,6 +37,7 @@ import { DeleteAgentMemoryCommandInput, DeleteAgentMemoryCommandOutput } from ". import { GetAgentMemoryCommandInput, GetAgentMemoryCommandOutput } from "../commands/GetAgentMemoryCommand"; import { InvokeAgentCommandInput, InvokeAgentCommandOutput } from "../commands/InvokeAgentCommand"; import { InvokeFlowCommandInput, InvokeFlowCommandOutput } from "../commands/InvokeFlowCommand"; +import { OptimizePromptCommandInput, OptimizePromptCommandOutput } from "../commands/OptimizePromptCommand"; import { RetrieveAndGenerateCommandInput, RetrieveAndGenerateCommandOutput, @@ -45,6 +46,7 @@ import { RetrieveCommandInput, RetrieveCommandOutput } from "../commands/Retriev import { BedrockAgentRuntimeServiceException as __BaseException } from "../models/BedrockAgentRuntimeServiceException"; import { AccessDeniedException, + AnalyzePromptEvent, ApiResult, Attribution, BadGatewayException, @@ -81,6 +83,7 @@ import { InferenceConfig, InferenceConfiguration, InputFile, + InputPrompt, InternalServerException, InvocationResultMember, KnowledgeBaseConfiguration, @@ -94,6 +97,8 @@ import { MemorySessionSummary, ModelInvocationInput, Observation, + OptimizedPromptEvent, + OptimizedPromptStream, OrchestrationConfiguration, OrchestrationTrace, OutputFile, @@ -115,6 +120,7 @@ import { ServiceQuotaExceededException, SessionState, TextInferenceConfig, + TextPrompt, ThrottlingException, Trace, TracePart, @@ -218,6 +224,29 @@ export const se_InvokeFlowCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1OptimizePromptCommand + */ +export const se_OptimizePromptCommand = async ( + input: OptimizePromptCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/optimize-prompt"); + let body: any; + body = JSON.stringify( + take(input, { + input: (_) => _json(_), + targetModelId: [], + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1RetrieveCommand */ @@ -346,6 +375,24 @@ export const de_InvokeFlowCommand = async ( return contents; }; +/** + * deserializeAws_restJson1OptimizePromptCommand + */ +export const de_OptimizePromptCommand = async ( + output: __HttpResponse, + context: __SerdeContext & __EventStreamSerdeContext +): PromiseContains information about the action group being invoked. For more information about the possible structures, see the InvocationInput tab in OrchestrationTrace in the Amazon Bedrock User Guide.
" + "smithy.api#documentation": "Contains information about the action group being invoked. For more information about the possible structures, see the InvocationInput tab in OrchestrationTrace in the Amazon Bedrock User Guide.
" } }, "com.amazonaws.bedrockagentruntime#ActionGroupInvocationOutput": { @@ -181,6 +181,9 @@ { "target": "com.amazonaws.bedrockagentruntime#MemoryResource" }, + { + "target": "com.amazonaws.bedrockagentruntime#OptimizePromptResource" + }, { "target": "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateResource" }, @@ -867,6 +870,21 @@ } } }, + "com.amazonaws.bedrockagentruntime#AnalyzePromptEvent": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "A message describing the analysis of the prompt.
" + } + } + }, + "traits": { + "smithy.api#documentation": "An event in which the prompt was analyzed in preparation for optimization.
", + "smithy.api#sensitive": {} + } + }, "com.amazonaws.bedrockagentruntime#ApiContentMap": { "type": "map", "key": { @@ -3336,6 +3354,20 @@ "target": "com.amazonaws.bedrockagentruntime#InputFile" } }, + "com.amazonaws.bedrockagentruntime#InputPrompt": { + "type": "union", + "members": { + "textPrompt": { + "target": "com.amazonaws.bedrockagentruntime#TextPrompt", + "traits": { + "smithy.api#documentation": "Contains information about the text prompt to optimize.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Contains information about the prompt to optimize.
" + } + }, "com.amazonaws.bedrockagentruntime#InputText": { "type": "string", "traits": { @@ -3663,7 +3695,7 @@ } ], "traits": { - "smithy.api#documentation": "Invokes an alias of a flow to run the inputs that you specify and return the output of each node as a stream. If there's an error, the error is returned. For more information, see Test a flow in Amazon Bedrock in the Amazon Bedrock User Guide.
\nThe CLI doesn't support streaming operations in Amazon Bedrock, including InvokeFlow
.
Invokes an alias of a flow to run the inputs that you specify and return the output of each node as a stream. If there's an error, the error is returned. For more information, see Test a flow in Amazon Bedrock in the Amazon Bedrock User Guide.
\nThe CLI doesn't support streaming operations in Amazon Bedrock, including InvokeFlow
.
Optimizes a prompt for the task that you specify. For more information, see Optimize a prompt in the Amazon Bedrock User Guide.
", + "smithy.api#http": { + "code": 200, + "method": "POST", + "uri": "/optimize-prompt" + } + } + }, + "com.amazonaws.bedrockagentruntime#OptimizePromptRequest": { + "type": "structure", + "members": { + "input": { + "target": "com.amazonaws.bedrockagentruntime#InputPrompt", + "traits": { + "smithy.api#documentation": "Contains the prompt to optimize.
", + "smithy.api#required": {} + } + }, + "targetModelId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The unique identifier of the model that you want to optimize the prompt for.
", + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "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}([.:]?[a-z0-9-]{1,63}))|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)$", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockagentruntime#OptimizePromptResource": { + "type": "resource", + "operations": [ + { + "target": "com.amazonaws.bedrockagentruntime#OptimizePrompt" + } + ] + }, + "com.amazonaws.bedrockagentruntime#OptimizePromptResponse": { + "type": "structure", + "members": { + "optimizedPrompt": { + "target": "com.amazonaws.bedrockagentruntime#OptimizedPromptStream", + "traits": { + "smithy.api#documentation": "The prompt after being optimized for the task.
", + "smithy.api#httpPayload": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockagentruntime#OptimizedPrompt": { + "type": "union", + "members": { + "textPrompt": { + "target": "com.amazonaws.bedrockagentruntime#TextPrompt", + "traits": { + "smithy.api#documentation": "Contains information about the text in the prompt that was optimized.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Contains information about the optimized prompt.
" + } + }, + "com.amazonaws.bedrockagentruntime#OptimizedPromptEvent": { + "type": "structure", + "members": { + "optimizedPrompt": { + "target": "com.amazonaws.bedrockagentruntime#OptimizedPrompt", + "traits": { + "smithy.api#documentation": "Contains information about the optimized prompt.
" + } + } + }, + "traits": { + "smithy.api#documentation": "An event in which the prompt was optimized.
", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.bedrockagentruntime#OptimizedPromptStream": { + "type": "union", + "members": { + "optimizedPromptEvent": { + "target": "com.amazonaws.bedrockagentruntime#OptimizedPromptEvent", + "traits": { + "smithy.api#documentation": "An event in which the prompt was optimized.
" + } + }, + "analyzePromptEvent": { + "target": "com.amazonaws.bedrockagentruntime#AnalyzePromptEvent", + "traits": { + "smithy.api#documentation": "An event in which the prompt was analyzed in preparation for optimization.
" + } + }, + "internalServerException": { + "target": "com.amazonaws.bedrockagentruntime#InternalServerException", + "traits": { + "smithy.api#documentation": "An internal server error occurred. Retry your request.
" + } + }, + "throttlingException": { + "target": "com.amazonaws.bedrockagentruntime#ThrottlingException", + "traits": { + "smithy.api#documentation": "Your request was throttled because of service-wide limitations. Resubmit your request later or in a different region. You can also purchase Provisioned Throughput to increase the rate or number of tokens you can process.
" + } + }, + "validationException": { + "target": "com.amazonaws.bedrockagentruntime#ValidationException", + "traits": { + "smithy.api#documentation": "Input validation failed. Check your request parameters and retry the request.
" + } + }, + "dependencyFailedException": { + "target": "com.amazonaws.bedrockagentruntime#DependencyFailedException", + "traits": { + "smithy.api#documentation": "There was an issue with a dependency. Check the resource configurations and retry the request.
" + } + }, + "accessDeniedException": { + "target": "com.amazonaws.bedrockagentruntime#AccessDeniedException", + "traits": { + "smithy.api#documentation": "The request is denied because of missing access permissions. Check your permissions and retry your request.
" + } + }, + "badGatewayException": { + "target": "com.amazonaws.bedrockagentruntime#BadGatewayException", + "traits": { + "smithy.api#documentation": "There was an issue with a dependency due to a server issue. Retry your request.
" + } + } + }, + "traits": { + "smithy.api#documentation": "The stream containing events in the prompt optimization process.
", + "smithy.api#streaming": {} + } + }, "com.amazonaws.bedrockagentruntime#OrchestrationConfiguration": { "type": "structure", "members": { @@ -5895,6 +6101,26 @@ "smithy.api#documentation": "Configuration settings for text generation using a language model via the\n RetrieveAndGenerate operation. Includes parameters like temperature, top-p, maximum token\n count, and stop sequences.
\nThe valid range of maxTokens
depends on the accepted values for your chosen\n model's inference parameters. To see the inference parameters for your model, see Inference\n parameters for foundation models.\n
The text in the text prompt to optimize.
", + "smithy.api#length": { + "min": 1, + "max": 200000 + }, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Contains information about the text prompt to optimize.
", + "smithy.api#sensitive": {} + } + }, "com.amazonaws.bedrockagentruntime#TextPromptTemplate": { "type": "string", "traits": {