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