@aws-sdk/client-bedrock-agent-runtime 3.693.0 → 3.697.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist-cjs/index.js +221 -0
- package/dist-es/BedrockAgentRuntime.js +2 -0
- package/dist-es/commands/OptimizePromptCommand.js +27 -0
- package/dist-es/commands/index.js +1 -0
- package/dist-es/models/models_0.js +88 -0
- package/dist-es/protocols/Aws_restJson1.js +82 -0
- package/dist-types/BedrockAgentRuntime.d.ts +7 -0
- package/dist-types/BedrockAgentRuntimeClient.d.ts +3 -2
- package/dist-types/commands/InvokeFlowCommand.d.ts +1 -1
- package/dist-types/commands/OptimizePromptCommand.d.ts +125 -0
- package/dist-types/commands/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +307 -1
- package/dist-types/protocols/Aws_restJson1.d.ts +9 -0
- package/dist-types/ts3.4/BedrockAgentRuntime.d.ts +17 -0
- package/dist-types/ts3.4/BedrockAgentRuntimeClient.d.ts +6 -0
- package/dist-types/ts3.4/commands/OptimizePromptCommand.d.ts +50 -0
- package/dist-types/ts3.4/commands/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +195 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +12 -0
- package/package.json +38 -38
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
2
|
+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
|
|
3
|
+
import { BedrockAgentRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentRuntimeClient";
|
|
4
|
+
import { OptimizePromptRequest, OptimizePromptResponse } from "../models/models_0";
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export type { __MetadataBearer };
|
|
9
|
+
export { $Command };
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
*
|
|
13
|
+
* The input for {@link OptimizePromptCommand}.
|
|
14
|
+
*/
|
|
15
|
+
export interface OptimizePromptCommandInput extends OptimizePromptRequest {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*
|
|
20
|
+
* The output of {@link OptimizePromptCommand}.
|
|
21
|
+
*/
|
|
22
|
+
export interface OptimizePromptCommandOutput extends OptimizePromptResponse, __MetadataBearer {
|
|
23
|
+
}
|
|
24
|
+
declare const OptimizePromptCommand_base: {
|
|
25
|
+
new (input: OptimizePromptCommandInput): import("@smithy/smithy-client").CommandImpl<OptimizePromptCommandInput, OptimizePromptCommandOutput, BedrockAgentRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
26
|
+
new (__0_0: OptimizePromptCommandInput): import("@smithy/smithy-client").CommandImpl<OptimizePromptCommandInput, OptimizePromptCommandOutput, BedrockAgentRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
27
|
+
getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* <p>Optimizes a prompt for the task that you specify. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-optimize.html">Optimize a prompt</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a>.</p>
|
|
31
|
+
* @example
|
|
32
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
33
|
+
* ```javascript
|
|
34
|
+
* import { BedrockAgentRuntimeClient, OptimizePromptCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import
|
|
35
|
+
* // const { BedrockAgentRuntimeClient, OptimizePromptCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import
|
|
36
|
+
* const client = new BedrockAgentRuntimeClient(config);
|
|
37
|
+
* const input = { // OptimizePromptRequest
|
|
38
|
+
* input: { // InputPrompt Union: only one key present
|
|
39
|
+
* textPrompt: { // TextPrompt
|
|
40
|
+
* text: "STRING_VALUE", // required
|
|
41
|
+
* },
|
|
42
|
+
* },
|
|
43
|
+
* targetModelId: "STRING_VALUE", // required
|
|
44
|
+
* };
|
|
45
|
+
* const command = new OptimizePromptCommand(input);
|
|
46
|
+
* const response = await client.send(command);
|
|
47
|
+
* // { // OptimizePromptResponse
|
|
48
|
+
* // optimizedPrompt: { // OptimizedPromptStream Union: only one key present
|
|
49
|
+
* // optimizedPromptEvent: { // OptimizedPromptEvent
|
|
50
|
+
* // optimizedPrompt: { // OptimizedPrompt Union: only one key present
|
|
51
|
+
* // textPrompt: { // TextPrompt
|
|
52
|
+
* // text: "STRING_VALUE", // required
|
|
53
|
+
* // },
|
|
54
|
+
* // },
|
|
55
|
+
* // },
|
|
56
|
+
* // analyzePromptEvent: { // AnalyzePromptEvent
|
|
57
|
+
* // message: "STRING_VALUE",
|
|
58
|
+
* // },
|
|
59
|
+
* // internalServerException: { // InternalServerException
|
|
60
|
+
* // message: "STRING_VALUE",
|
|
61
|
+
* // },
|
|
62
|
+
* // throttlingException: { // ThrottlingException
|
|
63
|
+
* // message: "STRING_VALUE",
|
|
64
|
+
* // },
|
|
65
|
+
* // validationException: { // ValidationException
|
|
66
|
+
* // message: "STRING_VALUE",
|
|
67
|
+
* // },
|
|
68
|
+
* // dependencyFailedException: { // DependencyFailedException
|
|
69
|
+
* // message: "STRING_VALUE",
|
|
70
|
+
* // resourceName: "STRING_VALUE",
|
|
71
|
+
* // },
|
|
72
|
+
* // accessDeniedException: { // AccessDeniedException
|
|
73
|
+
* // message: "STRING_VALUE",
|
|
74
|
+
* // },
|
|
75
|
+
* // badGatewayException: { // BadGatewayException
|
|
76
|
+
* // message: "STRING_VALUE",
|
|
77
|
+
* // resourceName: "STRING_VALUE",
|
|
78
|
+
* // },
|
|
79
|
+
* // },
|
|
80
|
+
* // };
|
|
81
|
+
*
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
* @param OptimizePromptCommandInput - {@link OptimizePromptCommandInput}
|
|
85
|
+
* @returns {@link OptimizePromptCommandOutput}
|
|
86
|
+
* @see {@link OptimizePromptCommandInput} for command's `input` shape.
|
|
87
|
+
* @see {@link OptimizePromptCommandOutput} for command's `response` shape.
|
|
88
|
+
* @see {@link BedrockAgentRuntimeClientResolvedConfig | config} for BedrockAgentRuntimeClient's `config` shape.
|
|
89
|
+
*
|
|
90
|
+
* @throws {@link AccessDeniedException} (client fault)
|
|
91
|
+
* <p>The request is denied because of missing access permissions. Check your permissions and retry your request.</p>
|
|
92
|
+
*
|
|
93
|
+
* @throws {@link BadGatewayException} (server fault)
|
|
94
|
+
* <p>There was an issue with a dependency due to a server issue. Retry your request.</p>
|
|
95
|
+
*
|
|
96
|
+
* @throws {@link DependencyFailedException} (client fault)
|
|
97
|
+
* <p>There was an issue with a dependency. Check the resource configurations and retry the request.</p>
|
|
98
|
+
*
|
|
99
|
+
* @throws {@link InternalServerException} (server fault)
|
|
100
|
+
* <p>An internal server error occurred. Retry your request.</p>
|
|
101
|
+
*
|
|
102
|
+
* @throws {@link ThrottlingException} (client fault)
|
|
103
|
+
* <p>The number of requests exceeds the limit. Resubmit your request later.</p>
|
|
104
|
+
*
|
|
105
|
+
* @throws {@link ValidationException} (client fault)
|
|
106
|
+
* <p>Input validation failed. Check your request parameters and retry the request.</p>
|
|
107
|
+
*
|
|
108
|
+
* @throws {@link BedrockAgentRuntimeServiceException}
|
|
109
|
+
* <p>Base exception class for all service exceptions from BedrockAgentRuntime service.</p>
|
|
110
|
+
*
|
|
111
|
+
* @public
|
|
112
|
+
*/
|
|
113
|
+
export declare class OptimizePromptCommand extends OptimizePromptCommand_base {
|
|
114
|
+
/** @internal type navigation helper, not in runtime. */
|
|
115
|
+
protected static __types: {
|
|
116
|
+
api: {
|
|
117
|
+
input: OptimizePromptRequest;
|
|
118
|
+
output: OptimizePromptResponse;
|
|
119
|
+
};
|
|
120
|
+
sdk: {
|
|
121
|
+
input: OptimizePromptCommandInput;
|
|
122
|
+
output: OptimizePromptCommandOutput;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
}
|
|
@@ -2,5 +2,6 @@ export * from "./DeleteAgentMemoryCommand";
|
|
|
2
2
|
export * from "./GetAgentMemoryCommand";
|
|
3
3
|
export * from "./InvokeAgentCommand";
|
|
4
4
|
export * from "./InvokeFlowCommand";
|
|
5
|
+
export * from "./OptimizePromptCommand";
|
|
5
6
|
export * from "./RetrieveAndGenerateCommand";
|
|
6
7
|
export * from "./RetrieveCommand";
|
|
@@ -58,7 +58,7 @@ export interface RequestBody {
|
|
|
58
58
|
content?: Record<string, Parameter[]> | undefined;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
* <p>Contains information about the action group being invoked. For more information about the possible structures, see the InvocationInput tab in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/trace-orchestration.html">OrchestrationTrace</a> in the Amazon Bedrock User Guide
|
|
61
|
+
* <p>Contains information about the action group being invoked. For more information about the possible structures, see the InvocationInput tab in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/trace-orchestration.html">OrchestrationTrace</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a>.</p>
|
|
62
62
|
* @public
|
|
63
63
|
*/
|
|
64
64
|
export interface ActionGroupInvocationInput {
|
|
@@ -3524,6 +3524,280 @@ export interface GetAgentMemoryResponse {
|
|
|
3524
3524
|
*/
|
|
3525
3525
|
memoryContents?: Memory[] | undefined;
|
|
3526
3526
|
}
|
|
3527
|
+
/**
|
|
3528
|
+
* <p>Contains information about the text prompt to optimize.</p>
|
|
3529
|
+
* @public
|
|
3530
|
+
*/
|
|
3531
|
+
export interface TextPrompt {
|
|
3532
|
+
/**
|
|
3533
|
+
* <p>The text in the text prompt to optimize.</p>
|
|
3534
|
+
* @public
|
|
3535
|
+
*/
|
|
3536
|
+
text: string | undefined;
|
|
3537
|
+
}
|
|
3538
|
+
/**
|
|
3539
|
+
* <p>Contains information about the prompt to optimize.</p>
|
|
3540
|
+
* @public
|
|
3541
|
+
*/
|
|
3542
|
+
export type InputPrompt = InputPrompt.TextPromptMember | InputPrompt.$UnknownMember;
|
|
3543
|
+
/**
|
|
3544
|
+
* @public
|
|
3545
|
+
*/
|
|
3546
|
+
export declare namespace InputPrompt {
|
|
3547
|
+
/**
|
|
3548
|
+
* <p>Contains information about the text prompt to optimize.</p>
|
|
3549
|
+
* @public
|
|
3550
|
+
*/
|
|
3551
|
+
interface TextPromptMember {
|
|
3552
|
+
textPrompt: TextPrompt;
|
|
3553
|
+
$unknown?: never;
|
|
3554
|
+
}
|
|
3555
|
+
/**
|
|
3556
|
+
* @public
|
|
3557
|
+
*/
|
|
3558
|
+
interface $UnknownMember {
|
|
3559
|
+
textPrompt?: never;
|
|
3560
|
+
$unknown: [string, any];
|
|
3561
|
+
}
|
|
3562
|
+
interface Visitor<T> {
|
|
3563
|
+
textPrompt: (value: TextPrompt) => T;
|
|
3564
|
+
_: (name: string, value: any) => T;
|
|
3565
|
+
}
|
|
3566
|
+
const visit: <T>(value: InputPrompt, visitor: Visitor<T>) => T;
|
|
3567
|
+
}
|
|
3568
|
+
/**
|
|
3569
|
+
* @public
|
|
3570
|
+
*/
|
|
3571
|
+
export interface OptimizePromptRequest {
|
|
3572
|
+
/**
|
|
3573
|
+
* <p>Contains the prompt to optimize.</p>
|
|
3574
|
+
* @public
|
|
3575
|
+
*/
|
|
3576
|
+
input: InputPrompt | undefined;
|
|
3577
|
+
/**
|
|
3578
|
+
* <p>The unique identifier of the model that you want to optimize the prompt for.</p>
|
|
3579
|
+
* @public
|
|
3580
|
+
*/
|
|
3581
|
+
targetModelId: string | undefined;
|
|
3582
|
+
}
|
|
3583
|
+
/**
|
|
3584
|
+
* <p>An event in which the prompt was analyzed in preparation for optimization.</p>
|
|
3585
|
+
* @public
|
|
3586
|
+
*/
|
|
3587
|
+
export interface AnalyzePromptEvent {
|
|
3588
|
+
/**
|
|
3589
|
+
* <p>A message describing the analysis of the prompt.</p>
|
|
3590
|
+
* @public
|
|
3591
|
+
*/
|
|
3592
|
+
message?: string | undefined;
|
|
3593
|
+
}
|
|
3594
|
+
/**
|
|
3595
|
+
* <p>Contains information about the optimized prompt.</p>
|
|
3596
|
+
* @public
|
|
3597
|
+
*/
|
|
3598
|
+
export type OptimizedPrompt = OptimizedPrompt.TextPromptMember | OptimizedPrompt.$UnknownMember;
|
|
3599
|
+
/**
|
|
3600
|
+
* @public
|
|
3601
|
+
*/
|
|
3602
|
+
export declare namespace OptimizedPrompt {
|
|
3603
|
+
/**
|
|
3604
|
+
* <p>Contains information about the text in the prompt that was optimized.</p>
|
|
3605
|
+
* @public
|
|
3606
|
+
*/
|
|
3607
|
+
interface TextPromptMember {
|
|
3608
|
+
textPrompt: TextPrompt;
|
|
3609
|
+
$unknown?: never;
|
|
3610
|
+
}
|
|
3611
|
+
/**
|
|
3612
|
+
* @public
|
|
3613
|
+
*/
|
|
3614
|
+
interface $UnknownMember {
|
|
3615
|
+
textPrompt?: never;
|
|
3616
|
+
$unknown: [string, any];
|
|
3617
|
+
}
|
|
3618
|
+
interface Visitor<T> {
|
|
3619
|
+
textPrompt: (value: TextPrompt) => T;
|
|
3620
|
+
_: (name: string, value: any) => T;
|
|
3621
|
+
}
|
|
3622
|
+
const visit: <T>(value: OptimizedPrompt, visitor: Visitor<T>) => T;
|
|
3623
|
+
}
|
|
3624
|
+
/**
|
|
3625
|
+
* <p>An event in which the prompt was optimized.</p>
|
|
3626
|
+
* @public
|
|
3627
|
+
*/
|
|
3628
|
+
export interface OptimizedPromptEvent {
|
|
3629
|
+
/**
|
|
3630
|
+
* <p>Contains information about the optimized prompt.</p>
|
|
3631
|
+
* @public
|
|
3632
|
+
*/
|
|
3633
|
+
optimizedPrompt?: OptimizedPrompt | undefined;
|
|
3634
|
+
}
|
|
3635
|
+
/**
|
|
3636
|
+
* <p>The stream containing events in the prompt optimization process.</p>
|
|
3637
|
+
* @public
|
|
3638
|
+
*/
|
|
3639
|
+
export type OptimizedPromptStream = OptimizedPromptStream.AccessDeniedExceptionMember | OptimizedPromptStream.AnalyzePromptEventMember | OptimizedPromptStream.BadGatewayExceptionMember | OptimizedPromptStream.DependencyFailedExceptionMember | OptimizedPromptStream.InternalServerExceptionMember | OptimizedPromptStream.OptimizedPromptEventMember | OptimizedPromptStream.ThrottlingExceptionMember | OptimizedPromptStream.ValidationExceptionMember | OptimizedPromptStream.$UnknownMember;
|
|
3640
|
+
/**
|
|
3641
|
+
* @public
|
|
3642
|
+
*/
|
|
3643
|
+
export declare namespace OptimizedPromptStream {
|
|
3644
|
+
/**
|
|
3645
|
+
* <p>An event in which the prompt was optimized.</p>
|
|
3646
|
+
* @public
|
|
3647
|
+
*/
|
|
3648
|
+
interface OptimizedPromptEventMember {
|
|
3649
|
+
optimizedPromptEvent: OptimizedPromptEvent;
|
|
3650
|
+
analyzePromptEvent?: never;
|
|
3651
|
+
internalServerException?: never;
|
|
3652
|
+
throttlingException?: never;
|
|
3653
|
+
validationException?: never;
|
|
3654
|
+
dependencyFailedException?: never;
|
|
3655
|
+
accessDeniedException?: never;
|
|
3656
|
+
badGatewayException?: never;
|
|
3657
|
+
$unknown?: never;
|
|
3658
|
+
}
|
|
3659
|
+
/**
|
|
3660
|
+
* <p>An event in which the prompt was analyzed in preparation for optimization.</p>
|
|
3661
|
+
* @public
|
|
3662
|
+
*/
|
|
3663
|
+
interface AnalyzePromptEventMember {
|
|
3664
|
+
optimizedPromptEvent?: never;
|
|
3665
|
+
analyzePromptEvent: AnalyzePromptEvent;
|
|
3666
|
+
internalServerException?: never;
|
|
3667
|
+
throttlingException?: never;
|
|
3668
|
+
validationException?: never;
|
|
3669
|
+
dependencyFailedException?: never;
|
|
3670
|
+
accessDeniedException?: never;
|
|
3671
|
+
badGatewayException?: never;
|
|
3672
|
+
$unknown?: never;
|
|
3673
|
+
}
|
|
3674
|
+
/**
|
|
3675
|
+
* <p>An internal server error occurred. Retry your request.</p>
|
|
3676
|
+
* @public
|
|
3677
|
+
*/
|
|
3678
|
+
interface InternalServerExceptionMember {
|
|
3679
|
+
optimizedPromptEvent?: never;
|
|
3680
|
+
analyzePromptEvent?: never;
|
|
3681
|
+
internalServerException: InternalServerException;
|
|
3682
|
+
throttlingException?: never;
|
|
3683
|
+
validationException?: never;
|
|
3684
|
+
dependencyFailedException?: never;
|
|
3685
|
+
accessDeniedException?: never;
|
|
3686
|
+
badGatewayException?: never;
|
|
3687
|
+
$unknown?: never;
|
|
3688
|
+
}
|
|
3689
|
+
/**
|
|
3690
|
+
* <p>Your request was throttled because of service-wide limitations. Resubmit your request later or in a different region. You can also purchase <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html">Provisioned Throughput</a> to increase the rate or number of tokens you can process.</p>
|
|
3691
|
+
* @public
|
|
3692
|
+
*/
|
|
3693
|
+
interface ThrottlingExceptionMember {
|
|
3694
|
+
optimizedPromptEvent?: never;
|
|
3695
|
+
analyzePromptEvent?: never;
|
|
3696
|
+
internalServerException?: never;
|
|
3697
|
+
throttlingException: ThrottlingException;
|
|
3698
|
+
validationException?: never;
|
|
3699
|
+
dependencyFailedException?: never;
|
|
3700
|
+
accessDeniedException?: never;
|
|
3701
|
+
badGatewayException?: never;
|
|
3702
|
+
$unknown?: never;
|
|
3703
|
+
}
|
|
3704
|
+
/**
|
|
3705
|
+
* <p>Input validation failed. Check your request parameters and retry the request.</p>
|
|
3706
|
+
* @public
|
|
3707
|
+
*/
|
|
3708
|
+
interface ValidationExceptionMember {
|
|
3709
|
+
optimizedPromptEvent?: never;
|
|
3710
|
+
analyzePromptEvent?: never;
|
|
3711
|
+
internalServerException?: never;
|
|
3712
|
+
throttlingException?: never;
|
|
3713
|
+
validationException: ValidationException;
|
|
3714
|
+
dependencyFailedException?: never;
|
|
3715
|
+
accessDeniedException?: never;
|
|
3716
|
+
badGatewayException?: never;
|
|
3717
|
+
$unknown?: never;
|
|
3718
|
+
}
|
|
3719
|
+
/**
|
|
3720
|
+
* <p>There was an issue with a dependency. Check the resource configurations and retry the request.</p>
|
|
3721
|
+
* @public
|
|
3722
|
+
*/
|
|
3723
|
+
interface DependencyFailedExceptionMember {
|
|
3724
|
+
optimizedPromptEvent?: never;
|
|
3725
|
+
analyzePromptEvent?: never;
|
|
3726
|
+
internalServerException?: never;
|
|
3727
|
+
throttlingException?: never;
|
|
3728
|
+
validationException?: never;
|
|
3729
|
+
dependencyFailedException: DependencyFailedException;
|
|
3730
|
+
accessDeniedException?: never;
|
|
3731
|
+
badGatewayException?: never;
|
|
3732
|
+
$unknown?: never;
|
|
3733
|
+
}
|
|
3734
|
+
/**
|
|
3735
|
+
* <p>The request is denied because of missing access permissions. Check your permissions and retry your request.</p>
|
|
3736
|
+
* @public
|
|
3737
|
+
*/
|
|
3738
|
+
interface AccessDeniedExceptionMember {
|
|
3739
|
+
optimizedPromptEvent?: never;
|
|
3740
|
+
analyzePromptEvent?: never;
|
|
3741
|
+
internalServerException?: never;
|
|
3742
|
+
throttlingException?: never;
|
|
3743
|
+
validationException?: never;
|
|
3744
|
+
dependencyFailedException?: never;
|
|
3745
|
+
accessDeniedException: AccessDeniedException;
|
|
3746
|
+
badGatewayException?: never;
|
|
3747
|
+
$unknown?: never;
|
|
3748
|
+
}
|
|
3749
|
+
/**
|
|
3750
|
+
* <p>There was an issue with a dependency due to a server issue. Retry your request.</p>
|
|
3751
|
+
* @public
|
|
3752
|
+
*/
|
|
3753
|
+
interface BadGatewayExceptionMember {
|
|
3754
|
+
optimizedPromptEvent?: never;
|
|
3755
|
+
analyzePromptEvent?: never;
|
|
3756
|
+
internalServerException?: never;
|
|
3757
|
+
throttlingException?: never;
|
|
3758
|
+
validationException?: never;
|
|
3759
|
+
dependencyFailedException?: never;
|
|
3760
|
+
accessDeniedException?: never;
|
|
3761
|
+
badGatewayException: BadGatewayException;
|
|
3762
|
+
$unknown?: never;
|
|
3763
|
+
}
|
|
3764
|
+
/**
|
|
3765
|
+
* @public
|
|
3766
|
+
*/
|
|
3767
|
+
interface $UnknownMember {
|
|
3768
|
+
optimizedPromptEvent?: never;
|
|
3769
|
+
analyzePromptEvent?: never;
|
|
3770
|
+
internalServerException?: never;
|
|
3771
|
+
throttlingException?: never;
|
|
3772
|
+
validationException?: never;
|
|
3773
|
+
dependencyFailedException?: never;
|
|
3774
|
+
accessDeniedException?: never;
|
|
3775
|
+
badGatewayException?: never;
|
|
3776
|
+
$unknown: [string, any];
|
|
3777
|
+
}
|
|
3778
|
+
interface Visitor<T> {
|
|
3779
|
+
optimizedPromptEvent: (value: OptimizedPromptEvent) => T;
|
|
3780
|
+
analyzePromptEvent: (value: AnalyzePromptEvent) => T;
|
|
3781
|
+
internalServerException: (value: InternalServerException) => T;
|
|
3782
|
+
throttlingException: (value: ThrottlingException) => T;
|
|
3783
|
+
validationException: (value: ValidationException) => T;
|
|
3784
|
+
dependencyFailedException: (value: DependencyFailedException) => T;
|
|
3785
|
+
accessDeniedException: (value: AccessDeniedException) => T;
|
|
3786
|
+
badGatewayException: (value: BadGatewayException) => T;
|
|
3787
|
+
_: (name: string, value: any) => T;
|
|
3788
|
+
}
|
|
3789
|
+
const visit: <T>(value: OptimizedPromptStream, visitor: Visitor<T>) => T;
|
|
3790
|
+
}
|
|
3791
|
+
/**
|
|
3792
|
+
* @public
|
|
3793
|
+
*/
|
|
3794
|
+
export interface OptimizePromptResponse {
|
|
3795
|
+
/**
|
|
3796
|
+
* <p>The prompt after being optimized for the task.</p>
|
|
3797
|
+
* @public
|
|
3798
|
+
*/
|
|
3799
|
+
optimizedPrompt: AsyncIterable<OptimizedPromptStream> | undefined;
|
|
3800
|
+
}
|
|
3527
3801
|
/**
|
|
3528
3802
|
* <p>Contains the query made to the knowledge base.</p>
|
|
3529
3803
|
* <p>This data type is used in the following API operations:</p>
|
|
@@ -4926,6 +5200,38 @@ export declare const ResponseStreamFilterSensitiveLog: (obj: ResponseStream) =>
|
|
|
4926
5200
|
* @internal
|
|
4927
5201
|
*/
|
|
4928
5202
|
export declare const InvokeAgentResponseFilterSensitiveLog: (obj: InvokeAgentResponse) => any;
|
|
5203
|
+
/**
|
|
5204
|
+
* @internal
|
|
5205
|
+
*/
|
|
5206
|
+
export declare const TextPromptFilterSensitiveLog: (obj: TextPrompt) => any;
|
|
5207
|
+
/**
|
|
5208
|
+
* @internal
|
|
5209
|
+
*/
|
|
5210
|
+
export declare const InputPromptFilterSensitiveLog: (obj: InputPrompt) => any;
|
|
5211
|
+
/**
|
|
5212
|
+
* @internal
|
|
5213
|
+
*/
|
|
5214
|
+
export declare const OptimizePromptRequestFilterSensitiveLog: (obj: OptimizePromptRequest) => any;
|
|
5215
|
+
/**
|
|
5216
|
+
* @internal
|
|
5217
|
+
*/
|
|
5218
|
+
export declare const AnalyzePromptEventFilterSensitiveLog: (obj: AnalyzePromptEvent) => any;
|
|
5219
|
+
/**
|
|
5220
|
+
* @internal
|
|
5221
|
+
*/
|
|
5222
|
+
export declare const OptimizedPromptFilterSensitiveLog: (obj: OptimizedPrompt) => any;
|
|
5223
|
+
/**
|
|
5224
|
+
* @internal
|
|
5225
|
+
*/
|
|
5226
|
+
export declare const OptimizedPromptEventFilterSensitiveLog: (obj: OptimizedPromptEvent) => any;
|
|
5227
|
+
/**
|
|
5228
|
+
* @internal
|
|
5229
|
+
*/
|
|
5230
|
+
export declare const OptimizedPromptStreamFilterSensitiveLog: (obj: OptimizedPromptStream) => any;
|
|
5231
|
+
/**
|
|
5232
|
+
* @internal
|
|
5233
|
+
*/
|
|
5234
|
+
export declare const OptimizePromptResponseFilterSensitiveLog: (obj: OptimizePromptResponse) => any;
|
|
4929
5235
|
/**
|
|
4930
5236
|
* @internal
|
|
4931
5237
|
*/
|
|
@@ -4,6 +4,7 @@ import { DeleteAgentMemoryCommandInput, DeleteAgentMemoryCommandOutput } from ".
|
|
|
4
4
|
import { GetAgentMemoryCommandInput, GetAgentMemoryCommandOutput } from "../commands/GetAgentMemoryCommand";
|
|
5
5
|
import { InvokeAgentCommandInput, InvokeAgentCommandOutput } from "../commands/InvokeAgentCommand";
|
|
6
6
|
import { InvokeFlowCommandInput, InvokeFlowCommandOutput } from "../commands/InvokeFlowCommand";
|
|
7
|
+
import { OptimizePromptCommandInput, OptimizePromptCommandOutput } from "../commands/OptimizePromptCommand";
|
|
7
8
|
import { RetrieveAndGenerateCommandInput, RetrieveAndGenerateCommandOutput } from "../commands/RetrieveAndGenerateCommand";
|
|
8
9
|
import { RetrieveCommandInput, RetrieveCommandOutput } from "../commands/RetrieveCommand";
|
|
9
10
|
/**
|
|
@@ -22,6 +23,10 @@ export declare const se_InvokeAgentCommand: (input: InvokeAgentCommandInput, con
|
|
|
22
23
|
* serializeAws_restJson1InvokeFlowCommand
|
|
23
24
|
*/
|
|
24
25
|
export declare const se_InvokeFlowCommand: (input: InvokeFlowCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
|
|
26
|
+
/**
|
|
27
|
+
* serializeAws_restJson1OptimizePromptCommand
|
|
28
|
+
*/
|
|
29
|
+
export declare const se_OptimizePromptCommand: (input: OptimizePromptCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
|
|
25
30
|
/**
|
|
26
31
|
* serializeAws_restJson1RetrieveCommand
|
|
27
32
|
*/
|
|
@@ -46,6 +51,10 @@ export declare const de_InvokeAgentCommand: (output: __HttpResponse, context: __
|
|
|
46
51
|
* deserializeAws_restJson1InvokeFlowCommand
|
|
47
52
|
*/
|
|
48
53
|
export declare const de_InvokeFlowCommand: (output: __HttpResponse, context: __SerdeContext & __EventStreamSerdeContext) => Promise<InvokeFlowCommandOutput>;
|
|
54
|
+
/**
|
|
55
|
+
* deserializeAws_restJson1OptimizePromptCommand
|
|
56
|
+
*/
|
|
57
|
+
export declare const de_OptimizePromptCommand: (output: __HttpResponse, context: __SerdeContext & __EventStreamSerdeContext) => Promise<OptimizePromptCommandOutput>;
|
|
49
58
|
/**
|
|
50
59
|
* deserializeAws_restJson1RetrieveCommand
|
|
51
60
|
*/
|
|
@@ -16,6 +16,10 @@ import {
|
|
|
16
16
|
InvokeFlowCommandInput,
|
|
17
17
|
InvokeFlowCommandOutput,
|
|
18
18
|
} from "./commands/InvokeFlowCommand";
|
|
19
|
+
import {
|
|
20
|
+
OptimizePromptCommandInput,
|
|
21
|
+
OptimizePromptCommandOutput,
|
|
22
|
+
} from "./commands/OptimizePromptCommand";
|
|
19
23
|
import {
|
|
20
24
|
RetrieveAndGenerateCommandInput,
|
|
21
25
|
RetrieveAndGenerateCommandOutput,
|
|
@@ -77,6 +81,19 @@ export interface BedrockAgentRuntime {
|
|
|
77
81
|
options: __HttpHandlerOptions,
|
|
78
82
|
cb: (err: any, data?: InvokeFlowCommandOutput) => void
|
|
79
83
|
): void;
|
|
84
|
+
optimizePrompt(
|
|
85
|
+
args: OptimizePromptCommandInput,
|
|
86
|
+
options?: __HttpHandlerOptions
|
|
87
|
+
): Promise<OptimizePromptCommandOutput>;
|
|
88
|
+
optimizePrompt(
|
|
89
|
+
args: OptimizePromptCommandInput,
|
|
90
|
+
cb: (err: any, data?: OptimizePromptCommandOutput) => void
|
|
91
|
+
): void;
|
|
92
|
+
optimizePrompt(
|
|
93
|
+
args: OptimizePromptCommandInput,
|
|
94
|
+
options: __HttpHandlerOptions,
|
|
95
|
+
cb: (err: any, data?: OptimizePromptCommandOutput) => void
|
|
96
|
+
): void;
|
|
80
97
|
retrieve(
|
|
81
98
|
args: RetrieveCommandInput,
|
|
82
99
|
options?: __HttpHandlerOptions
|
|
@@ -66,6 +66,10 @@ import {
|
|
|
66
66
|
InvokeFlowCommandInput,
|
|
67
67
|
InvokeFlowCommandOutput,
|
|
68
68
|
} from "./commands/InvokeFlowCommand";
|
|
69
|
+
import {
|
|
70
|
+
OptimizePromptCommandInput,
|
|
71
|
+
OptimizePromptCommandOutput,
|
|
72
|
+
} from "./commands/OptimizePromptCommand";
|
|
69
73
|
import {
|
|
70
74
|
RetrieveAndGenerateCommandInput,
|
|
71
75
|
RetrieveAndGenerateCommandOutput,
|
|
@@ -86,6 +90,7 @@ export type ServiceInputTypes =
|
|
|
86
90
|
| GetAgentMemoryCommandInput
|
|
87
91
|
| InvokeAgentCommandInput
|
|
88
92
|
| InvokeFlowCommandInput
|
|
93
|
+
| OptimizePromptCommandInput
|
|
89
94
|
| RetrieveAndGenerateCommandInput
|
|
90
95
|
| RetrieveCommandInput;
|
|
91
96
|
export type ServiceOutputTypes =
|
|
@@ -93,6 +98,7 @@ export type ServiceOutputTypes =
|
|
|
93
98
|
| GetAgentMemoryCommandOutput
|
|
94
99
|
| InvokeAgentCommandOutput
|
|
95
100
|
| InvokeFlowCommandOutput
|
|
101
|
+
| OptimizePromptCommandOutput
|
|
96
102
|
| RetrieveAndGenerateCommandOutput
|
|
97
103
|
| RetrieveCommandOutput;
|
|
98
104
|
export interface ClientDefaults
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
2
|
+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
|
|
3
|
+
import {
|
|
4
|
+
BedrockAgentRuntimeClientResolvedConfig,
|
|
5
|
+
ServiceInputTypes,
|
|
6
|
+
ServiceOutputTypes,
|
|
7
|
+
} from "../BedrockAgentRuntimeClient";
|
|
8
|
+
import {
|
|
9
|
+
OptimizePromptRequest,
|
|
10
|
+
OptimizePromptResponse,
|
|
11
|
+
} from "../models/models_0";
|
|
12
|
+
export { __MetadataBearer };
|
|
13
|
+
export { $Command };
|
|
14
|
+
export interface OptimizePromptCommandInput extends OptimizePromptRequest {}
|
|
15
|
+
export interface OptimizePromptCommandOutput
|
|
16
|
+
extends OptimizePromptResponse,
|
|
17
|
+
__MetadataBearer {}
|
|
18
|
+
declare const OptimizePromptCommand_base: {
|
|
19
|
+
new (
|
|
20
|
+
input: OptimizePromptCommandInput
|
|
21
|
+
): import("@smithy/smithy-client").CommandImpl<
|
|
22
|
+
OptimizePromptCommandInput,
|
|
23
|
+
OptimizePromptCommandOutput,
|
|
24
|
+
BedrockAgentRuntimeClientResolvedConfig,
|
|
25
|
+
ServiceInputTypes,
|
|
26
|
+
ServiceOutputTypes
|
|
27
|
+
>;
|
|
28
|
+
new (
|
|
29
|
+
__0_0: OptimizePromptCommandInput
|
|
30
|
+
): import("@smithy/smithy-client").CommandImpl<
|
|
31
|
+
OptimizePromptCommandInput,
|
|
32
|
+
OptimizePromptCommandOutput,
|
|
33
|
+
BedrockAgentRuntimeClientResolvedConfig,
|
|
34
|
+
ServiceInputTypes,
|
|
35
|
+
ServiceOutputTypes
|
|
36
|
+
>;
|
|
37
|
+
getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
|
|
38
|
+
};
|
|
39
|
+
export declare class OptimizePromptCommand extends OptimizePromptCommand_base {
|
|
40
|
+
protected static __types: {
|
|
41
|
+
api: {
|
|
42
|
+
input: OptimizePromptRequest;
|
|
43
|
+
output: OptimizePromptResponse;
|
|
44
|
+
};
|
|
45
|
+
sdk: {
|
|
46
|
+
input: OptimizePromptCommandInput;
|
|
47
|
+
output: OptimizePromptCommandOutput;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -2,5 +2,6 @@ export * from "./DeleteAgentMemoryCommand";
|
|
|
2
2
|
export * from "./GetAgentMemoryCommand";
|
|
3
3
|
export * from "./InvokeAgentCommand";
|
|
4
4
|
export * from "./InvokeFlowCommand";
|
|
5
|
+
export * from "./OptimizePromptCommand";
|
|
5
6
|
export * from "./RetrieveAndGenerateCommand";
|
|
6
7
|
export * from "./RetrieveCommand";
|