@aws-sdk/client-bedrock-agent-runtime 3.461.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.
Files changed (95) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +229 -0
  3. package/dist-cjs/BedrockAgentRuntime.js +17 -0
  4. package/dist-cjs/BedrockAgentRuntimeClient.js +45 -0
  5. package/dist-cjs/commands/InvokeAgentCommand.js +52 -0
  6. package/dist-cjs/commands/RetrieveAndGenerateCommand.js +52 -0
  7. package/dist-cjs/commands/RetrieveCommand.js +52 -0
  8. package/dist-cjs/commands/index.js +6 -0
  9. package/dist-cjs/endpoint/EndpointParameters.js +12 -0
  10. package/dist-cjs/endpoint/endpointResolver.js +12 -0
  11. package/dist-cjs/endpoint/ruleset.js +7 -0
  12. package/dist-cjs/extensionConfiguration.js +2 -0
  13. package/dist-cjs/index.js +12 -0
  14. package/dist-cjs/models/BedrockAgentRuntimeServiceException.js +12 -0
  15. package/dist-cjs/models/index.js +4 -0
  16. package/dist-cjs/models/models_0.js +439 -0
  17. package/dist-cjs/pagination/Interfaces.js +2 -0
  18. package/dist-cjs/pagination/RetrievePaginator.js +28 -0
  19. package/dist-cjs/pagination/index.js +5 -0
  20. package/dist-cjs/protocols/Aws_restJson1.js +689 -0
  21. package/dist-cjs/runtimeConfig.browser.js +41 -0
  22. package/dist-cjs/runtimeConfig.js +52 -0
  23. package/dist-cjs/runtimeConfig.native.js +15 -0
  24. package/dist-cjs/runtimeConfig.shared.js +24 -0
  25. package/dist-cjs/runtimeExtensions.js +22 -0
  26. package/dist-es/BedrockAgentRuntime.js +13 -0
  27. package/dist-es/BedrockAgentRuntimeClient.js +41 -0
  28. package/dist-es/commands/InvokeAgentCommand.js +48 -0
  29. package/dist-es/commands/RetrieveAndGenerateCommand.js +48 -0
  30. package/dist-es/commands/RetrieveCommand.js +48 -0
  31. package/dist-es/commands/index.js +3 -0
  32. package/dist-es/endpoint/EndpointParameters.js +8 -0
  33. package/dist-es/endpoint/endpointResolver.js +8 -0
  34. package/dist-es/endpoint/ruleset.js +4 -0
  35. package/dist-es/extensionConfiguration.js +1 -0
  36. package/dist-es/index.js +7 -0
  37. package/dist-es/models/BedrockAgentRuntimeServiceException.js +8 -0
  38. package/dist-es/models/index.js +1 -0
  39. package/dist-es/models/models_0.js +396 -0
  40. package/dist-es/pagination/Interfaces.js +1 -0
  41. package/dist-es/pagination/RetrievePaginator.js +24 -0
  42. package/dist-es/pagination/index.js +2 -0
  43. package/dist-es/protocols/Aws_restJson1.js +680 -0
  44. package/dist-es/runtimeConfig.browser.js +36 -0
  45. package/dist-es/runtimeConfig.js +47 -0
  46. package/dist-es/runtimeConfig.native.js +11 -0
  47. package/dist-es/runtimeConfig.shared.js +20 -0
  48. package/dist-es/runtimeExtensions.js +18 -0
  49. package/dist-types/BedrockAgentRuntime.d.ts +31 -0
  50. package/dist-types/BedrockAgentRuntimeClient.d.ts +177 -0
  51. package/dist-types/commands/InvokeAgentCommand.d.ts +321 -0
  52. package/dist-types/commands/RetrieveAndGenerateCommand.d.ts +142 -0
  53. package/dist-types/commands/RetrieveCommand.d.ts +123 -0
  54. package/dist-types/commands/index.d.ts +3 -0
  55. package/dist-types/endpoint/EndpointParameters.d.ts +22 -0
  56. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  57. package/dist-types/endpoint/ruleset.d.ts +2 -0
  58. package/dist-types/extensionConfiguration.d.ts +8 -0
  59. package/dist-types/index.d.ts +15 -0
  60. package/dist-types/models/BedrockAgentRuntimeServiceException.d.ts +13 -0
  61. package/dist-types/models/index.d.ts +1 -0
  62. package/dist-types/models/models_0.d.ts +1598 -0
  63. package/dist-types/pagination/Interfaces.d.ts +8 -0
  64. package/dist-types/pagination/RetrievePaginator.d.ts +7 -0
  65. package/dist-types/pagination/index.d.ts +2 -0
  66. package/dist-types/protocols/Aws_restJson1.d.ts +29 -0
  67. package/dist-types/runtimeConfig.browser.d.ts +47 -0
  68. package/dist-types/runtimeConfig.d.ts +47 -0
  69. package/dist-types/runtimeConfig.native.d.ts +46 -0
  70. package/dist-types/runtimeConfig.shared.d.ts +19 -0
  71. package/dist-types/runtimeExtensions.d.ts +17 -0
  72. package/dist-types/ts3.4/BedrockAgentRuntime.d.ts +58 -0
  73. package/dist-types/ts3.4/BedrockAgentRuntimeClient.d.ts +147 -0
  74. package/dist-types/ts3.4/commands/InvokeAgentCommand.d.ts +35 -0
  75. package/dist-types/ts3.4/commands/RetrieveAndGenerateCommand.d.ts +39 -0
  76. package/dist-types/ts3.4/commands/RetrieveCommand.d.ts +35 -0
  77. package/dist-types/ts3.4/commands/index.d.ts +3 -0
  78. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +33 -0
  79. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  80. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  81. package/dist-types/ts3.4/extensionConfiguration.d.ts +7 -0
  82. package/dist-types/ts3.4/index.d.ts +10 -0
  83. package/dist-types/ts3.4/models/BedrockAgentRuntimeServiceException.d.ts +8 -0
  84. package/dist-types/ts3.4/models/index.d.ts +1 -0
  85. package/dist-types/ts3.4/models/models_0.d.ts +737 -0
  86. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  87. package/dist-types/ts3.4/pagination/RetrievePaginator.d.ts +11 -0
  88. package/dist-types/ts3.4/pagination/index.d.ts +2 -0
  89. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +44 -0
  90. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +100 -0
  91. package/dist-types/ts3.4/runtimeConfig.d.ts +100 -0
  92. package/dist-types/ts3.4/runtimeConfig.native.d.ts +91 -0
  93. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +21 -0
  94. package/dist-types/ts3.4/runtimeExtensions.d.ts +13 -0
  95. package/package.json +105 -0
@@ -0,0 +1,321 @@
1
+ import { EndpointParameterInstructions } from "@smithy/middleware-endpoint";
2
+ import { Command as $Command } from "@smithy/smithy-client";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@smithy/types";
4
+ import { BedrockAgentRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentRuntimeClient";
5
+ import { InvokeAgentRequest, InvokeAgentResponse } from "../models/models_0";
6
+ /**
7
+ * @public
8
+ */
9
+ export { __MetadataBearer, $Command };
10
+ /**
11
+ * @public
12
+ *
13
+ * The input for {@link InvokeAgentCommand}.
14
+ */
15
+ export interface InvokeAgentCommandInput extends InvokeAgentRequest {
16
+ }
17
+ /**
18
+ * @public
19
+ *
20
+ * The output of {@link InvokeAgentCommand}.
21
+ */
22
+ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __MetadataBearer {
23
+ }
24
+ /**
25
+ * @public
26
+ * Invokes the specified Bedrock model to run inference using the input provided in the request body.
27
+ * @example
28
+ * Use a bare-bones client and the command you need to make an API call.
29
+ * ```javascript
30
+ * import { BedrockAgentRuntimeClient, InvokeAgentCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import
31
+ * // const { BedrockAgentRuntimeClient, InvokeAgentCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import
32
+ * const client = new BedrockAgentRuntimeClient(config);
33
+ * const input = { // InvokeAgentRequest
34
+ * sessionState: { // SessionState
35
+ * sessionAttributes: { // SessionAttributesMap
36
+ * "<keys>": "STRING_VALUE",
37
+ * },
38
+ * promptSessionAttributes: { // PromptSessionAttributesMap
39
+ * "<keys>": "STRING_VALUE",
40
+ * },
41
+ * },
42
+ * agentId: "STRING_VALUE", // required
43
+ * agentAliasId: "STRING_VALUE", // required
44
+ * sessionId: "STRING_VALUE", // required
45
+ * endSession: true || false,
46
+ * enableTrace: true || false,
47
+ * inputText: "STRING_VALUE", // required
48
+ * };
49
+ * const command = new InvokeAgentCommand(input);
50
+ * const response = await client.send(command);
51
+ * // { // InvokeAgentResponse
52
+ * // completion: { // ResponseStream Union: only one key present
53
+ * // chunk: { // PayloadPart
54
+ * // bytes: "BLOB_VALUE",
55
+ * // attribution: { // Attribution
56
+ * // citations: [ // Citations
57
+ * // { // Citation
58
+ * // generatedResponsePart: { // GeneratedResponsePart
59
+ * // textResponsePart: { // TextResponsePart
60
+ * // text: "STRING_VALUE",
61
+ * // span: { // Span
62
+ * // start: Number("int"),
63
+ * // end: Number("int"),
64
+ * // },
65
+ * // },
66
+ * // },
67
+ * // retrievedReferences: [ // RetrievedReferences
68
+ * // { // RetrievedReference
69
+ * // content: { // RetrievalResultContent
70
+ * // text: "STRING_VALUE", // required
71
+ * // },
72
+ * // location: { // RetrievalResultLocation
73
+ * // type: "S3", // required
74
+ * // s3Location: { // RetrievalResultS3Location
75
+ * // uri: "STRING_VALUE",
76
+ * // },
77
+ * // },
78
+ * // },
79
+ * // ],
80
+ * // },
81
+ * // ],
82
+ * // },
83
+ * // },
84
+ * // trace: { // TracePart
85
+ * // agentId: "STRING_VALUE",
86
+ * // agentAliasId: "STRING_VALUE",
87
+ * // sessionId: "STRING_VALUE",
88
+ * // trace: { // Trace Union: only one key present
89
+ * // preProcessingTrace: { // PreProcessingTrace Union: only one key present
90
+ * // modelInvocationInput: { // ModelInvocationInput
91
+ * // traceId: "STRING_VALUE",
92
+ * // text: "STRING_VALUE",
93
+ * // type: "PRE_PROCESSING" || "ORCHESTRATION" || "KNOWLEDGE_BASE_RESPONSE_GENERATION" || "POST_PROCESSING",
94
+ * // inferenceConfiguration: { // InferenceConfiguration
95
+ * // temperature: Number("float"),
96
+ * // topP: Number("float"),
97
+ * // topK: Number("int"),
98
+ * // maximumLength: Number("int"),
99
+ * // stopSequences: [ // StopSequences
100
+ * // "STRING_VALUE",
101
+ * // ],
102
+ * // },
103
+ * // overrideLambda: "STRING_VALUE",
104
+ * // promptCreationMode: "DEFAULT" || "OVERRIDDEN",
105
+ * // parserMode: "DEFAULT" || "OVERRIDDEN",
106
+ * // },
107
+ * // modelInvocationOutput: { // PreProcessingModelInvocationOutput
108
+ * // traceId: "STRING_VALUE",
109
+ * // parsedResponse: { // PreProcessingParsedResponse
110
+ * // rationale: "STRING_VALUE",
111
+ * // isValid: true || false,
112
+ * // },
113
+ * // },
114
+ * // },
115
+ * // orchestrationTrace: { // OrchestrationTrace Union: only one key present
116
+ * // rationale: { // Rationale
117
+ * // traceId: "STRING_VALUE",
118
+ * // text: "STRING_VALUE",
119
+ * // },
120
+ * // invocationInput: { // InvocationInput
121
+ * // traceId: "STRING_VALUE",
122
+ * // invocationType: "ACTION_GROUP" || "KNOWLEDGE_BASE" || "FINISH",
123
+ * // actionGroupInvocationInput: { // ActionGroupInvocationInput
124
+ * // actionGroupName: "STRING_VALUE",
125
+ * // verb: "STRING_VALUE",
126
+ * // apiPath: "STRING_VALUE",
127
+ * // parameters: [ // Parameters
128
+ * // { // Parameter
129
+ * // name: "STRING_VALUE",
130
+ * // type: "STRING_VALUE",
131
+ * // value: "STRING_VALUE",
132
+ * // },
133
+ * // ],
134
+ * // requestBody: { // RequestBody
135
+ * // content: { // ContentMap
136
+ * // "<keys>": [
137
+ * // {
138
+ * // name: "STRING_VALUE",
139
+ * // type: "STRING_VALUE",
140
+ * // value: "STRING_VALUE",
141
+ * // },
142
+ * // ],
143
+ * // },
144
+ * // },
145
+ * // },
146
+ * // knowledgeBaseLookupInput: { // KnowledgeBaseLookupInput
147
+ * // text: "STRING_VALUE",
148
+ * // knowledgeBaseId: "STRING_VALUE",
149
+ * // },
150
+ * // },
151
+ * // observation: { // Observation
152
+ * // traceId: "STRING_VALUE",
153
+ * // type: "ACTION_GROUP" || "KNOWLEDGE_BASE" || "FINISH" || "ASK_USER" || "REPROMPT",
154
+ * // actionGroupInvocationOutput: { // ActionGroupInvocationOutput
155
+ * // text: "STRING_VALUE",
156
+ * // },
157
+ * // knowledgeBaseLookupOutput: { // KnowledgeBaseLookupOutput
158
+ * // retrievedReferences: [
159
+ * // {
160
+ * // content: {
161
+ * // text: "STRING_VALUE", // required
162
+ * // },
163
+ * // location: {
164
+ * // type: "S3", // required
165
+ * // s3Location: {
166
+ * // uri: "STRING_VALUE",
167
+ * // },
168
+ * // },
169
+ * // },
170
+ * // ],
171
+ * // },
172
+ * // finalResponse: { // FinalResponse
173
+ * // text: "STRING_VALUE",
174
+ * // },
175
+ * // repromptResponse: { // RepromptResponse
176
+ * // text: "STRING_VALUE",
177
+ * // source: "ACTION_GROUP" || "KNOWLEDGE_BASE" || "PARSER",
178
+ * // },
179
+ * // },
180
+ * // modelInvocationInput: {
181
+ * // traceId: "STRING_VALUE",
182
+ * // text: "STRING_VALUE",
183
+ * // type: "PRE_PROCESSING" || "ORCHESTRATION" || "KNOWLEDGE_BASE_RESPONSE_GENERATION" || "POST_PROCESSING",
184
+ * // inferenceConfiguration: {
185
+ * // temperature: Number("float"),
186
+ * // topP: Number("float"),
187
+ * // topK: Number("int"),
188
+ * // maximumLength: Number("int"),
189
+ * // stopSequences: [
190
+ * // "STRING_VALUE",
191
+ * // ],
192
+ * // },
193
+ * // overrideLambda: "STRING_VALUE",
194
+ * // promptCreationMode: "DEFAULT" || "OVERRIDDEN",
195
+ * // parserMode: "DEFAULT" || "OVERRIDDEN",
196
+ * // },
197
+ * // },
198
+ * // postProcessingTrace: { // PostProcessingTrace Union: only one key present
199
+ * // modelInvocationInput: {
200
+ * // traceId: "STRING_VALUE",
201
+ * // text: "STRING_VALUE",
202
+ * // type: "PRE_PROCESSING" || "ORCHESTRATION" || "KNOWLEDGE_BASE_RESPONSE_GENERATION" || "POST_PROCESSING",
203
+ * // inferenceConfiguration: {
204
+ * // temperature: Number("float"),
205
+ * // topP: Number("float"),
206
+ * // topK: Number("int"),
207
+ * // maximumLength: Number("int"),
208
+ * // stopSequences: [
209
+ * // "STRING_VALUE",
210
+ * // ],
211
+ * // },
212
+ * // overrideLambda: "STRING_VALUE",
213
+ * // promptCreationMode: "DEFAULT" || "OVERRIDDEN",
214
+ * // parserMode: "DEFAULT" || "OVERRIDDEN",
215
+ * // },
216
+ * // modelInvocationOutput: { // PostProcessingModelInvocationOutput
217
+ * // traceId: "STRING_VALUE",
218
+ * // parsedResponse: { // PostProcessingParsedResponse
219
+ * // text: "STRING_VALUE",
220
+ * // },
221
+ * // },
222
+ * // },
223
+ * // failureTrace: { // FailureTrace
224
+ * // traceId: "STRING_VALUE",
225
+ * // failureReason: "STRING_VALUE",
226
+ * // },
227
+ * // },
228
+ * // },
229
+ * // internalServerException: { // InternalServerException
230
+ * // message: "STRING_VALUE",
231
+ * // },
232
+ * // validationException: { // ValidationException
233
+ * // message: "STRING_VALUE",
234
+ * // },
235
+ * // resourceNotFoundException: { // ResourceNotFoundException
236
+ * // message: "STRING_VALUE",
237
+ * // },
238
+ * // serviceQuotaExceededException: { // ServiceQuotaExceededException
239
+ * // message: "STRING_VALUE",
240
+ * // },
241
+ * // throttlingException: { // ThrottlingException
242
+ * // message: "STRING_VALUE",
243
+ * // },
244
+ * // accessDeniedException: { // AccessDeniedException
245
+ * // message: "STRING_VALUE",
246
+ * // },
247
+ * // conflictException: { // ConflictException
248
+ * // message: "STRING_VALUE",
249
+ * // },
250
+ * // dependencyFailedException: { // DependencyFailedException
251
+ * // message: "STRING_VALUE",
252
+ * // resourceName: "STRING_VALUE",
253
+ * // },
254
+ * // badGatewayException: { // BadGatewayException
255
+ * // message: "STRING_VALUE",
256
+ * // resourceName: "STRING_VALUE",
257
+ * // },
258
+ * // },
259
+ * // contentType: "STRING_VALUE", // required
260
+ * // sessionId: "STRING_VALUE", // required
261
+ * // };
262
+ *
263
+ * ```
264
+ *
265
+ * @param InvokeAgentCommandInput - {@link InvokeAgentCommandInput}
266
+ * @returns {@link InvokeAgentCommandOutput}
267
+ * @see {@link InvokeAgentCommandInput} for command's `input` shape.
268
+ * @see {@link InvokeAgentCommandOutput} for command's `response` shape.
269
+ * @see {@link BedrockAgentRuntimeClientResolvedConfig | config} for BedrockAgentRuntimeClient's `config` shape.
270
+ *
271
+ * @throws {@link AccessDeniedException} (client fault)
272
+ * This exception is thrown when a request is denied per access permissions
273
+ *
274
+ * @throws {@link BadGatewayException} (server fault)
275
+ * This exception is thrown when a request fails due to dependency like Lambda, Bedrock, STS resource
276
+ *
277
+ * @throws {@link ConflictException} (client fault)
278
+ * This exception is thrown when there is a conflict performing an operation
279
+ *
280
+ * @throws {@link DependencyFailedException} (client fault)
281
+ * 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)
282
+ *
283
+ * @throws {@link InternalServerException} (server fault)
284
+ * This exception is thrown if there was an unexpected error during processing of request
285
+ *
286
+ * @throws {@link ResourceNotFoundException} (client fault)
287
+ * This exception is thrown when a resource referenced by the operation does not exist
288
+ *
289
+ * @throws {@link ServiceQuotaExceededException} (client fault)
290
+ * This exception is thrown when a request is made beyond the service quota
291
+ *
292
+ * @throws {@link ThrottlingException} (client fault)
293
+ * This exception is thrown when the number of requests exceeds the limit
294
+ *
295
+ * @throws {@link ValidationException} (client fault)
296
+ * This exception is thrown when the request's input validation fails
297
+ *
298
+ * @throws {@link BedrockAgentRuntimeServiceException}
299
+ * <p>Base exception class for all service exceptions from BedrockAgentRuntime service.</p>
300
+ *
301
+ */
302
+ export declare class InvokeAgentCommand extends $Command<InvokeAgentCommandInput, InvokeAgentCommandOutput, BedrockAgentRuntimeClientResolvedConfig> {
303
+ readonly input: InvokeAgentCommandInput;
304
+ static getEndpointParameterInstructions(): EndpointParameterInstructions;
305
+ /**
306
+ * @public
307
+ */
308
+ constructor(input: InvokeAgentCommandInput);
309
+ /**
310
+ * @internal
311
+ */
312
+ resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: BedrockAgentRuntimeClientResolvedConfig, options?: __HttpHandlerOptions): Handler<InvokeAgentCommandInput, InvokeAgentCommandOutput>;
313
+ /**
314
+ * @internal
315
+ */
316
+ private serialize;
317
+ /**
318
+ * @internal
319
+ */
320
+ private deserialize;
321
+ }
@@ -0,0 +1,142 @@
1
+ import { EndpointParameterInstructions } from "@smithy/middleware-endpoint";
2
+ import { Command as $Command } from "@smithy/smithy-client";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@smithy/types";
4
+ import { BedrockAgentRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentRuntimeClient";
5
+ import { RetrieveAndGenerateRequest, RetrieveAndGenerateResponse } from "../models/models_0";
6
+ /**
7
+ * @public
8
+ */
9
+ export { __MetadataBearer, $Command };
10
+ /**
11
+ * @public
12
+ *
13
+ * The input for {@link RetrieveAndGenerateCommand}.
14
+ */
15
+ export interface RetrieveAndGenerateCommandInput extends RetrieveAndGenerateRequest {
16
+ }
17
+ /**
18
+ * @public
19
+ *
20
+ * The output of {@link RetrieveAndGenerateCommand}.
21
+ */
22
+ export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateResponse, __MetadataBearer {
23
+ }
24
+ /**
25
+ * @public
26
+ * RetrieveAndGenerate API
27
+ * @example
28
+ * Use a bare-bones client and the command you need to make an API call.
29
+ * ```javascript
30
+ * import { BedrockAgentRuntimeClient, RetrieveAndGenerateCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import
31
+ * // const { BedrockAgentRuntimeClient, RetrieveAndGenerateCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import
32
+ * const client = new BedrockAgentRuntimeClient(config);
33
+ * const input = { // RetrieveAndGenerateRequest
34
+ * sessionId: "STRING_VALUE",
35
+ * input: { // RetrieveAndGenerateInput
36
+ * text: "STRING_VALUE", // required
37
+ * },
38
+ * retrieveAndGenerateConfiguration: { // RetrieveAndGenerateConfiguration
39
+ * type: "KNOWLEDGE_BASE", // required
40
+ * knowledgeBaseConfiguration: { // KnowledgeBaseRetrieveAndGenerateConfiguration
41
+ * knowledgeBaseId: "STRING_VALUE", // required
42
+ * modelArn: "STRING_VALUE", // required
43
+ * },
44
+ * },
45
+ * sessionConfiguration: { // RetrieveAndGenerateSessionConfiguration
46
+ * kmsKeyArn: "STRING_VALUE", // required
47
+ * },
48
+ * };
49
+ * const command = new RetrieveAndGenerateCommand(input);
50
+ * const response = await client.send(command);
51
+ * // { // RetrieveAndGenerateResponse
52
+ * // sessionId: "STRING_VALUE", // required
53
+ * // output: { // RetrieveAndGenerateOutput
54
+ * // text: "STRING_VALUE", // required
55
+ * // },
56
+ * // citations: [ // Citations
57
+ * // { // Citation
58
+ * // generatedResponsePart: { // GeneratedResponsePart
59
+ * // textResponsePart: { // TextResponsePart
60
+ * // text: "STRING_VALUE",
61
+ * // span: { // Span
62
+ * // start: Number("int"),
63
+ * // end: Number("int"),
64
+ * // },
65
+ * // },
66
+ * // },
67
+ * // retrievedReferences: [ // RetrievedReferences
68
+ * // { // RetrievedReference
69
+ * // content: { // RetrievalResultContent
70
+ * // text: "STRING_VALUE", // required
71
+ * // },
72
+ * // location: { // RetrievalResultLocation
73
+ * // type: "S3", // required
74
+ * // s3Location: { // RetrievalResultS3Location
75
+ * // uri: "STRING_VALUE",
76
+ * // },
77
+ * // },
78
+ * // },
79
+ * // ],
80
+ * // },
81
+ * // ],
82
+ * // };
83
+ *
84
+ * ```
85
+ *
86
+ * @param RetrieveAndGenerateCommandInput - {@link RetrieveAndGenerateCommandInput}
87
+ * @returns {@link RetrieveAndGenerateCommandOutput}
88
+ * @see {@link RetrieveAndGenerateCommandInput} for command's `input` shape.
89
+ * @see {@link RetrieveAndGenerateCommandOutput} for command's `response` shape.
90
+ * @see {@link BedrockAgentRuntimeClientResolvedConfig | config} for BedrockAgentRuntimeClient's `config` shape.
91
+ *
92
+ * @throws {@link AccessDeniedException} (client fault)
93
+ * This exception is thrown when a request is denied per access permissions
94
+ *
95
+ * @throws {@link BadGatewayException} (server fault)
96
+ * This exception is thrown when a request fails due to dependency like Lambda, Bedrock, STS resource
97
+ *
98
+ * @throws {@link ConflictException} (client fault)
99
+ * This exception is thrown when there is a conflict performing an operation
100
+ *
101
+ * @throws {@link DependencyFailedException} (client fault)
102
+ * 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)
103
+ *
104
+ * @throws {@link InternalServerException} (server fault)
105
+ * This exception is thrown if there was an unexpected error during processing of request
106
+ *
107
+ * @throws {@link ResourceNotFoundException} (client fault)
108
+ * This exception is thrown when a resource referenced by the operation does not exist
109
+ *
110
+ * @throws {@link ServiceQuotaExceededException} (client fault)
111
+ * This exception is thrown when a request is made beyond the service quota
112
+ *
113
+ * @throws {@link ThrottlingException} (client fault)
114
+ * This exception is thrown when the number of requests exceeds the limit
115
+ *
116
+ * @throws {@link ValidationException} (client fault)
117
+ * This exception is thrown when the request's input validation fails
118
+ *
119
+ * @throws {@link BedrockAgentRuntimeServiceException}
120
+ * <p>Base exception class for all service exceptions from BedrockAgentRuntime service.</p>
121
+ *
122
+ */
123
+ export declare class RetrieveAndGenerateCommand extends $Command<RetrieveAndGenerateCommandInput, RetrieveAndGenerateCommandOutput, BedrockAgentRuntimeClientResolvedConfig> {
124
+ readonly input: RetrieveAndGenerateCommandInput;
125
+ static getEndpointParameterInstructions(): EndpointParameterInstructions;
126
+ /**
127
+ * @public
128
+ */
129
+ constructor(input: RetrieveAndGenerateCommandInput);
130
+ /**
131
+ * @internal
132
+ */
133
+ resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: BedrockAgentRuntimeClientResolvedConfig, options?: __HttpHandlerOptions): Handler<RetrieveAndGenerateCommandInput, RetrieveAndGenerateCommandOutput>;
134
+ /**
135
+ * @internal
136
+ */
137
+ private serialize;
138
+ /**
139
+ * @internal
140
+ */
141
+ private deserialize;
142
+ }
@@ -0,0 +1,123 @@
1
+ import { EndpointParameterInstructions } from "@smithy/middleware-endpoint";
2
+ import { Command as $Command } from "@smithy/smithy-client";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@smithy/types";
4
+ import { BedrockAgentRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentRuntimeClient";
5
+ import { RetrieveRequest, RetrieveResponse } from "../models/models_0";
6
+ /**
7
+ * @public
8
+ */
9
+ export { __MetadataBearer, $Command };
10
+ /**
11
+ * @public
12
+ *
13
+ * The input for {@link RetrieveCommand}.
14
+ */
15
+ export interface RetrieveCommandInput extends RetrieveRequest {
16
+ }
17
+ /**
18
+ * @public
19
+ *
20
+ * The output of {@link RetrieveCommand}.
21
+ */
22
+ export interface RetrieveCommandOutput extends RetrieveResponse, __MetadataBearer {
23
+ }
24
+ /**
25
+ * @public
26
+ * Retrieve from knowledge base.
27
+ * @example
28
+ * Use a bare-bones client and the command you need to make an API call.
29
+ * ```javascript
30
+ * import { BedrockAgentRuntimeClient, RetrieveCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import
31
+ * // const { BedrockAgentRuntimeClient, RetrieveCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import
32
+ * const client = new BedrockAgentRuntimeClient(config);
33
+ * const input = { // RetrieveRequest
34
+ * knowledgeBaseId: "STRING_VALUE", // required
35
+ * retrievalQuery: { // KnowledgeBaseQuery
36
+ * text: "STRING_VALUE", // required
37
+ * },
38
+ * retrievalConfiguration: { // KnowledgeBaseRetrievalConfiguration
39
+ * vectorSearchConfiguration: { // KnowledgeBaseVectorSearchConfiguration
40
+ * numberOfResults: Number("int"), // required
41
+ * },
42
+ * },
43
+ * nextToken: "STRING_VALUE",
44
+ * };
45
+ * const command = new RetrieveCommand(input);
46
+ * const response = await client.send(command);
47
+ * // { // RetrieveResponse
48
+ * // retrievalResults: [ // KnowledgeBaseRetrievalResults // required
49
+ * // { // KnowledgeBaseRetrievalResult
50
+ * // content: { // RetrievalResultContent
51
+ * // text: "STRING_VALUE", // required
52
+ * // },
53
+ * // location: { // RetrievalResultLocation
54
+ * // type: "S3", // required
55
+ * // s3Location: { // RetrievalResultS3Location
56
+ * // uri: "STRING_VALUE",
57
+ * // },
58
+ * // },
59
+ * // score: Number("double"),
60
+ * // },
61
+ * // ],
62
+ * // nextToken: "STRING_VALUE",
63
+ * // };
64
+ *
65
+ * ```
66
+ *
67
+ * @param RetrieveCommandInput - {@link RetrieveCommandInput}
68
+ * @returns {@link RetrieveCommandOutput}
69
+ * @see {@link RetrieveCommandInput} for command's `input` shape.
70
+ * @see {@link RetrieveCommandOutput} for command's `response` shape.
71
+ * @see {@link BedrockAgentRuntimeClientResolvedConfig | config} for BedrockAgentRuntimeClient's `config` shape.
72
+ *
73
+ * @throws {@link AccessDeniedException} (client fault)
74
+ * This exception is thrown when a request is denied per access permissions
75
+ *
76
+ * @throws {@link BadGatewayException} (server fault)
77
+ * This exception is thrown when a request fails due to dependency like Lambda, Bedrock, STS resource
78
+ *
79
+ * @throws {@link ConflictException} (client fault)
80
+ * This exception is thrown when there is a conflict performing an operation
81
+ *
82
+ * @throws {@link DependencyFailedException} (client fault)
83
+ * 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)
84
+ *
85
+ * @throws {@link InternalServerException} (server fault)
86
+ * This exception is thrown if there was an unexpected error during processing of request
87
+ *
88
+ * @throws {@link ResourceNotFoundException} (client fault)
89
+ * This exception is thrown when a resource referenced by the operation does not exist
90
+ *
91
+ * @throws {@link ServiceQuotaExceededException} (client fault)
92
+ * This exception is thrown when a request is made beyond the service quota
93
+ *
94
+ * @throws {@link ThrottlingException} (client fault)
95
+ * This exception is thrown when the number of requests exceeds the limit
96
+ *
97
+ * @throws {@link ValidationException} (client fault)
98
+ * This exception is thrown when the request's input validation fails
99
+ *
100
+ * @throws {@link BedrockAgentRuntimeServiceException}
101
+ * <p>Base exception class for all service exceptions from BedrockAgentRuntime service.</p>
102
+ *
103
+ */
104
+ export declare class RetrieveCommand extends $Command<RetrieveCommandInput, RetrieveCommandOutput, BedrockAgentRuntimeClientResolvedConfig> {
105
+ readonly input: RetrieveCommandInput;
106
+ static getEndpointParameterInstructions(): EndpointParameterInstructions;
107
+ /**
108
+ * @public
109
+ */
110
+ constructor(input: RetrieveCommandInput);
111
+ /**
112
+ * @internal
113
+ */
114
+ resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: BedrockAgentRuntimeClientResolvedConfig, options?: __HttpHandlerOptions): Handler<RetrieveCommandInput, RetrieveCommandOutput>;
115
+ /**
116
+ * @internal
117
+ */
118
+ private serialize;
119
+ /**
120
+ * @internal
121
+ */
122
+ private deserialize;
123
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./InvokeAgentCommand";
2
+ export * from "./RetrieveAndGenerateCommand";
3
+ export * from "./RetrieveCommand";
@@ -0,0 +1,22 @@
1
+ import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@smithy/types";
2
+ /**
3
+ * @public
4
+ */
5
+ export interface ClientInputEndpointParameters {
6
+ region?: string | Provider<string>;
7
+ useDualstackEndpoint?: boolean | Provider<boolean>;
8
+ useFipsEndpoint?: boolean | Provider<boolean>;
9
+ endpoint?: string | Provider<string> | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>;
10
+ }
11
+ export type ClientResolvedEndpointParameters = ClientInputEndpointParameters & {
12
+ defaultSigningName: string;
13
+ };
14
+ export declare const resolveClientEndpointParameters: <T>(options: T & ClientInputEndpointParameters) => T & ClientInputEndpointParameters & {
15
+ defaultSigningName: string;
16
+ };
17
+ export interface EndpointParameters extends __EndpointParameters {
18
+ Region?: string;
19
+ UseDualStack?: boolean;
20
+ UseFIPS?: boolean;
21
+ Endpoint?: string;
22
+ }
@@ -0,0 +1,5 @@
1
+ import { EndpointV2, Logger } from "@smithy/types";
2
+ import { EndpointParameters } from "./EndpointParameters";
3
+ export declare const defaultEndpointResolver: (endpointParams: EndpointParameters, context?: {
4
+ logger?: Logger;
5
+ }) => EndpointV2;
@@ -0,0 +1,2 @@
1
+ import { RuleSetObject } from "@smithy/types";
2
+ export declare const ruleSet: RuleSetObject;
@@ -0,0 +1,8 @@
1
+ import { AwsRegionExtensionConfiguration } from "@aws-sdk/types";
2
+ import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http";
3
+ import { DefaultExtensionConfiguration } from "@smithy/types";
4
+ /**
5
+ * @internal
6
+ */
7
+ export interface BedrockAgentRuntimeExtensionConfiguration extends HttpHandlerExtensionConfiguration, DefaultExtensionConfiguration, AwsRegionExtensionConfiguration {
8
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Amazon Bedrock Agent
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ export * from "./BedrockAgentRuntimeClient";
7
+ export * from "./BedrockAgentRuntime";
8
+ export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters";
9
+ export { RuntimeExtension } from "./runtimeExtensions";
10
+ export { BedrockAgentRuntimeExtensionConfiguration } from "./extensionConfiguration";
11
+ export * from "./commands";
12
+ export * from "./pagination";
13
+ export * from "./models";
14
+ import "@aws-sdk/util-endpoints";
15
+ export { BedrockAgentRuntimeServiceException } from "./models/BedrockAgentRuntimeServiceException";
@@ -0,0 +1,13 @@
1
+ import { ServiceException as __ServiceException, ServiceExceptionOptions as __ServiceExceptionOptions } from "@smithy/smithy-client";
2
+ export { __ServiceException, __ServiceExceptionOptions };
3
+ /**
4
+ * @public
5
+ *
6
+ * Base exception class for all service exceptions from BedrockAgentRuntime service.
7
+ */
8
+ export declare class BedrockAgentRuntimeServiceException extends __ServiceException {
9
+ /**
10
+ * @internal
11
+ */
12
+ constructor(options: __ServiceExceptionOptions);
13
+ }
@@ -0,0 +1 @@
1
+ export * from "./models_0";