aws-sdk-bedrockagentruntime 1.2.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,11 +10,10 @@
10
10
  module Aws::BedrockAgentRuntime
11
11
  module Types
12
12
 
13
- # This exception is thrown when a request is denied per access
14
- # permissions
13
+ # The request is denied because of missing access permissions. Check
14
+ # your permissions and retry your request.
15
15
  #
16
16
  # @!attribute [rw] message
17
- # Non Blank String
18
17
  # @return [String]
19
18
  #
20
19
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/AccessDeniedException AWS API Documentation
@@ -26,44 +25,46 @@ module Aws::BedrockAgentRuntime
26
25
  include Aws::Structure
27
26
  end
28
27
 
29
- # input to lambda used in action group
28
+ # Contains information about the action group being invoked.
30
29
  #
31
30
  # @!attribute [rw] action_group_name
32
- # Agent Trace Action Group Name
33
- # @return [String]
34
- #
35
- # @!attribute [rw] verb
36
- # Agent Trace Action Group Action verb
31
+ # The name of the action group.
37
32
  # @return [String]
38
33
  #
39
34
  # @!attribute [rw] api_path
40
- # Agent Trace Action Group API path
35
+ # The path to the API to call, based off the action group.
41
36
  # @return [String]
42
37
  #
43
38
  # @!attribute [rw] parameters
44
- # list of parameters included in action group invocation
39
+ # The parameters in the Lambda input event.
45
40
  # @return [Array<Types::Parameter>]
46
41
  #
47
42
  # @!attribute [rw] request_body
48
- # Request Body Content Map
43
+ # The parameters in the request body for the Lambda input event.
49
44
  # @return [Types::RequestBody]
50
45
  #
46
+ # @!attribute [rw] verb
47
+ # The API method being used, based off the action group.
48
+ # @return [String]
49
+ #
51
50
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/ActionGroupInvocationInput AWS API Documentation
52
51
  #
53
52
  class ActionGroupInvocationInput < Struct.new(
54
53
  :action_group_name,
55
- :verb,
56
54
  :api_path,
57
55
  :parameters,
58
- :request_body)
59
- SENSITIVE = [:action_group_name, :verb, :api_path]
56
+ :request_body,
57
+ :verb)
58
+ SENSITIVE = [:action_group_name, :api_path, :verb]
60
59
  include Aws::Structure
61
60
  end
62
61
 
63
- # output from lambda used in action group
62
+ # Contains the JSON-formatted string returned by the API invoked by the
63
+ # action group.
64
64
  #
65
65
  # @!attribute [rw] text
66
- # Agent Trace Action Group Lambda Invocation Output String
66
+ # The JSON-formatted string returned by the API invoked by the action
67
+ # group.
67
68
  # @return [String]
68
69
  #
69
70
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/ActionGroupInvocationOutput AWS API Documentation
@@ -74,10 +75,11 @@ module Aws::BedrockAgentRuntime
74
75
  include Aws::Structure
75
76
  end
76
77
 
77
- # Citations associated with final agent response
78
+ # Contains citations for a part of an agent response.
78
79
  #
79
80
  # @!attribute [rw] citations
80
- # List of citations
81
+ # A list of citations and related information for a part of an agent
82
+ # response.
81
83
  # @return [Array<Types::Citation>]
82
84
  #
83
85
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/Attribution AWS API Documentation
@@ -88,15 +90,15 @@ module Aws::BedrockAgentRuntime
88
90
  include Aws::Structure
89
91
  end
90
92
 
91
- # This exception is thrown when a request fails due to dependency like
92
- # Lambda, Bedrock, STS resource
93
+ # There was an issue with a dependency due to a server issue. Retry your
94
+ # request.
93
95
  #
94
96
  # @!attribute [rw] message
95
- # Non Blank String
96
97
  # @return [String]
97
98
  #
98
99
  # @!attribute [rw] resource_name
99
- # Non Blank String
100
+ # The name of the dependency that caused the issue, such as Amazon
101
+ # Bedrock, Lambda, or STS.
100
102
  # @return [String]
101
103
  #
102
104
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/BadGatewayException AWS API Documentation
@@ -109,14 +111,28 @@ module Aws::BedrockAgentRuntime
109
111
  include Aws::Structure
110
112
  end
111
113
 
112
- # Citation associated with the agent response
114
+ # An object containing a segment of the generated response that is based
115
+ # on a source in the knowledge base, alongside information about the
116
+ # source.
117
+ #
118
+ # This data type is used in the following API operations:
119
+ #
120
+ # * [Retrieve response][1] – in the `citations` field
121
+ #
122
+ # * [RetrieveAndGenerate response][2] – in the `citations` field
123
+ #
124
+ #
125
+ #
126
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax
127
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax
113
128
  #
114
129
  # @!attribute [rw] generated_response_part
115
- # Generate response part
130
+ # Contains the generated response and metadata
116
131
  # @return [Types::GeneratedResponsePart]
117
132
  #
118
133
  # @!attribute [rw] retrieved_references
119
- # list of retrieved references
134
+ # Contains metadata about the sources cited for the generated
135
+ # response.
120
136
  # @return [Array<Types::RetrievedReference>]
121
137
  #
122
138
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/Citation AWS API Documentation
@@ -128,11 +144,10 @@ module Aws::BedrockAgentRuntime
128
144
  include Aws::Structure
129
145
  end
130
146
 
131
- # This exception is thrown when there is a conflict performing an
132
- # operation
147
+ # There was a conflict performing an operation. Resolve the conflict and
148
+ # retry your request.
133
149
  #
134
150
  # @!attribute [rw] message
135
- # Non Blank String
136
151
  # @return [String]
137
152
  #
138
153
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/ConflictException AWS API Documentation
@@ -144,16 +159,15 @@ module Aws::BedrockAgentRuntime
144
159
  include Aws::Structure
145
160
  end
146
161
 
147
- # This exception is thrown when a request fails due to dependency like
148
- # Lambda, Bedrock, STS resource due to a customer fault (i.e. bad
149
- # configuration)
162
+ # There was an issue with a dependency. Check the resource
163
+ # configurations and retry the request.
150
164
  #
151
165
  # @!attribute [rw] message
152
- # Non Blank String
153
166
  # @return [String]
154
167
  #
155
168
  # @!attribute [rw] resource_name
156
- # Non Blank String
169
+ # The name of the dependency that caused the issue, such as Amazon
170
+ # Bedrock, Lambda, or STS.
157
171
  # @return [String]
158
172
  #
159
173
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/DependencyFailedException AWS API Documentation
@@ -166,29 +180,29 @@ module Aws::BedrockAgentRuntime
166
180
  include Aws::Structure
167
181
  end
168
182
 
169
- # Trace Part which is emitted when agent trace could not be generated
183
+ # Contains information about the failure of the interaction.
170
184
  #
171
- # @!attribute [rw] trace_id
172
- # Identifier for trace
185
+ # @!attribute [rw] failure_reason
186
+ # The reason the interaction failed.
173
187
  # @return [String]
174
188
  #
175
- # @!attribute [rw] failure_reason
176
- # Agent Trace Failed Reason String
189
+ # @!attribute [rw] trace_id
190
+ # The unique identifier of the trace.
177
191
  # @return [String]
178
192
  #
179
193
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/FailureTrace AWS API Documentation
180
194
  #
181
195
  class FailureTrace < Struct.new(
182
- :trace_id,
183
- :failure_reason)
196
+ :failure_reason,
197
+ :trace_id)
184
198
  SENSITIVE = [:failure_reason]
185
199
  include Aws::Structure
186
200
  end
187
201
 
188
- # Agent finish output
202
+ # Contains details about the response to the user.
189
203
  #
190
204
  # @!attribute [rw] text
191
- # Agent Trace Action Group Lambda Invocation Output String
205
+ # The text in the response to the user.
192
206
  # @return [String]
193
207
  #
194
208
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/FinalResponse AWS API Documentation
@@ -199,10 +213,24 @@ module Aws::BedrockAgentRuntime
199
213
  include Aws::Structure
200
214
  end
201
215
 
202
- # Generate response part
216
+ # Contains metadata about a part of the generated response that is
217
+ # accompanied by a citation.
218
+ #
219
+ # This data type is used in the following API operations:
220
+ #
221
+ # * [Retrieve response][1] – in the `generatedResponsePart` field
222
+ #
223
+ # * [RetrieveAndGenerate response][2] – in the `generatedResponsePart`
224
+ # field
225
+ #
226
+ #
227
+ #
228
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax
229
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax
203
230
  #
204
231
  # @!attribute [rw] text_response_part
205
- # Text response part
232
+ # Contains metadata about a textual part of the generated response
233
+ # that is accompanied by a citation.
206
234
  # @return [Types::TextResponsePart]
207
235
  #
208
236
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/GeneratedResponsePart AWS API Documentation
@@ -213,46 +241,92 @@ module Aws::BedrockAgentRuntime
213
241
  include Aws::Structure
214
242
  end
215
243
 
216
- # Configurations for controlling the inference response of an
217
- # InvokeAgent API call
244
+ # Contains configurations for response generation based on the knowledge
245
+ # base query results.
218
246
  #
219
- # @!attribute [rw] temperature
220
- # Controls randomness, higher values increase diversity
221
- # @return [Float]
247
+ # This data type is used in the following API operations:
222
248
  #
223
- # @!attribute [rw] top_p
224
- # Cumulative probability cutoff for token selection
225
- # @return [Float]
249
+ # * [RetrieveAndGenerate request][1]
250
+ #
251
+ # ^
226
252
  #
227
- # @!attribute [rw] top_k
228
- # Sample from the k most likely next tokens
229
- # @return [Integer]
253
+ #
254
+ #
255
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax
256
+ #
257
+ # @!attribute [rw] prompt_template
258
+ # Contains the template for the prompt that's sent to the model for
259
+ # response generation.
260
+ # @return [Types::PromptTemplate]
261
+ #
262
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/GenerationConfiguration AWS API Documentation
263
+ #
264
+ class GenerationConfiguration < Struct.new(
265
+ :prompt_template)
266
+ SENSITIVE = []
267
+ include Aws::Structure
268
+ end
269
+
270
+ # Specifications about the inference parameters that were provided
271
+ # alongside the prompt. These are specified in the
272
+ # [PromptOverrideConfiguration][1] object that was set when the agent
273
+ # was created or updated. For more information, see [Inference
274
+ # parameters for foundation models][2].
275
+ #
276
+ #
277
+ #
278
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html
279
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html
230
280
  #
231
281
  # @!attribute [rw] maximum_length
232
- # Maximum length of output
282
+ # The maximum number of tokens allowed in the generated response.
233
283
  # @return [Integer]
234
284
  #
235
285
  # @!attribute [rw] stop_sequences
236
- # List of stop sequences
286
+ # A list of stop sequences. A stop sequence is a sequence of
287
+ # characters that causes the model to stop generating the response.
237
288
  # @return [Array<String>]
238
289
  #
290
+ # @!attribute [rw] temperature
291
+ # The likelihood of the model selecting higher-probability options
292
+ # while generating a response. A lower value makes the model more
293
+ # likely to choose higher-probability options, while a higher value
294
+ # makes the model more likely to choose lower-probability options.
295
+ # @return [Float]
296
+ #
297
+ # @!attribute [rw] top_k
298
+ # While generating a response, the model determines the probability of
299
+ # the following token at each point of generation. The value that you
300
+ # set for `topK` is the number of most-likely candidates from which
301
+ # the model chooses the next token in the sequence. For example, if
302
+ # you set `topK` to 50, the model selects the next token from among
303
+ # the top 50 most likely choices.
304
+ # @return [Integer]
305
+ #
306
+ # @!attribute [rw] top_p
307
+ # While generating a response, the model determines the probability of
308
+ # the following token at each point of generation. The value that you
309
+ # set for `Top P` determines the number of most-likely candidates from
310
+ # which the model chooses the next token in the sequence. For example,
311
+ # if you set `topP` to 80, the model only selects the next token from
312
+ # the top 80% of the probability distribution of next tokens.
313
+ # @return [Float]
314
+ #
239
315
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/InferenceConfiguration AWS API Documentation
240
316
  #
241
317
  class InferenceConfiguration < Struct.new(
318
+ :maximum_length,
319
+ :stop_sequences,
242
320
  :temperature,
243
- :top_p,
244
321
  :top_k,
245
- :maximum_length,
246
- :stop_sequences)
322
+ :top_p)
247
323
  SENSITIVE = []
248
324
  include Aws::Structure
249
325
  end
250
326
 
251
- # This exception is thrown if there was an unexpected error during
252
- # processing of request
327
+ # An internal server error occurred. Retry your request.
253
328
  #
254
329
  # @!attribute [rw] message
255
- # Non Blank String
256
330
  # @return [String]
257
331
  #
258
332
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/InternalServerException AWS API Documentation
@@ -264,95 +338,102 @@ module Aws::BedrockAgentRuntime
264
338
  include Aws::Structure
265
339
  end
266
340
 
267
- # Trace Part which contains input details for action group or knowledge
268
- # base
341
+ # Contains information pertaining to the action group or knowledge base
342
+ # that is being invoked.
269
343
  #
270
- # @!attribute [rw] trace_id
271
- # Identifier for trace
272
- # @return [String]
344
+ # @!attribute [rw] action_group_invocation_input
345
+ # Contains information about the action group to be invoked.
346
+ # @return [Types::ActionGroupInvocationInput]
273
347
  #
274
348
  # @!attribute [rw] invocation_type
275
- # types of invocations
349
+ # Specifies whether the agent is invoking an action group or a
350
+ # knowledge base.
276
351
  # @return [String]
277
352
  #
278
- # @!attribute [rw] action_group_invocation_input
279
- # input to lambda used in action group
280
- # @return [Types::ActionGroupInvocationInput]
281
- #
282
353
  # @!attribute [rw] knowledge_base_lookup_input
283
- # Input to lambda used in action group
354
+ # Contains details about the knowledge base to look up and the query
355
+ # to be made.
284
356
  # @return [Types::KnowledgeBaseLookupInput]
285
357
  #
358
+ # @!attribute [rw] trace_id
359
+ # The unique identifier of the trace.
360
+ # @return [String]
361
+ #
286
362
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/InvocationInput AWS API Documentation
287
363
  #
288
364
  class InvocationInput < Struct.new(
289
- :trace_id,
290
- :invocation_type,
291
365
  :action_group_invocation_input,
292
- :knowledge_base_lookup_input)
366
+ :invocation_type,
367
+ :knowledge_base_lookup_input,
368
+ :trace_id)
293
369
  SENSITIVE = []
294
370
  include Aws::Structure
295
371
  end
296
372
 
297
- # InvokeAgent Request
298
- #
299
- # @!attribute [rw] session_state
300
- # Session state passed by customer. Base64 encoded json string
301
- # representation of SessionState.
302
- # @return [Types::SessionState]
373
+ # @!attribute [rw] agent_alias_id
374
+ # The alias of the agent to use.
375
+ # @return [String]
303
376
  #
304
377
  # @!attribute [rw] agent_id
305
- # Identifier for Agent
378
+ # The unique identifier of the agent to use.
306
379
  # @return [String]
307
380
  #
308
- # @!attribute [rw] agent_alias_id
309
- # Identifier for Agent Alias
310
- # @return [String]
381
+ # @!attribute [rw] enable_trace
382
+ # Specifies whether to turn on the trace or not to track the agent's
383
+ # reasoning process. For more information, see [Trace enablement][1].
311
384
  #
312
- # @!attribute [rw] session_id
313
- # Identifier used for the current session
314
- # @return [String]
315
385
  #
316
- # @!attribute [rw] end_session
317
- # End current session
386
+ #
387
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-events
318
388
  # @return [Boolean]
319
389
  #
320
- # @!attribute [rw] enable_trace
321
- # Enable agent trace events for improved debugging
390
+ # @!attribute [rw] end_session
391
+ # Specifies whether to end the session with the agent or not.
322
392
  # @return [Boolean]
323
393
  #
324
394
  # @!attribute [rw] input_text
325
- # Input data in the format specified in the Content-Type request
326
- # header.
395
+ # The prompt text to send the agent.
396
+ # @return [String]
397
+ #
398
+ # @!attribute [rw] session_id
399
+ # The unique identifier of the session. Use the same value across
400
+ # requests to continue the same conversation.
327
401
  # @return [String]
328
402
  #
403
+ # @!attribute [rw] session_state
404
+ # Contains parameters that specify various attributes of the session.
405
+ # For more information, see [Control session context][1].
406
+ #
407
+ #
408
+ #
409
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html
410
+ # @return [Types::SessionState]
411
+ #
329
412
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/InvokeAgentRequest AWS API Documentation
330
413
  #
331
414
  class InvokeAgentRequest < Struct.new(
332
- :session_state,
333
- :agent_id,
334
415
  :agent_alias_id,
335
- :session_id,
336
- :end_session,
416
+ :agent_id,
337
417
  :enable_trace,
338
- :input_text)
418
+ :end_session,
419
+ :input_text,
420
+ :session_id,
421
+ :session_state)
339
422
  SENSITIVE = [:input_text]
340
423
  include Aws::Structure
341
424
  end
342
425
 
343
- # InvokeAgent Response
344
- #
345
426
  # @!attribute [rw] completion
346
- # Inference response from the model in the format specified in the
347
- # Content-Type response header.
427
+ # The agent's response to the user prompt.
348
428
  # @return [Types::ResponseStream]
349
429
  #
350
430
  # @!attribute [rw] content_type
351
- # streaming response mimetype of the model
431
+ # The MIME type of the input data in the request. The default value is
432
+ # `application/json`.
352
433
  # @return [String]
353
434
  #
354
435
  # @!attribute [rw] session_id
355
- # streaming response mimetype of the model
436
+ # The unique identifier of the session with the agent.
356
437
  # @return [String]
357
438
  #
358
439
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/InvokeAgentResponse AWS API Documentation
@@ -365,29 +446,31 @@ module Aws::BedrockAgentRuntime
365
446
  include Aws::Structure
366
447
  end
367
448
 
368
- # Input to lambda used in action group
449
+ # Contains details about the knowledge base to look up and the query to
450
+ # be made.
369
451
  #
370
- # @!attribute [rw] text
371
- # Agent Trace Action Group Lambda Invocation Output String
452
+ # @!attribute [rw] knowledge_base_id
453
+ # The unique identifier of the knowledge base to look up.
372
454
  # @return [String]
373
455
  #
374
- # @!attribute [rw] knowledge_base_id
375
- # Agent Trace Action Group Knowledge Base Id
456
+ # @!attribute [rw] text
457
+ # The query made to the knowledge base.
376
458
  # @return [String]
377
459
  #
378
460
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/KnowledgeBaseLookupInput AWS API Documentation
379
461
  #
380
462
  class KnowledgeBaseLookupInput < Struct.new(
381
- :text,
382
- :knowledge_base_id)
383
- SENSITIVE = [:text, :knowledge_base_id]
463
+ :knowledge_base_id,
464
+ :text)
465
+ SENSITIVE = [:knowledge_base_id, :text]
384
466
  include Aws::Structure
385
467
  end
386
468
 
387
- # Input to lambda used in action group
469
+ # Contains details about the results from looking up the knowledge base.
388
470
  #
389
471
  # @!attribute [rw] retrieved_references
390
- # list of retrieved references
472
+ # Contains metadata about the sources cited for the generated
473
+ # response.
391
474
  # @return [Array<Types::RetrievedReference>]
392
475
  #
393
476
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/KnowledgeBaseLookupOutput AWS API Documentation
@@ -398,10 +481,20 @@ module Aws::BedrockAgentRuntime
398
481
  include Aws::Structure
399
482
  end
400
483
 
401
- # Knowledge base input query.
484
+ # Contains the query made to the knowledge base.
485
+ #
486
+ # This data type is used in the following API operations:
487
+ #
488
+ # * [Retrieve request][1] – in the `retrievalQuery` field
489
+ #
490
+ # ^
491
+ #
492
+ #
493
+ #
494
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax
402
495
  #
403
496
  # @!attribute [rw] text
404
- # Knowledge base input query in text
497
+ # The text of the query made to the knowledge base.
405
498
  # @return [String]
406
499
  #
407
500
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/KnowledgeBaseQuery AWS API Documentation
@@ -412,10 +505,29 @@ module Aws::BedrockAgentRuntime
412
505
  include Aws::Structure
413
506
  end
414
507
 
415
- # Search parameters for retrieving from knowledge base.
508
+ # Contains configurations for the knowledge base query and retrieval
509
+ # process. For more information, see [Query configurations][1].
510
+ #
511
+ # This data type is used in the following API operations:
512
+ #
513
+ # * [Retrieve request][2] – in the `retrievalConfiguration` field
514
+ #
515
+ # * [RetrieveAndGenerate request][3] – in the `retrievalConfiguration`
516
+ # field
517
+ #
518
+ #
519
+ #
520
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html
521
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax
522
+ # [3]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax
416
523
  #
417
524
  # @!attribute [rw] vector_search_configuration
418
- # Knowledge base vector search configuration
525
+ # Contains details about how the results from the vector search should
526
+ # be returned. For more information, see [Query configurations][1].
527
+ #
528
+ #
529
+ #
530
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html
419
531
  # @return [Types::KnowledgeBaseVectorSearchConfiguration]
420
532
  #
421
533
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/KnowledgeBaseRetrievalConfiguration AWS API Documentation
@@ -426,18 +538,28 @@ module Aws::BedrockAgentRuntime
426
538
  include Aws::Structure
427
539
  end
428
540
 
429
- # Result item returned from a knowledge base retrieval.
541
+ # Details about a result from querying the knowledge base.
542
+ #
543
+ # This data type is used in the following API operations:
544
+ #
545
+ # * [Retrieve response][1] – in the `retrievalResults` field
546
+ #
547
+ # ^
548
+ #
549
+ #
550
+ #
551
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax
430
552
  #
431
553
  # @!attribute [rw] content
432
- # Content of a retrieval result.
554
+ # Contains a chunk of text from a data source in the knowledge base.
433
555
  # @return [Types::RetrievalResultContent]
434
556
  #
435
557
  # @!attribute [rw] location
436
- # The source location of a retrieval result.
558
+ # Contains information about the location of the data source.
437
559
  # @return [Types::RetrievalResultLocation]
438
560
  #
439
561
  # @!attribute [rw] score
440
- # The relevance score of a result.
562
+ # The level of relevance of the result to the query.
441
563
  # @return [Float]
442
564
  #
443
565
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/KnowledgeBaseRetrievalResult AWS API Documentation
@@ -450,23 +572,43 @@ module Aws::BedrockAgentRuntime
450
572
  include Aws::Structure
451
573
  end
452
574
 
453
- # Configurations for retrieval and generation for knowledge base.
575
+ # Contains details about the resource being queried.
576
+ #
577
+ # This data type is used in the following API operations:
578
+ #
579
+ # * [Retrieve request][1] – in the `knowledgeBaseConfiguration` field
580
+ #
581
+ # * [RetrieveAndGenerate request][2] – in the
582
+ # `knowledgeBaseConfiguration` field
583
+ #
584
+ #
585
+ #
586
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax
587
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax
588
+ #
589
+ # @!attribute [rw] generation_configuration
590
+ # Contains configurations for response generation based on the
591
+ # knowwledge base query results.
592
+ # @return [Types::GenerationConfiguration]
454
593
  #
455
594
  # @!attribute [rw] knowledge_base_id
456
- # Identifier of the KnowledgeBase
595
+ # The unique identifier of the knowledge base that is queried and the
596
+ # foundation model used for generation.
457
597
  # @return [String]
458
598
  #
459
599
  # @!attribute [rw] model_arn
460
- # Arn of a Bedrock model.
600
+ # The ARN of the foundation model used to generate a response.
461
601
  # @return [String]
462
602
  #
463
603
  # @!attribute [rw] retrieval_configuration
464
- # Search parameters for retrieving from knowledge base.
604
+ # Contains configurations for how to retrieve and return the knowledge
605
+ # base query.
465
606
  # @return [Types::KnowledgeBaseRetrievalConfiguration]
466
607
  #
467
608
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/KnowledgeBaseRetrieveAndGenerateConfiguration AWS API Documentation
468
609
  #
469
610
  class KnowledgeBaseRetrieveAndGenerateConfiguration < Struct.new(
611
+ :generation_configuration,
470
612
  :knowledge_base_id,
471
613
  :model_arn,
472
614
  :retrieval_configuration)
@@ -474,14 +616,39 @@ module Aws::BedrockAgentRuntime
474
616
  include Aws::Structure
475
617
  end
476
618
 
477
- # Knowledge base vector search configuration
619
+ # Configurations for how to perform the search query and return results.
620
+ # For more information, see [Query configurations][1].
621
+ #
622
+ # This data type is used in the following API operations:
623
+ #
624
+ # * [Retrieve request][2] – in the `vectorSearchConfiguration` field
625
+ #
626
+ # * [RetrieveAndGenerate request][3] – in the
627
+ # `vectorSearchConfiguration` field
628
+ #
629
+ #
630
+ #
631
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html
632
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax
633
+ # [3]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax
478
634
  #
479
635
  # @!attribute [rw] number_of_results
480
- # Top-K results to retrieve from knowledge base.
636
+ # The number of source chunks to retrieve.
481
637
  # @return [Integer]
482
638
  #
483
639
  # @!attribute [rw] override_search_type
484
- # Override the type of query to be performed on data store
640
+ # By default, Amazon Bedrock decides a search strategy for you. If
641
+ # you're using an Amazon OpenSearch Serverless vector store that
642
+ # contains a filterable text field, you can specify whether to query
643
+ # the knowledge base with a `HYBRID` search using both vector
644
+ # embeddings and raw text, or `SEMANTIC` search using only vector
645
+ # embeddings. For other vector store configurations, only `SEMANTIC`
646
+ # search is available. For more information, see [Test a knowledge
647
+ # base][1].
648
+ #
649
+ #
650
+ #
651
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-test.html
485
652
  # @return [String]
486
653
  #
487
654
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/KnowledgeBaseVectorSearchConfiguration AWS API Documentation
@@ -493,144 +660,206 @@ module Aws::BedrockAgentRuntime
493
660
  include Aws::Structure
494
661
  end
495
662
 
496
- # Trace Part which contains information used to call Invoke Model
663
+ # The input for the pre-processing step.
497
664
  #
498
- # @!attribute [rw] trace_id
499
- # Identifier for trace
500
- # @return [String]
665
+ # * The `type` matches the agent step.
501
666
  #
502
- # @!attribute [rw] text
503
- # Prompt Message
504
- # @return [String]
667
+ # * The `text` contains the prompt.
505
668
  #
506
- # @!attribute [rw] type
507
- # types of prompts
508
- # @return [String]
669
+ # * The `inferenceConfiguration`, `parserMode`, and `overrideLambda`
670
+ # values are set in the [PromptOverrideConfiguration][1] object that
671
+ # was set when the agent was created or updated.
672
+ #
673
+ #
674
+ #
675
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html
509
676
  #
510
677
  # @!attribute [rw] inference_configuration
511
- # Configurations for controlling the inference response of an
512
- # InvokeAgent API call
678
+ # Specifications about the inference parameters that were provided
679
+ # alongside the prompt. These are specified in the
680
+ # [PromptOverrideConfiguration][1] object that was set when the agent
681
+ # was created or updated. For more information, see [Inference
682
+ # parameters for foundation models][2].
683
+ #
684
+ #
685
+ #
686
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html
687
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html
513
688
  # @return [Types::InferenceConfiguration]
514
689
  #
515
690
  # @!attribute [rw] override_lambda
516
- # ARN of a Lambda.
691
+ # The ARN of the Lambda function to use when parsing the raw
692
+ # foundation model output in parts of the agent sequence.
693
+ # @return [String]
694
+ #
695
+ # @!attribute [rw] parser_mode
696
+ # Specifies whether to override the default parser Lambda function
697
+ # when parsing the raw foundation model output in the part of the
698
+ # agent sequence defined by the `promptType`.
517
699
  # @return [String]
518
700
  #
519
701
  # @!attribute [rw] prompt_creation_mode
520
- # indicates if agent uses default prompt or overriden prompt
702
+ # Specifies whether the default prompt template was `OVERRIDDEN`. If
703
+ # it was, the `basePromptTemplate` that was set in the
704
+ # [PromptOverrideConfiguration][1] object when the agent was created
705
+ # or updated is used instead.
706
+ #
707
+ #
708
+ #
709
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html
521
710
  # @return [String]
522
711
  #
523
- # @!attribute [rw] parser_mode
524
- # indicates if agent uses default prompt or overriden prompt
712
+ # @!attribute [rw] text
713
+ # The text that prompted the agent at this step.
714
+ # @return [String]
715
+ #
716
+ # @!attribute [rw] trace_id
717
+ # The unique identifier of the trace.
718
+ # @return [String]
719
+ #
720
+ # @!attribute [rw] type
721
+ # The step in the agent sequence.
525
722
  # @return [String]
526
723
  #
527
724
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/ModelInvocationInput AWS API Documentation
528
725
  #
529
726
  class ModelInvocationInput < Struct.new(
530
- :trace_id,
531
- :text,
532
- :type,
533
727
  :inference_configuration,
534
728
  :override_lambda,
729
+ :parser_mode,
535
730
  :prompt_creation_mode,
536
- :parser_mode)
731
+ :text,
732
+ :trace_id,
733
+ :type)
537
734
  SENSITIVE = [:text]
538
735
  include Aws::Structure
539
736
  end
540
737
 
541
- # Trace Part which contains output details for action group or knowledge
542
- # base or final response
543
- #
544
- # @!attribute [rw] trace_id
545
- # Identifier for trace
546
- # @return [String]
547
- #
548
- # @!attribute [rw] type
549
- # types of observations
550
- # @return [String]
738
+ # Contains the result or output of an action group or knowledge base, or
739
+ # the response to the user.
551
740
  #
552
741
  # @!attribute [rw] action_group_invocation_output
553
- # output from lambda used in action group
742
+ # Contains the JSON-formatted string returned by the API invoked by
743
+ # the action group.
554
744
  # @return [Types::ActionGroupInvocationOutput]
555
745
  #
556
- # @!attribute [rw] knowledge_base_lookup_output
557
- # Input to lambda used in action group
558
- # @return [Types::KnowledgeBaseLookupOutput]
559
- #
560
746
  # @!attribute [rw] final_response
561
- # Agent finish output
747
+ # Contains details about the response to the user.
562
748
  # @return [Types::FinalResponse]
563
749
  #
750
+ # @!attribute [rw] knowledge_base_lookup_output
751
+ # Contains details about the results from looking up the knowledge
752
+ # base.
753
+ # @return [Types::KnowledgeBaseLookupOutput]
754
+ #
564
755
  # @!attribute [rw] reprompt_response
565
- # Observation information if there were reprompts
756
+ # Contains details about the response to reprompt the input.
566
757
  # @return [Types::RepromptResponse]
567
758
  #
759
+ # @!attribute [rw] trace_id
760
+ # The unique identifier of the trace.
761
+ # @return [String]
762
+ #
763
+ # @!attribute [rw] type
764
+ # Specifies what kind of information the agent returns in the
765
+ # observation. The following values are possible.
766
+ #
767
+ # * `ACTION_GROUP` – The agent returns the result of an action group.
768
+ #
769
+ # * `KNOWLEDGE_BASE` – The agent returns information from a knowledge
770
+ # base.
771
+ #
772
+ # * `FINISH` – The agent returns a final response to the user with no
773
+ # follow-up.
774
+ #
775
+ # * `ASK_USER` – The agent asks the user a question.
776
+ #
777
+ # * `REPROMPT` – The agent prompts the user again for the same
778
+ # information.
779
+ # @return [String]
780
+ #
568
781
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/Observation AWS API Documentation
569
782
  #
570
783
  class Observation < Struct.new(
571
- :trace_id,
572
- :type,
573
784
  :action_group_invocation_output,
574
- :knowledge_base_lookup_output,
575
785
  :final_response,
576
- :reprompt_response)
786
+ :knowledge_base_lookup_output,
787
+ :reprompt_response,
788
+ :trace_id,
789
+ :type)
577
790
  SENSITIVE = [:reprompt_response]
578
791
  include Aws::Structure
579
792
  end
580
793
 
581
- # Trace contains intermidate response during orchestration
794
+ # Details about the orchestration step, in which the agent determines
795
+ # the order in which actions are executed and which knowledge bases are
796
+ # retrieved.
582
797
  #
583
798
  # @note OrchestrationTrace is a union - when returned from an API call exactly one value will be set and the returned type will be a subclass of OrchestrationTrace corresponding to the set member.
584
799
  #
585
- # @!attribute [rw] rationale
586
- # Trace Part which contains information related to reasoning
587
- # @return [Types::Rationale]
588
- #
589
800
  # @!attribute [rw] invocation_input
590
- # Trace Part which contains input details for action group or
591
- # knowledge base
801
+ # Contains information pertaining to the action group or knowledge
802
+ # base that is being invoked.
592
803
  # @return [Types::InvocationInput]
593
804
  #
805
+ # @!attribute [rw] model_invocation_input
806
+ # The input for the orchestration step.
807
+ #
808
+ # * The `type` is `ORCHESTRATION`.
809
+ #
810
+ # * The `text` contains the prompt.
811
+ #
812
+ # * The `inferenceConfiguration`, `parserMode`, and `overrideLambda`
813
+ # values are set in the [PromptOverrideConfiguration][1] object that
814
+ # was set when the agent was created or updated.
815
+ #
816
+ #
817
+ #
818
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html
819
+ # @return [Types::ModelInvocationInput]
820
+ #
594
821
  # @!attribute [rw] observation
595
- # Trace Part which contains output details for action group or
596
- # knowledge base or final response
822
+ # Details about the observation (the output of the action group Lambda
823
+ # or knowledge base) made by the agent.
597
824
  # @return [Types::Observation]
598
825
  #
599
- # @!attribute [rw] model_invocation_input
600
- # Trace Part which contains information used to call Invoke Model
601
- # @return [Types::ModelInvocationInput]
826
+ # @!attribute [rw] rationale
827
+ # Details about the reasoning, based on the input, that the agent uses
828
+ # to justify carrying out an action group or getting information from
829
+ # a knowledge base.
830
+ # @return [Types::Rationale]
602
831
  #
603
832
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/OrchestrationTrace AWS API Documentation
604
833
  #
605
834
  class OrchestrationTrace < Struct.new(
606
- :rationale,
607
835
  :invocation_input,
608
- :observation,
609
836
  :model_invocation_input,
837
+ :observation,
838
+ :rationale,
610
839
  :unknown)
611
- SENSITIVE = [:rationale, :invocation_input, :observation, :model_invocation_input]
840
+ SENSITIVE = [:invocation_input, :model_invocation_input, :observation, :rationale]
612
841
  include Aws::Structure
613
842
  include Aws::Structure::Union
614
843
 
615
- class Rationale < OrchestrationTrace; end
616
844
  class InvocationInput < OrchestrationTrace; end
617
- class Observation < OrchestrationTrace; end
618
845
  class ModelInvocationInput < OrchestrationTrace; end
846
+ class Observation < OrchestrationTrace; end
847
+ class Rationale < OrchestrationTrace; end
619
848
  class Unknown < OrchestrationTrace; end
620
849
  end
621
850
 
622
- # parameters included in action group invocation
851
+ # A parameter in the Lambda input event.
623
852
  #
624
853
  # @!attribute [rw] name
625
- # Name of parameter
854
+ # The name of the parameter.
626
855
  # @return [String]
627
856
  #
628
857
  # @!attribute [rw] type
629
- # Type of parameter
858
+ # The type of the parameter.
630
859
  # @return [String]
631
860
  #
632
861
  # @!attribute [rw] value
633
- # Value of parameter
862
+ # The value of the parameter.
634
863
  # @return [String]
635
864
  #
636
865
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/Parameter AWS API Documentation
@@ -643,50 +872,51 @@ module Aws::BedrockAgentRuntime
643
872
  include Aws::Structure
644
873
  end
645
874
 
646
- # Base 64 endoded byte response
647
- #
648
- # @!attribute [rw] bytes
649
- # PartBody of the payload in bytes
650
- # @return [String]
875
+ # Contains a part of an agent response and citations for it.
651
876
  #
652
877
  # @!attribute [rw] attribution
653
- # Citations associated with final agent response
878
+ # Contains citations for a part of an agent response.
654
879
  # @return [Types::Attribution]
655
880
  #
881
+ # @!attribute [rw] bytes
882
+ # A part of the agent response in bytes.
883
+ # @return [String]
884
+ #
656
885
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/PayloadPart AWS API Documentation
657
886
  #
658
887
  class PayloadPart < Struct.new(
659
- :bytes,
660
888
  :attribution,
889
+ :bytes,
661
890
  :event_type)
662
891
  SENSITIVE = [:bytes]
663
892
  include Aws::Structure
664
893
  end
665
894
 
666
- # Trace Part which contains information related to postprocessing
667
- #
668
- # @!attribute [rw] trace_id
669
- # Identifier for trace
670
- # @return [String]
895
+ # The foundation model output from the post-processing step.
671
896
  #
672
897
  # @!attribute [rw] parsed_response
673
- # Trace Part which contains information if preprocessing was
674
- # successful
898
+ # Details about the response from the Lambda parsing of the output of
899
+ # the post-processing step.
675
900
  # @return [Types::PostProcessingParsedResponse]
676
901
  #
902
+ # @!attribute [rw] trace_id
903
+ # The unique identifier of the trace.
904
+ # @return [String]
905
+ #
677
906
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/PostProcessingModelInvocationOutput AWS API Documentation
678
907
  #
679
908
  class PostProcessingModelInvocationOutput < Struct.new(
680
- :trace_id,
681
- :parsed_response)
909
+ :parsed_response,
910
+ :trace_id)
682
911
  SENSITIVE = [:parsed_response]
683
912
  include Aws::Structure
684
913
  end
685
914
 
686
- # Trace Part which contains information if preprocessing was successful
915
+ # Details about the response from the Lambda parsing of the output from
916
+ # the post-processing step.
687
917
  #
688
918
  # @!attribute [rw] text
689
- # Agent Trace Output String
919
+ # The text returned by the parser.
690
920
  # @return [String]
691
921
  #
692
922
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/PostProcessingParsedResponse AWS API Documentation
@@ -697,16 +927,29 @@ module Aws::BedrockAgentRuntime
697
927
  include Aws::Structure
698
928
  end
699
929
 
700
- # Trace Part which contains information related to post processing step
930
+ # Details about the post-processing step, in which the agent shapes the
931
+ # response.
701
932
  #
702
933
  # @note PostProcessingTrace is a union - when returned from an API call exactly one value will be set and the returned type will be a subclass of PostProcessingTrace corresponding to the set member.
703
934
  #
704
935
  # @!attribute [rw] model_invocation_input
705
- # Trace Part which contains information used to call Invoke Model
936
+ # The input for the post-processing step.
937
+ #
938
+ # * The `type` is `POST_PROCESSING`.
939
+ #
940
+ # * The `text` contains the prompt.
941
+ #
942
+ # * The `inferenceConfiguration`, `parserMode`, and `overrideLambda`
943
+ # values are set in the [PromptOverrideConfiguration][1] object that
944
+ # was set when the agent was created or updated.
945
+ #
946
+ #
947
+ #
948
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html
706
949
  # @return [Types::ModelInvocationInput]
707
950
  #
708
951
  # @!attribute [rw] model_invocation_output
709
- # Trace Part which contains information related to postprocessing
952
+ # The foundation model output from the post-processing step.
710
953
  # @return [Types::PostProcessingModelInvocationOutput]
711
954
  #
712
955
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/PostProcessingTrace AWS API Documentation
@@ -724,55 +967,72 @@ module Aws::BedrockAgentRuntime
724
967
  class Unknown < PostProcessingTrace; end
725
968
  end
726
969
 
727
- # Trace Part which contains information related to preprocessing
728
- #
729
- # @!attribute [rw] trace_id
730
- # Identifier for trace
731
- # @return [String]
970
+ # The foundation model output from the pre-processing step.
732
971
  #
733
972
  # @!attribute [rw] parsed_response
734
- # Trace Part which contains information if preprocessing was
735
- # successful
973
+ # Details about the response from the Lambda parsing of the output of
974
+ # the pre-processing step.
736
975
  # @return [Types::PreProcessingParsedResponse]
737
976
  #
977
+ # @!attribute [rw] trace_id
978
+ # The unique identifier of the trace.
979
+ # @return [String]
980
+ #
738
981
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/PreProcessingModelInvocationOutput AWS API Documentation
739
982
  #
740
983
  class PreProcessingModelInvocationOutput < Struct.new(
741
- :trace_id,
742
- :parsed_response)
984
+ :parsed_response,
985
+ :trace_id)
743
986
  SENSITIVE = [:parsed_response]
744
987
  include Aws::Structure
745
988
  end
746
989
 
747
- # Trace Part which contains information if preprocessing was successful
748
- #
749
- # @!attribute [rw] rationale
750
- # Agent Trace Rationale String
751
- # @return [String]
990
+ # Details about the response from the Lambda parsing of the output from
991
+ # the pre-processing step.
752
992
  #
753
993
  # @!attribute [rw] is_valid
754
- # Boolean value
994
+ # Whether the user input is valid or not. If `false`, the agent
995
+ # doesn't proceed to orchestration.
755
996
  # @return [Boolean]
756
997
  #
998
+ # @!attribute [rw] rationale
999
+ # The text returned by the parsing of the pre-processing step,
1000
+ # explaining the steps that the agent plans to take in orchestration,
1001
+ # if the user input is valid.
1002
+ # @return [String]
1003
+ #
757
1004
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/PreProcessingParsedResponse AWS API Documentation
758
1005
  #
759
1006
  class PreProcessingParsedResponse < Struct.new(
760
- :rationale,
761
- :is_valid)
1007
+ :is_valid,
1008
+ :rationale)
762
1009
  SENSITIVE = [:rationale]
763
1010
  include Aws::Structure
764
1011
  end
765
1012
 
766
- # Trace Part which contains information related to preprocessing step
1013
+ # Details about the pre-processing step, in which the agent
1014
+ # contextualizes and categorizes user inputs.
767
1015
  #
768
1016
  # @note PreProcessingTrace is a union - when returned from an API call exactly one value will be set and the returned type will be a subclass of PreProcessingTrace corresponding to the set member.
769
1017
  #
770
1018
  # @!attribute [rw] model_invocation_input
771
- # Trace Part which contains information used to call Invoke Model
1019
+ # The input for the pre-processing step.
1020
+ #
1021
+ # * The `type` is `PRE_PROCESSING`.
1022
+ #
1023
+ # * The `text` contains the prompt.
1024
+ #
1025
+ # * The `inferenceConfiguration`, `parserMode`, and `overrideLambda`
1026
+ # values are set in the [PromptOverrideConfiguration][1] object that
1027
+ # was set when the agent was created or updated.
1028
+ #
1029
+ #
1030
+ #
1031
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html
772
1032
  # @return [Types::ModelInvocationInput]
773
1033
  #
774
1034
  # @!attribute [rw] model_invocation_output
775
- # Trace Part which contains information related to preprocessing
1035
+ # The foundation model output from the pre-processing step.
776
1036
  # @return [Types::PreProcessingModelInvocationOutput]
777
1037
  #
778
1038
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/PreProcessingTrace AWS API Documentation
@@ -790,48 +1050,92 @@ module Aws::BedrockAgentRuntime
790
1050
  class Unknown < PreProcessingTrace; end
791
1051
  end
792
1052
 
793
- # Trace Part which contains information related to reasoning
1053
+ # Contains the template for the prompt that's sent to the model for
1054
+ # response generation. For more information, see [Knowledge base prompt
1055
+ # templates][1].
794
1056
  #
795
- # @!attribute [rw] trace_id
796
- # Identifier for trace
1057
+ # This data type is used in the following API operations:
1058
+ #
1059
+ # * [RetrieveAndGenerate request][2]
1060
+ #
1061
+ # ^
1062
+ #
1063
+ #
1064
+ #
1065
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html#kb-test-config-sysprompt
1066
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax
1067
+ #
1068
+ # @!attribute [rw] text_prompt_template
1069
+ # The template for the prompt that's sent to the model for response
1070
+ # generation. You can include prompt placeholders, which become
1071
+ # replaced before the prompt is sent to the model to provide
1072
+ # instructions and context to the model. In addition, you can include
1073
+ # XML tags to delineate meaningful sections of the prompt template.
1074
+ #
1075
+ # For more information, see the following resources:
1076
+ #
1077
+ # * [Knowledge base prompt templates][1]
1078
+ #
1079
+ # * [Use XML tags with Anthropic Claude models][2]
1080
+ #
1081
+ #
1082
+ #
1083
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html#kb-test-config-sysprompt
1084
+ # [2]: https://docs.anthropic.com/claude/docs/use-xml-tags
797
1085
  # @return [String]
798
1086
  #
1087
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/PromptTemplate AWS API Documentation
1088
+ #
1089
+ class PromptTemplate < Struct.new(
1090
+ :text_prompt_template)
1091
+ SENSITIVE = [:text_prompt_template]
1092
+ include Aws::Structure
1093
+ end
1094
+
1095
+ # Contains the reasoning, based on the input, that the agent uses to
1096
+ # justify carrying out an action group or getting information from a
1097
+ # knowledge base.
1098
+ #
799
1099
  # @!attribute [rw] text
800
- # Agent Trace Rationale String
1100
+ # The reasoning or thought process of the agent, based on the input.
1101
+ # @return [String]
1102
+ #
1103
+ # @!attribute [rw] trace_id
1104
+ # The unique identifier of the trace step.
801
1105
  # @return [String]
802
1106
  #
803
1107
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/Rationale AWS API Documentation
804
1108
  #
805
1109
  class Rationale < Struct.new(
806
- :trace_id,
807
- :text)
1110
+ :text,
1111
+ :trace_id)
808
1112
  SENSITIVE = [:text]
809
1113
  include Aws::Structure
810
1114
  end
811
1115
 
812
- # Observation information if there were reprompts
1116
+ # Contains details about the agent's response to reprompt the input.
813
1117
  #
814
- # @!attribute [rw] text
815
- # Reprompt response text
1118
+ # @!attribute [rw] source
1119
+ # Specifies what output is prompting the agent to reprompt the input.
816
1120
  # @return [String]
817
1121
  #
818
- # @!attribute [rw] source
819
- # Parsing error source
1122
+ # @!attribute [rw] text
1123
+ # The text reprompting the input.
820
1124
  # @return [String]
821
1125
  #
822
1126
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/RepromptResponse AWS API Documentation
823
1127
  #
824
1128
  class RepromptResponse < Struct.new(
825
- :text,
826
- :source)
1129
+ :source,
1130
+ :text)
827
1131
  SENSITIVE = [:source]
828
1132
  include Aws::Structure
829
1133
  end
830
1134
 
831
- # Request Body Content Map
1135
+ # The parameters in the request body for the Lambda input event.
832
1136
  #
833
1137
  # @!attribute [rw] content
834
- # Content type paramter map
1138
+ # The content in the request body.
835
1139
  # @return [Hash<String,Array<Types::Parameter>>]
836
1140
  #
837
1141
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/RequestBody AWS API Documentation
@@ -842,11 +1146,10 @@ module Aws::BedrockAgentRuntime
842
1146
  include Aws::Structure
843
1147
  end
844
1148
 
845
- # This exception is thrown when a resource referenced by the operation
846
- # does not exist
1149
+ # The specified resource ARN was not found. Check the ARN and try your
1150
+ # request again.
847
1151
  #
848
1152
  # @!attribute [rw] message
849
- # Non Blank String
850
1153
  # @return [String]
851
1154
  #
852
1155
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/ResourceNotFoundException AWS API Documentation
@@ -858,10 +1161,23 @@ module Aws::BedrockAgentRuntime
858
1161
  include Aws::Structure
859
1162
  end
860
1163
 
861
- # Content of a retrieval result.
1164
+ # Contains the cited text from the data source.
1165
+ #
1166
+ # This data type is used in the following API operations:
1167
+ #
1168
+ # * [Retrieve response][1] – in the `content` field
1169
+ #
1170
+ # * [RetrieveAndGenerate response][2] – in the `content` field
1171
+ #
1172
+ # * [Retrieve response][1] – in the `content` field
1173
+ #
1174
+ #
1175
+ #
1176
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax
1177
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax
862
1178
  #
863
1179
  # @!attribute [rw] text
864
- # Content of a retrieval result in text
1180
+ # The cited text from the data source.
865
1181
  # @return [String]
866
1182
  #
867
1183
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/RetrievalResultContent AWS API Documentation
@@ -872,29 +1188,55 @@ module Aws::BedrockAgentRuntime
872
1188
  include Aws::Structure
873
1189
  end
874
1190
 
875
- # The source location of a retrieval result.
1191
+ # Contains information about the location of the data source.
876
1192
  #
877
- # @!attribute [rw] type
878
- # The location type of a retrieval result.
879
- # @return [String]
1193
+ # This data type is used in the following API operations:
1194
+ #
1195
+ # * [Retrieve response][1] – in the `location` field
1196
+ #
1197
+ # * [RetrieveAndGenerate response][2] – in the `location` field
1198
+ #
1199
+ # * [Retrieve response][1] – in the `locatino` field
1200
+ #
1201
+ #
1202
+ #
1203
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax
1204
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax
880
1205
  #
881
1206
  # @!attribute [rw] s3_location
882
- # The S3 location of a retrieval result.
1207
+ # Contains the S3 location of the data source.
883
1208
  # @return [Types::RetrievalResultS3Location]
884
1209
  #
1210
+ # @!attribute [rw] type
1211
+ # The type of the location of the data source.
1212
+ # @return [String]
1213
+ #
885
1214
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/RetrievalResultLocation AWS API Documentation
886
1215
  #
887
1216
  class RetrievalResultLocation < Struct.new(
888
- :type,
889
- :s3_location)
1217
+ :s3_location,
1218
+ :type)
890
1219
  SENSITIVE = []
891
1220
  include Aws::Structure
892
1221
  end
893
1222
 
894
- # The S3 location of a retrieval result.
1223
+ # Contains the S3 location of the data source.
1224
+ #
1225
+ # This data type is used in the following API operations:
1226
+ #
1227
+ # * [Retrieve response][1] – in the `s3Location` field
1228
+ #
1229
+ # * [RetrieveAndGenerate response][2] – in the `s3Location` field
1230
+ #
1231
+ # * [Retrieve response][1] – in the `s3Location` field
1232
+ #
1233
+ #
1234
+ #
1235
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax
1236
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax
895
1237
  #
896
1238
  # @!attribute [rw] uri
897
- # URI of S3 location
1239
+ # The S3 URI of the data source.
898
1240
  # @return [String]
899
1241
  #
900
1242
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/RetrievalResultS3Location AWS API Documentation
@@ -905,29 +1247,50 @@ module Aws::BedrockAgentRuntime
905
1247
  include Aws::Structure
906
1248
  end
907
1249
 
908
- # Configures the retrieval and generation for the session.
1250
+ # Contains details about the resource being queried.
909
1251
  #
910
- # @!attribute [rw] type
911
- # The type of RetrieveAndGenerate.
912
- # @return [String]
1252
+ # This data type is used in the following API operations:
1253
+ #
1254
+ # * [RetrieveAndGenerate request][1] – in the
1255
+ # `retrieveAndGenerateConfiguration` field
1256
+ #
1257
+ # ^
1258
+ #
1259
+ #
1260
+ #
1261
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax
913
1262
  #
914
1263
  # @!attribute [rw] knowledge_base_configuration
915
- # Configurations for retrieval and generation for knowledge base.
1264
+ # Contains details about the resource being queried.
916
1265
  # @return [Types::KnowledgeBaseRetrieveAndGenerateConfiguration]
917
1266
  #
1267
+ # @!attribute [rw] type
1268
+ # The type of resource that is queried by the request.
1269
+ # @return [String]
1270
+ #
918
1271
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/RetrieveAndGenerateConfiguration AWS API Documentation
919
1272
  #
920
1273
  class RetrieveAndGenerateConfiguration < Struct.new(
921
- :type,
922
- :knowledge_base_configuration)
1274
+ :knowledge_base_configuration,
1275
+ :type)
923
1276
  SENSITIVE = []
924
1277
  include Aws::Structure
925
1278
  end
926
1279
 
927
- # Customer input of the turn
1280
+ # Contains the query made to the knowledge base.
1281
+ #
1282
+ # This data type is used in the following API operations:
1283
+ #
1284
+ # * [RetrieveAndGenerate request][1] – in the `input` field
1285
+ #
1286
+ # ^
1287
+ #
1288
+ #
1289
+ #
1290
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax
928
1291
  #
929
1292
  # @!attribute [rw] text
930
- # Customer input of the turn in text
1293
+ # The query made to the knowledge base.
931
1294
  # @return [String]
932
1295
  #
933
1296
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/RetrieveAndGenerateInput AWS API Documentation
@@ -938,10 +1301,20 @@ module Aws::BedrockAgentRuntime
938
1301
  include Aws::Structure
939
1302
  end
940
1303
 
941
- # Service response of the turn
1304
+ # Contains the response generated from querying the knowledge base.
1305
+ #
1306
+ # This data type is used in the following API operations:
1307
+ #
1308
+ # * [RetrieveAndGenerate response][1] – in the `output` field
1309
+ #
1310
+ # ^
1311
+ #
1312
+ #
1313
+ #
1314
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax
942
1315
  #
943
1316
  # @!attribute [rw] text
944
- # Service response of the turn in text
1317
+ # The response generated from querying the knowledge base.
945
1318
  # @return [String]
946
1319
  #
947
1320
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/RetrieveAndGenerateOutput AWS API Documentation
@@ -952,59 +1325,79 @@ module Aws::BedrockAgentRuntime
952
1325
  include Aws::Structure
953
1326
  end
954
1327
 
955
- # @!attribute [rw] session_id
956
- # Identifier of the session.
957
- # @return [String]
958
- #
959
1328
  # @!attribute [rw] input
960
- # Customer input of the turn
1329
+ # Contains the query to be made to the knowledge base.
961
1330
  # @return [Types::RetrieveAndGenerateInput]
962
1331
  #
963
1332
  # @!attribute [rw] retrieve_and_generate_configuration
964
- # Configures the retrieval and generation for the session.
1333
+ # Contains configurations for the knowledge base query and retrieval
1334
+ # process. For more information, see [Query configurations][1].
1335
+ #
1336
+ #
1337
+ #
1338
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html
965
1339
  # @return [Types::RetrieveAndGenerateConfiguration]
966
1340
  #
967
1341
  # @!attribute [rw] session_configuration
968
- # Configures common parameters of the session.
1342
+ # Contains details about the session with the knowledge base.
969
1343
  # @return [Types::RetrieveAndGenerateSessionConfiguration]
970
1344
  #
1345
+ # @!attribute [rw] session_id
1346
+ # The unique identifier of the session. Reuse the same value to
1347
+ # continue the same session with the knowledge base.
1348
+ # @return [String]
1349
+ #
971
1350
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/RetrieveAndGenerateRequest AWS API Documentation
972
1351
  #
973
1352
  class RetrieveAndGenerateRequest < Struct.new(
974
- :session_id,
975
1353
  :input,
976
1354
  :retrieve_and_generate_configuration,
977
- :session_configuration)
1355
+ :session_configuration,
1356
+ :session_id)
978
1357
  SENSITIVE = [:input]
979
1358
  include Aws::Structure
980
1359
  end
981
1360
 
982
- # @!attribute [rw] session_id
983
- # Identifier of the session.
984
- # @return [String]
1361
+ # @!attribute [rw] citations
1362
+ # A list of segments of the generated response that are based on
1363
+ # sources in the knowledge base, alongside information about the
1364
+ # sources.
1365
+ # @return [Array<Types::Citation>]
985
1366
  #
986
1367
  # @!attribute [rw] output
987
- # Service response of the turn
1368
+ # Contains the response generated from querying the knowledge base.
988
1369
  # @return [Types::RetrieveAndGenerateOutput]
989
1370
  #
990
- # @!attribute [rw] citations
991
- # List of citations
992
- # @return [Array<Types::Citation>]
1371
+ # @!attribute [rw] session_id
1372
+ # The unique identifier of the session. Reuse the same value to
1373
+ # continue the same session with the knowledge base.
1374
+ # @return [String]
993
1375
  #
994
1376
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/RetrieveAndGenerateResponse AWS API Documentation
995
1377
  #
996
1378
  class RetrieveAndGenerateResponse < Struct.new(
997
- :session_id,
1379
+ :citations,
998
1380
  :output,
999
- :citations)
1381
+ :session_id)
1000
1382
  SENSITIVE = [:output]
1001
1383
  include Aws::Structure
1002
1384
  end
1003
1385
 
1004
- # Configures common parameters of the session.
1386
+ # Contains configuration about the session with the knowledge base.
1387
+ #
1388
+ # This data type is used in the following API operations:
1389
+ #
1390
+ # * [RetrieveAndGenerate request][1] – in the `sessionConfiguration`
1391
+ # field
1392
+ #
1393
+ # ^
1394
+ #
1395
+ #
1396
+ #
1397
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax
1005
1398
  #
1006
1399
  # @!attribute [rw] kms_key_arn
1007
- # The KMS key arn to encrypt the customer data of the session.
1400
+ # The ARN of the KMS key encrypting the session.
1008
1401
  # @return [String]
1009
1402
  #
1010
1403
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/RetrieveAndGenerateSessionConfiguration AWS API Documentation
@@ -1016,57 +1409,78 @@ module Aws::BedrockAgentRuntime
1016
1409
  end
1017
1410
 
1018
1411
  # @!attribute [rw] knowledge_base_id
1019
- # Identifier of the KnowledgeBase
1412
+ # The unique identifier of the knowledge base to query.
1020
1413
  # @return [String]
1021
1414
  #
1022
- # @!attribute [rw] retrieval_query
1023
- # Knowledge base input query.
1024
- # @return [Types::KnowledgeBaseQuery]
1415
+ # @!attribute [rw] next_token
1416
+ # If there are more results than can fit in the response, the response
1417
+ # returns a `nextToken`. Use this token in the `nextToken` field of
1418
+ # another request to retrieve the next batch of results.
1419
+ # @return [String]
1025
1420
  #
1026
1421
  # @!attribute [rw] retrieval_configuration
1027
- # Search parameters for retrieving from knowledge base.
1422
+ # Contains configurations for the knowledge base query and retrieval
1423
+ # process. For more information, see [Query configurations][1].
1424
+ #
1425
+ #
1426
+ #
1427
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html
1028
1428
  # @return [Types::KnowledgeBaseRetrievalConfiguration]
1029
1429
  #
1030
- # @!attribute [rw] next_token
1031
- # Opaque continuation token of previous paginated response.
1032
- # @return [String]
1430
+ # @!attribute [rw] retrieval_query
1431
+ # Contains the query to send the knowledge base.
1432
+ # @return [Types::KnowledgeBaseQuery]
1033
1433
  #
1034
1434
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/RetrieveRequest AWS API Documentation
1035
1435
  #
1036
1436
  class RetrieveRequest < Struct.new(
1037
1437
  :knowledge_base_id,
1038
- :retrieval_query,
1438
+ :next_token,
1039
1439
  :retrieval_configuration,
1040
- :next_token)
1440
+ :retrieval_query)
1041
1441
  SENSITIVE = [:retrieval_query]
1042
1442
  include Aws::Structure
1043
1443
  end
1044
1444
 
1045
- # @!attribute [rw] retrieval_results
1046
- # List of knowledge base retrieval results
1047
- # @return [Array<Types::KnowledgeBaseRetrievalResult>]
1048
- #
1049
1445
  # @!attribute [rw] next_token
1050
- # Opaque continuation token of previous paginated response.
1446
+ # If there are more results than can fit in the response, the response
1447
+ # returns a `nextToken`. Use this token in the `nextToken` field of
1448
+ # another request to retrieve the next batch of results.
1051
1449
  # @return [String]
1052
1450
  #
1451
+ # @!attribute [rw] retrieval_results
1452
+ # A list of results from querying the knowledge base.
1453
+ # @return [Array<Types::KnowledgeBaseRetrievalResult>]
1454
+ #
1053
1455
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/RetrieveResponse AWS API Documentation
1054
1456
  #
1055
1457
  class RetrieveResponse < Struct.new(
1056
- :retrieval_results,
1057
- :next_token)
1458
+ :next_token,
1459
+ :retrieval_results)
1058
1460
  SENSITIVE = [:retrieval_results]
1059
1461
  include Aws::Structure
1060
1462
  end
1061
1463
 
1062
- # Retrieved reference
1464
+ # Contains metadata about a source cited for the generated response.
1465
+ #
1466
+ # This data type is used in the following API operations:
1467
+ #
1468
+ # * [RetrieveAndGenerate response][1] – in the `retrievedReferences`
1469
+ # field
1470
+ #
1471
+ # * [Retrieve response][2] – in the `retrievedReferences` field
1472
+ #
1473
+ #
1474
+ #
1475
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax
1476
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax
1063
1477
  #
1064
1478
  # @!attribute [rw] content
1065
- # Content of a retrieval result.
1479
+ # Contains the cited text from the data source.
1066
1480
  # @return [Types::RetrievalResultContent]
1067
1481
  #
1068
1482
  # @!attribute [rw] location
1069
- # The source location of a retrieval result.
1483
+ # Contains information about the location of the data source.
1070
1484
  # @return [Types::RetrievalResultLocation]
1071
1485
  #
1072
1486
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/RetrievedReference AWS API Documentation
@@ -1078,11 +1492,10 @@ module Aws::BedrockAgentRuntime
1078
1492
  include Aws::Structure
1079
1493
  end
1080
1494
 
1081
- # This exception is thrown when a request is made beyond the service
1082
- # quota
1495
+ # The number of requests exceeds the service quota. Resubmit your
1496
+ # request later.
1083
1497
  #
1084
1498
  # @!attribute [rw] message
1085
- # Non Blank String
1086
1499
  # @return [String]
1087
1500
  #
1088
1501
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/ServiceQuotaExceededException AWS API Documentation
@@ -1094,67 +1507,112 @@ module Aws::BedrockAgentRuntime
1094
1507
  include Aws::Structure
1095
1508
  end
1096
1509
 
1097
- # Session state provided
1510
+ # Contains parameters that specify various attributes that persist
1511
+ # across a session or prompt. You can define session state attributes as
1512
+ # key-value pairs when writing a [Lambda function][1] for an action
1513
+ # group or pass them when making an [InvokeAgent][2] request. Use
1514
+ # session state attributes to control and provide conversational context
1515
+ # for your agent and to help customize your agent's behavior. For more
1516
+ # information, see [Control session context][3].
1517
+ #
1098
1518
  #
1099
- # @!attribute [rw] session_attributes
1100
- # Session Attributes
1101
- # @return [Hash<String,String>]
1519
+ #
1520
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html
1521
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html
1522
+ # [3]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html
1102
1523
  #
1103
1524
  # @!attribute [rw] prompt_session_attributes
1104
- # Prompt Session Attributes
1525
+ # Contains attributes that persist across a prompt and the values of
1526
+ # those attributes. These attributes replace the
1527
+ # $prompt\_session\_attributes$ placeholder variable in the
1528
+ # orchestration prompt template. For more information, see [Prompt
1529
+ # template placeholder variables][1].
1530
+ #
1531
+ #
1532
+ #
1533
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html
1534
+ # @return [Hash<String,String>]
1535
+ #
1536
+ # @!attribute [rw] session_attributes
1537
+ # Contains attributes that persist across a session and the values of
1538
+ # those attributes.
1105
1539
  # @return [Hash<String,String>]
1106
1540
  #
1107
1541
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/SessionState AWS API Documentation
1108
1542
  #
1109
1543
  class SessionState < Struct.new(
1110
- :session_attributes,
1111
- :prompt_session_attributes)
1544
+ :prompt_session_attributes,
1545
+ :session_attributes)
1112
1546
  SENSITIVE = []
1113
1547
  include Aws::Structure
1114
1548
  end
1115
1549
 
1116
- # Span of text
1550
+ # Contains information about where the text with a citation begins and
1551
+ # ends in the generated output.
1117
1552
  #
1118
- # @!attribute [rw] start
1119
- # Start of span
1120
- # @return [Integer]
1553
+ # This data type is used in the following API operations:
1554
+ #
1555
+ # * [RetrieveAndGenerate response][1] – in the `span` field
1556
+ #
1557
+ # * [Retrieve response][2] – in the `span` field
1558
+ #
1559
+ #
1560
+ #
1561
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax
1562
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax
1121
1563
  #
1122
1564
  # @!attribute [rw] end
1123
- # End of span
1565
+ # Where the text with a citation ends in the generated output.
1566
+ # @return [Integer]
1567
+ #
1568
+ # @!attribute [rw] start
1569
+ # Where the text with a citation starts in the generated output.
1124
1570
  # @return [Integer]
1125
1571
  #
1126
1572
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/Span AWS API Documentation
1127
1573
  #
1128
1574
  class Span < Struct.new(
1129
- :start,
1130
- :end)
1575
+ :end,
1576
+ :start)
1131
1577
  SENSITIVE = []
1132
1578
  include Aws::Structure
1133
1579
  end
1134
1580
 
1135
- # Text response part
1581
+ # Contains the part of the generated text that contains a citation,
1582
+ # alongside where it begins and ends.
1583
+ #
1584
+ # This data type is used in the following API operations:
1585
+ #
1586
+ # * [RetrieveAndGenerate response][1] – in the `textResponsePart` field
1587
+ #
1588
+ # * [Retrieve response][2] – in the `textResponsePart` field
1136
1589
  #
1137
- # @!attribute [rw] text
1138
- # Response part in text
1139
- # @return [String]
1590
+ #
1591
+ #
1592
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax
1593
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax
1140
1594
  #
1141
1595
  # @!attribute [rw] span
1142
- # Span of text
1596
+ # Contains information about where the text with a citation begins and
1597
+ # ends in the generated output.
1143
1598
  # @return [Types::Span]
1144
1599
  #
1600
+ # @!attribute [rw] text
1601
+ # The part of the generated text that contains a citation.
1602
+ # @return [String]
1603
+ #
1145
1604
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/TextResponsePart AWS API Documentation
1146
1605
  #
1147
1606
  class TextResponsePart < Struct.new(
1148
- :text,
1149
- :span)
1607
+ :span,
1608
+ :text)
1150
1609
  SENSITIVE = []
1151
1610
  include Aws::Structure
1152
1611
  end
1153
1612
 
1154
- # This exception is thrown when the number of requests exceeds the limit
1613
+ # The number of requests exceeds the limit. Resubmit your request later.
1155
1614
  #
1156
1615
  # @!attribute [rw] message
1157
- # Non Blank String
1158
1616
  # @return [String]
1159
1617
  #
1160
1618
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/ThrottlingException AWS API Documentation
@@ -1166,69 +1624,95 @@ module Aws::BedrockAgentRuntime
1166
1624
  include Aws::Structure
1167
1625
  end
1168
1626
 
1169
- # Trace contains intermidate response for customer
1627
+ # Contains one part of the agent's reasoning process and results from
1628
+ # calling API actions and querying knowledge bases. You can use the
1629
+ # trace to understand how the agent arrived at the response it provided
1630
+ # the customer. For more information, see [Trace enablement][1].
1631
+ #
1632
+ #
1633
+ #
1634
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-enablement
1170
1635
  #
1171
1636
  # @note Trace is a union - when returned from an API call exactly one value will be set and the returned type will be a subclass of Trace corresponding to the set member.
1172
1637
  #
1173
- # @!attribute [rw] pre_processing_trace
1174
- # Trace Part which contains information related to preprocessing step
1175
- # @return [Types::PreProcessingTrace]
1638
+ # @!attribute [rw] failure_trace
1639
+ # Contains information about the failure of the interaction.
1640
+ # @return [Types::FailureTrace]
1176
1641
  #
1177
1642
  # @!attribute [rw] orchestration_trace
1178
- # Trace contains intermidate response during orchestration
1643
+ # Details about the orchestration step, in which the agent determines
1644
+ # the order in which actions are executed and which knowledge bases
1645
+ # are retrieved.
1179
1646
  # @return [Types::OrchestrationTrace]
1180
1647
  #
1181
1648
  # @!attribute [rw] post_processing_trace
1182
- # Trace Part which contains information related to post processing
1183
- # step
1649
+ # Details about the post-processing step, in which the agent shapes
1650
+ # the response..
1184
1651
  # @return [Types::PostProcessingTrace]
1185
1652
  #
1186
- # @!attribute [rw] failure_trace
1187
- # Trace Part which is emitted when agent trace could not be generated
1188
- # @return [Types::FailureTrace]
1653
+ # @!attribute [rw] pre_processing_trace
1654
+ # Details about the pre-processing step, in which the agent
1655
+ # contextualizes and categorizes user inputs.
1656
+ # @return [Types::PreProcessingTrace]
1189
1657
  #
1190
1658
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/Trace AWS API Documentation
1191
1659
  #
1192
1660
  class Trace < Struct.new(
1193
- :pre_processing_trace,
1661
+ :failure_trace,
1194
1662
  :orchestration_trace,
1195
1663
  :post_processing_trace,
1196
- :failure_trace,
1664
+ :pre_processing_trace,
1197
1665
  :unknown)
1198
- SENSITIVE = [:pre_processing_trace, :orchestration_trace, :post_processing_trace, :failure_trace]
1666
+ SENSITIVE = [:failure_trace, :orchestration_trace, :post_processing_trace, :pre_processing_trace]
1199
1667
  include Aws::Structure
1200
1668
  include Aws::Structure::Union
1201
1669
 
1202
- class PreProcessingTrace < Trace; end
1670
+ class FailureTrace < Trace; end
1203
1671
  class OrchestrationTrace < Trace; end
1204
1672
  class PostProcessingTrace < Trace; end
1205
- class FailureTrace < Trace; end
1673
+ class PreProcessingTrace < Trace; end
1206
1674
  class Unknown < Trace; end
1207
1675
  end
1208
1676
 
1209
- # Trace Part which contains intermidate response for customer
1677
+ # Contains information about the agent and session, alongside the
1678
+ # agent's reasoning process and results from calling API actions and
1679
+ # querying knowledge bases and metadata about the trace. You can use the
1680
+ # trace to understand how the agent arrived at the response it provided
1681
+ # the customer. For more information, see [Trace enablement][1].
1682
+ #
1210
1683
  #
1211
- # @!attribute [rw] agent_id
1212
- # Identifier of the agent.
1213
- # @return [String]
1684
+ #
1685
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-enablement
1214
1686
  #
1215
1687
  # @!attribute [rw] agent_alias_id
1216
- # Identifier of the agent alias.
1688
+ # The unique identifier of the alias of the agent.
1689
+ # @return [String]
1690
+ #
1691
+ # @!attribute [rw] agent_id
1692
+ # The unique identifier of the agent.
1217
1693
  # @return [String]
1218
1694
  #
1219
1695
  # @!attribute [rw] session_id
1220
- # Identifier of the session.
1696
+ # The unique identifier of the session with the agent.
1221
1697
  # @return [String]
1222
1698
  #
1223
1699
  # @!attribute [rw] trace
1224
- # Trace contains intermidate response for customer
1700
+ # Contains one part of the agent's reasoning process and results from
1701
+ # calling API actions and querying knowledge bases. You can use the
1702
+ # trace to understand how the agent arrived at the response it
1703
+ # provided the customer. For more information, see [Trace
1704
+ # enablement][1].
1705
+ #
1706
+ #
1707
+ #
1708
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-enablement
1225
1709
  # @return [Types::Trace]
1226
1710
  #
1227
1711
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/TracePart AWS API Documentation
1228
1712
  #
1229
1713
  class TracePart < Struct.new(
1230
- :agent_id,
1231
1714
  :agent_alias_id,
1715
+ :agent_id,
1232
1716
  :session_id,
1233
1717
  :trace,
1234
1718
  :event_type)
@@ -1236,10 +1720,10 @@ module Aws::BedrockAgentRuntime
1236
1720
  include Aws::Structure
1237
1721
  end
1238
1722
 
1239
- # This exception is thrown when the request's input validation fails
1723
+ # Input validation failed. Check your request parameters and retry the
1724
+ # request.
1240
1725
  #
1241
1726
  # @!attribute [rw] message
1242
- # Non Blank String
1243
1727
  # @return [String]
1244
1728
  #
1245
1729
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/ValidationException AWS API Documentation
@@ -1251,7 +1735,8 @@ module Aws::BedrockAgentRuntime
1251
1735
  include Aws::Structure
1252
1736
  end
1253
1737
 
1254
- # Response body of is a stream
1738
+ # The response from invoking the agent and associated citations and
1739
+ # trace information.
1255
1740
  #
1256
1741
  # EventStream is an Enumerator of Events.
1257
1742
  # #event_types #=> Array, returns all modeled event types in the stream
@@ -1262,17 +1747,17 @@ module Aws::BedrockAgentRuntime
1262
1747
 
1263
1748
  def event_types
1264
1749
  [
1750
+ :access_denied_exception,
1751
+ :bad_gateway_exception,
1265
1752
  :chunk,
1266
- :trace,
1753
+ :conflict_exception,
1754
+ :dependency_failed_exception,
1267
1755
  :internal_server_exception,
1268
- :validation_exception,
1269
1756
  :resource_not_found_exception,
1270
1757
  :service_quota_exceeded_exception,
1271
1758
  :throttling_exception,
1272
- :access_denied_exception,
1273
- :conflict_exception,
1274
- :dependency_failed_exception,
1275
- :bad_gateway_exception
1759
+ :trace,
1760
+ :validation_exception
1276
1761
  ]
1277
1762
  end
1278
1763