aws-sdk-bedrockagentruntime 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-bedrockagentruntime/client.rb +24 -15
- data/lib/aws-sdk-bedrockagentruntime/client_api.rb +10 -0
- data/lib/aws-sdk-bedrockagentruntime/types.rb +294 -21
- data/lib/aws-sdk-bedrockagentruntime.rb +1 -1
- data/sig/client.rbs +5 -0
- data/sig/types.rbs +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cc803bf4f889db4885d44233100f88828fc7cfb99149a1a2ac536104e28e629
|
4
|
+
data.tar.gz: 99eb1b4a9fbc673091079294ec6a5c69db1ea6c59ece19b623ed9f1dce14a0a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd0d0b58178239d1ef2eed238b570d86a4a2b5f260cd5e3c21a2957f4299b1ef6bc92119691d1581c035765009d068396d2fed6a93838910f52bdda6c55b9017
|
7
|
+
data.tar.gz: 8d9f09594ad68bcd0f79990e9ade1524719349ddde8c5e89370fa058e44f4bea7fe274aff63d3c646b034abb3089a0eda266444d522b5981d6025e5367f9f400
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
Unreleased Changes
|
2
2
|
------------------
|
3
3
|
|
4
|
+
1.4.0 (2024-03-26)
|
5
|
+
------------------
|
6
|
+
|
7
|
+
* Feature - This release adds support to customize prompts sent through the RetrieveAndGenerate API in Agents for Amazon Bedrock.
|
8
|
+
|
4
9
|
1.3.0 (2024-03-08)
|
5
10
|
------------------
|
6
11
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.4.0
|
@@ -459,6 +459,11 @@ module Aws::BedrockAgentRuntime
|
|
459
459
|
#
|
460
460
|
# @option params [Types::SessionState] :session_state
|
461
461
|
# Contains parameters that specify various attributes of the session.
|
462
|
+
# For more information, see [Control session context][1].
|
463
|
+
#
|
464
|
+
#
|
465
|
+
#
|
466
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html
|
462
467
|
#
|
463
468
|
# @return [Types::InvokeAgentResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
464
469
|
#
|
@@ -822,10 +827,15 @@ module Aws::BedrockAgentRuntime
|
|
822
827
|
# another request to retrieve the next batch of results.
|
823
828
|
#
|
824
829
|
# @option params [Types::KnowledgeBaseRetrievalConfiguration] :retrieval_configuration
|
825
|
-
# Contains
|
830
|
+
# Contains configurations for the knowledge base query and retrieval
|
831
|
+
# process. For more information, see [Query configurations][1].
|
832
|
+
#
|
833
|
+
#
|
834
|
+
#
|
835
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html
|
826
836
|
#
|
827
837
|
# @option params [required, Types::KnowledgeBaseQuery] :retrieval_query
|
828
|
-
#
|
838
|
+
# Contains the query to send the knowledge base.
|
829
839
|
#
|
830
840
|
# @return [Types::RetrieveResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
831
841
|
#
|
@@ -872,22 +882,16 @@ module Aws::BedrockAgentRuntime
|
|
872
882
|
# retrieved results. The response cites up to five sources but only
|
873
883
|
# selects the ones that are relevant to the query.
|
874
884
|
#
|
875
|
-
#
|
876
|
-
#
|
877
|
-
# [vectorSearchConfiguration][1] object.
|
878
|
-
#
|
879
|
-
# </note>
|
885
|
+
# @option params [required, Types::RetrieveAndGenerateInput] :input
|
886
|
+
# Contains the query to be made to the knowledge base.
|
880
887
|
#
|
888
|
+
# @option params [Types::RetrieveAndGenerateConfiguration] :retrieve_and_generate_configuration
|
889
|
+
# Contains configurations for the knowledge base query and retrieval
|
890
|
+
# process. For more information, see [Query configurations][1].
|
881
891
|
#
|
882
892
|
#
|
883
|
-
# [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_KnowledgeBaseVectorSearchConfiguration.html
|
884
893
|
#
|
885
|
-
#
|
886
|
-
# Contains the query made to the knowledge base.
|
887
|
-
#
|
888
|
-
# @option params [Types::RetrieveAndGenerateConfiguration] :retrieve_and_generate_configuration
|
889
|
-
# Contains details about the resource being queried and the foundation
|
890
|
-
# model used for generation.
|
894
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html
|
891
895
|
#
|
892
896
|
# @option params [Types::RetrieveAndGenerateSessionConfiguration] :session_configuration
|
893
897
|
# Contains details about the session with the knowledge base.
|
@@ -910,6 +914,11 @@ module Aws::BedrockAgentRuntime
|
|
910
914
|
# },
|
911
915
|
# retrieve_and_generate_configuration: {
|
912
916
|
# knowledge_base_configuration: {
|
917
|
+
# generation_configuration: {
|
918
|
+
# prompt_template: {
|
919
|
+
# text_prompt_template: "TextPromptTemplate",
|
920
|
+
# },
|
921
|
+
# },
|
913
922
|
# knowledge_base_id: "KnowledgeBaseId", # required
|
914
923
|
# model_arn: "BedrockModelArn", # required
|
915
924
|
# retrieval_configuration: {
|
@@ -962,7 +971,7 @@ module Aws::BedrockAgentRuntime
|
|
962
971
|
params: params,
|
963
972
|
config: config)
|
964
973
|
context[:gem_name] = 'aws-sdk-bedrockagentruntime'
|
965
|
-
context[:gem_version] = '1.
|
974
|
+
context[:gem_version] = '1.4.0'
|
966
975
|
Seahorse::Client::Request.new(handlers, context)
|
967
976
|
end
|
968
977
|
|
@@ -37,6 +37,7 @@ module Aws::BedrockAgentRuntime
|
|
37
37
|
FinalResponse = Shapes::StructureShape.new(name: 'FinalResponse')
|
38
38
|
FinalResponseString = Shapes::StringShape.new(name: 'FinalResponseString')
|
39
39
|
GeneratedResponsePart = Shapes::StructureShape.new(name: 'GeneratedResponsePart')
|
40
|
+
GenerationConfiguration = Shapes::StructureShape.new(name: 'GenerationConfiguration')
|
40
41
|
InferenceConfiguration = Shapes::StructureShape.new(name: 'InferenceConfiguration')
|
41
42
|
InputText = Shapes::StringShape.new(name: 'InputText')
|
42
43
|
InternalServerException = Shapes::StructureShape.new(name: 'InternalServerException')
|
@@ -77,6 +78,7 @@ module Aws::BedrockAgentRuntime
|
|
77
78
|
PreProcessingParsedResponse = Shapes::StructureShape.new(name: 'PreProcessingParsedResponse')
|
78
79
|
PreProcessingTrace = Shapes::UnionShape.new(name: 'PreProcessingTrace')
|
79
80
|
PromptSessionAttributesMap = Shapes::MapShape.new(name: 'PromptSessionAttributesMap')
|
81
|
+
PromptTemplate = Shapes::StructureShape.new(name: 'PromptTemplate')
|
80
82
|
PromptText = Shapes::StringShape.new(name: 'PromptText')
|
81
83
|
PromptType = Shapes::StringShape.new(name: 'PromptType')
|
82
84
|
Rationale = Shapes::StructureShape.new(name: 'Rationale')
|
@@ -113,6 +115,7 @@ module Aws::BedrockAgentRuntime
|
|
113
115
|
StopSequences = Shapes::ListShape.new(name: 'StopSequences')
|
114
116
|
String = Shapes::StringShape.new(name: 'String')
|
115
117
|
Temperature = Shapes::FloatShape.new(name: 'Temperature')
|
118
|
+
TextPromptTemplate = Shapes::StringShape.new(name: 'TextPromptTemplate')
|
116
119
|
TextResponsePart = Shapes::StructureShape.new(name: 'TextResponsePart')
|
117
120
|
ThrottlingException = Shapes::StructureShape.new(name: 'ThrottlingException')
|
118
121
|
TopK = Shapes::IntegerShape.new(name: 'TopK')
|
@@ -171,6 +174,9 @@ module Aws::BedrockAgentRuntime
|
|
171
174
|
GeneratedResponsePart.add_member(:text_response_part, Shapes::ShapeRef.new(shape: TextResponsePart, location_name: "textResponsePart"))
|
172
175
|
GeneratedResponsePart.struct_class = Types::GeneratedResponsePart
|
173
176
|
|
177
|
+
GenerationConfiguration.add_member(:prompt_template, Shapes::ShapeRef.new(shape: PromptTemplate, location_name: "promptTemplate"))
|
178
|
+
GenerationConfiguration.struct_class = Types::GenerationConfiguration
|
179
|
+
|
174
180
|
InferenceConfiguration.add_member(:maximum_length, Shapes::ShapeRef.new(shape: MaximumLength, location_name: "maximumLength"))
|
175
181
|
InferenceConfiguration.add_member(:stop_sequences, Shapes::ShapeRef.new(shape: StopSequences, location_name: "stopSequences"))
|
176
182
|
InferenceConfiguration.add_member(:temperature, Shapes::ShapeRef.new(shape: Temperature, location_name: "temperature"))
|
@@ -223,6 +229,7 @@ module Aws::BedrockAgentRuntime
|
|
223
229
|
|
224
230
|
KnowledgeBaseRetrievalResults.member = Shapes::ShapeRef.new(shape: KnowledgeBaseRetrievalResult)
|
225
231
|
|
232
|
+
KnowledgeBaseRetrieveAndGenerateConfiguration.add_member(:generation_configuration, Shapes::ShapeRef.new(shape: GenerationConfiguration, location_name: "generationConfiguration"))
|
226
233
|
KnowledgeBaseRetrieveAndGenerateConfiguration.add_member(:knowledge_base_id, Shapes::ShapeRef.new(shape: KnowledgeBaseId, required: true, location_name: "knowledgeBaseId"))
|
227
234
|
KnowledgeBaseRetrieveAndGenerateConfiguration.add_member(:model_arn, Shapes::ShapeRef.new(shape: BedrockModelArn, required: true, location_name: "modelArn"))
|
228
235
|
KnowledgeBaseRetrieveAndGenerateConfiguration.add_member(:retrieval_configuration, Shapes::ShapeRef.new(shape: KnowledgeBaseRetrievalConfiguration, location_name: "retrievalConfiguration"))
|
@@ -306,6 +313,9 @@ module Aws::BedrockAgentRuntime
|
|
306
313
|
PromptSessionAttributesMap.key = Shapes::ShapeRef.new(shape: String)
|
307
314
|
PromptSessionAttributesMap.value = Shapes::ShapeRef.new(shape: String)
|
308
315
|
|
316
|
+
PromptTemplate.add_member(:text_prompt_template, Shapes::ShapeRef.new(shape: TextPromptTemplate, location_name: "textPromptTemplate"))
|
317
|
+
PromptTemplate.struct_class = Types::PromptTemplate
|
318
|
+
|
309
319
|
Rationale.add_member(:text, Shapes::ShapeRef.new(shape: RationaleString, location_name: "text"))
|
310
320
|
Rationale.add_member(:trace_id, Shapes::ShapeRef.new(shape: TraceId, location_name: "traceId"))
|
311
321
|
Rationale.struct_class = Types::Rationale
|
@@ -115,6 +115,17 @@ module Aws::BedrockAgentRuntime
|
|
115
115
|
# on a source in the knowledge base, alongside information about the
|
116
116
|
# source.
|
117
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
|
128
|
+
#
|
118
129
|
# @!attribute [rw] generated_response_part
|
119
130
|
# Contains the generated response and metadata
|
120
131
|
# @return [Types::GeneratedResponsePart]
|
@@ -205,6 +216,18 @@ module Aws::BedrockAgentRuntime
|
|
205
216
|
# Contains metadata about a part of the generated response that is
|
206
217
|
# accompanied by a citation.
|
207
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
|
230
|
+
#
|
208
231
|
# @!attribute [rw] text_response_part
|
209
232
|
# Contains metadata about a textual part of the generated response
|
210
233
|
# that is accompanied by a citation.
|
@@ -218,6 +241,32 @@ module Aws::BedrockAgentRuntime
|
|
218
241
|
include Aws::Structure
|
219
242
|
end
|
220
243
|
|
244
|
+
# Contains configurations for response generation based on the knowledge
|
245
|
+
# base query results.
|
246
|
+
#
|
247
|
+
# This data type is used in the following API operations:
|
248
|
+
#
|
249
|
+
# * [RetrieveAndGenerate request][1]
|
250
|
+
#
|
251
|
+
# ^
|
252
|
+
#
|
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
|
+
|
221
270
|
# Specifications about the inference parameters that were provided
|
222
271
|
# alongside the prompt. These are specified in the
|
223
272
|
# [PromptOverrideConfiguration][1] object that was set when the agent
|
@@ -353,6 +402,11 @@ module Aws::BedrockAgentRuntime
|
|
353
402
|
#
|
354
403
|
# @!attribute [rw] session_state
|
355
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
|
356
410
|
# @return [Types::SessionState]
|
357
411
|
#
|
358
412
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/InvokeAgentRequest AWS API Documentation
|
@@ -429,6 +483,16 @@ module Aws::BedrockAgentRuntime
|
|
429
483
|
|
430
484
|
# Contains the query made to the knowledge base.
|
431
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
|
495
|
+
#
|
432
496
|
# @!attribute [rw] text
|
433
497
|
# The text of the query made to the knowledge base.
|
434
498
|
# @return [String]
|
@@ -441,22 +505,29 @@ module Aws::BedrockAgentRuntime
|
|
441
505
|
include Aws::Structure
|
442
506
|
end
|
443
507
|
|
444
|
-
# Contains
|
508
|
+
# Contains configurations for the knowledge base query and retrieval
|
509
|
+
# process. For more information, see [Query configurations][1].
|
445
510
|
#
|
446
511
|
# This data type is used in the following API operations:
|
447
512
|
#
|
448
|
-
# * [Retrieve request
|
513
|
+
# * [Retrieve request][2] – in the `retrievalConfiguration` field
|
449
514
|
#
|
450
|
-
# * [RetrieveAndGenerate request
|
515
|
+
# * [RetrieveAndGenerate request][3] – in the `retrievalConfiguration`
|
516
|
+
# field
|
451
517
|
#
|
452
518
|
#
|
453
519
|
#
|
454
|
-
# [1]: https://docs.aws.amazon.com/bedrock/latest/
|
455
|
-
# [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-
|
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
|
456
523
|
#
|
457
524
|
# @!attribute [rw] vector_search_configuration
|
458
525
|
# Contains details about how the results from the vector search should
|
459
|
-
# be returned.
|
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
|
460
531
|
# @return [Types::KnowledgeBaseVectorSearchConfiguration]
|
461
532
|
#
|
462
533
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/KnowledgeBaseRetrievalConfiguration AWS API Documentation
|
@@ -469,6 +540,16 @@ module Aws::BedrockAgentRuntime
|
|
469
540
|
|
470
541
|
# Details about a result from querying the knowledge base.
|
471
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
|
552
|
+
#
|
472
553
|
# @!attribute [rw] content
|
473
554
|
# Contains a chunk of text from a data source in the knowledge base.
|
474
555
|
# @return [Types::RetrievalResultContent]
|
@@ -493,6 +574,23 @@ module Aws::BedrockAgentRuntime
|
|
493
574
|
|
494
575
|
# Contains details about the resource being queried.
|
495
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]
|
593
|
+
#
|
496
594
|
# @!attribute [rw] knowledge_base_id
|
497
595
|
# The unique identifier of the knowledge base that is queried and the
|
498
596
|
# foundation model used for generation.
|
@@ -510,6 +608,7 @@ module Aws::BedrockAgentRuntime
|
|
510
608
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/KnowledgeBaseRetrieveAndGenerateConfiguration AWS API Documentation
|
511
609
|
#
|
512
610
|
class KnowledgeBaseRetrieveAndGenerateConfiguration < Struct.new(
|
611
|
+
:generation_configuration,
|
513
612
|
:knowledge_base_id,
|
514
613
|
:model_arn,
|
515
614
|
:retrieval_configuration)
|
@@ -517,16 +616,24 @@ module Aws::BedrockAgentRuntime
|
|
517
616
|
include Aws::Structure
|
518
617
|
end
|
519
618
|
|
520
|
-
# Configurations for how to
|
619
|
+
# Configurations for how to perform the search query and return results.
|
620
|
+
# For more information, see [Query configurations][1].
|
521
621
|
#
|
522
|
-
#
|
523
|
-
# The number of results to return.
|
622
|
+
# This data type is used in the following API operations:
|
524
623
|
#
|
525
|
-
#
|
526
|
-
# `RetrieveAndGenerate`. Don't include it in this field if you are
|
527
|
-
# sending a `RetrieveAndGenerate` request.
|
624
|
+
# * [Retrieve request][2] – in the `vectorSearchConfiguration` field
|
528
625
|
#
|
529
|
-
#
|
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
|
634
|
+
#
|
635
|
+
# @!attribute [rw] number_of_results
|
636
|
+
# The number of source chunks to retrieve.
|
530
637
|
# @return [Integer]
|
531
638
|
#
|
532
639
|
# @!attribute [rw] override_search_type
|
@@ -943,6 +1050,48 @@ module Aws::BedrockAgentRuntime
|
|
943
1050
|
class Unknown < PreProcessingTrace; end
|
944
1051
|
end
|
945
1052
|
|
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].
|
1056
|
+
#
|
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
|
1085
|
+
# @return [String]
|
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
|
+
|
946
1095
|
# Contains the reasoning, based on the input, that the agent uses to
|
947
1096
|
# justify carrying out an action group or getting information from a
|
948
1097
|
# knowledge base.
|
@@ -1014,6 +1163,19 @@ module Aws::BedrockAgentRuntime
|
|
1014
1163
|
|
1015
1164
|
# Contains the cited text from the data source.
|
1016
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
|
1178
|
+
#
|
1017
1179
|
# @!attribute [rw] text
|
1018
1180
|
# The cited text from the data source.
|
1019
1181
|
# @return [String]
|
@@ -1028,6 +1190,19 @@ module Aws::BedrockAgentRuntime
|
|
1028
1190
|
|
1029
1191
|
# Contains information about the location of the data source.
|
1030
1192
|
#
|
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
|
1205
|
+
#
|
1031
1206
|
# @!attribute [rw] s3_location
|
1032
1207
|
# Contains the S3 location of the data source.
|
1033
1208
|
# @return [Types::RetrievalResultS3Location]
|
@@ -1047,6 +1222,19 @@ module Aws::BedrockAgentRuntime
|
|
1047
1222
|
|
1048
1223
|
# Contains the S3 location of the data source.
|
1049
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
|
1237
|
+
#
|
1050
1238
|
# @!attribute [rw] uri
|
1051
1239
|
# The S3 URI of the data source.
|
1052
1240
|
# @return [String]
|
@@ -1061,6 +1249,17 @@ module Aws::BedrockAgentRuntime
|
|
1061
1249
|
|
1062
1250
|
# Contains details about the resource being queried.
|
1063
1251
|
#
|
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
|
1262
|
+
#
|
1064
1263
|
# @!attribute [rw] knowledge_base_configuration
|
1065
1264
|
# Contains details about the resource being queried.
|
1066
1265
|
# @return [Types::KnowledgeBaseRetrieveAndGenerateConfiguration]
|
@@ -1080,6 +1279,16 @@ module Aws::BedrockAgentRuntime
|
|
1080
1279
|
|
1081
1280
|
# Contains the query made to the knowledge base.
|
1082
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
|
1291
|
+
#
|
1083
1292
|
# @!attribute [rw] text
|
1084
1293
|
# The query made to the knowledge base.
|
1085
1294
|
# @return [String]
|
@@ -1094,6 +1303,16 @@ module Aws::BedrockAgentRuntime
|
|
1094
1303
|
|
1095
1304
|
# Contains the response generated from querying the knowledge base.
|
1096
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
|
1315
|
+
#
|
1097
1316
|
# @!attribute [rw] text
|
1098
1317
|
# The response generated from querying the knowledge base.
|
1099
1318
|
# @return [String]
|
@@ -1107,12 +1326,16 @@ module Aws::BedrockAgentRuntime
|
|
1107
1326
|
end
|
1108
1327
|
|
1109
1328
|
# @!attribute [rw] input
|
1110
|
-
# Contains the query made to the knowledge base.
|
1329
|
+
# Contains the query to be made to the knowledge base.
|
1111
1330
|
# @return [Types::RetrieveAndGenerateInput]
|
1112
1331
|
#
|
1113
1332
|
# @!attribute [rw] retrieve_and_generate_configuration
|
1114
|
-
# Contains
|
1115
|
-
#
|
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
|
1116
1339
|
# @return [Types::RetrieveAndGenerateConfiguration]
|
1117
1340
|
#
|
1118
1341
|
# @!attribute [rw] session_configuration
|
@@ -1162,6 +1385,17 @@ module Aws::BedrockAgentRuntime
|
|
1162
1385
|
|
1163
1386
|
# Contains configuration about the session with the knowledge base.
|
1164
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
|
1398
|
+
#
|
1165
1399
|
# @!attribute [rw] kms_key_arn
|
1166
1400
|
# The ARN of the KMS key encrypting the session.
|
1167
1401
|
# @return [String]
|
@@ -1185,11 +1419,16 @@ module Aws::BedrockAgentRuntime
|
|
1185
1419
|
# @return [String]
|
1186
1420
|
#
|
1187
1421
|
# @!attribute [rw] retrieval_configuration
|
1188
|
-
# Contains
|
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
|
1189
1428
|
# @return [Types::KnowledgeBaseRetrievalConfiguration]
|
1190
1429
|
#
|
1191
1430
|
# @!attribute [rw] retrieval_query
|
1192
|
-
#
|
1431
|
+
# Contains the query to send the knowledge base.
|
1193
1432
|
# @return [Types::KnowledgeBaseQuery]
|
1194
1433
|
#
|
1195
1434
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/RetrieveRequest AWS API Documentation
|
@@ -1222,7 +1461,19 @@ module Aws::BedrockAgentRuntime
|
|
1222
1461
|
include Aws::Structure
|
1223
1462
|
end
|
1224
1463
|
|
1225
|
-
# Contains metadata about a
|
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
|
1226
1477
|
#
|
1227
1478
|
# @!attribute [rw] content
|
1228
1479
|
# Contains the cited text from the data source.
|
@@ -1262,13 +1513,13 @@ module Aws::BedrockAgentRuntime
|
|
1262
1513
|
# group or pass them when making an [InvokeAgent][2] request. Use
|
1263
1514
|
# session state attributes to control and provide conversational context
|
1264
1515
|
# for your agent and to help customize your agent's behavior. For more
|
1265
|
-
# information, see [
|
1516
|
+
# information, see [Control session context][3].
|
1266
1517
|
#
|
1267
1518
|
#
|
1268
1519
|
#
|
1269
1520
|
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html
|
1270
1521
|
# [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html
|
1271
|
-
# [3]: https://docs.aws.amazon.com/bedrock/latest/userguide/
|
1522
|
+
# [3]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html
|
1272
1523
|
#
|
1273
1524
|
# @!attribute [rw] prompt_session_attributes
|
1274
1525
|
# Contains attributes that persist across a prompt and the values of
|
@@ -1299,6 +1550,17 @@ module Aws::BedrockAgentRuntime
|
|
1299
1550
|
# Contains information about where the text with a citation begins and
|
1300
1551
|
# ends in the generated output.
|
1301
1552
|
#
|
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
|
1563
|
+
#
|
1302
1564
|
# @!attribute [rw] end
|
1303
1565
|
# Where the text with a citation ends in the generated output.
|
1304
1566
|
# @return [Integer]
|
@@ -1319,6 +1581,17 @@ module Aws::BedrockAgentRuntime
|
|
1319
1581
|
# Contains the part of the generated text that contains a citation,
|
1320
1582
|
# alongside where it begins and ends.
|
1321
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
|
1589
|
+
#
|
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
|
1594
|
+
#
|
1322
1595
|
# @!attribute [rw] span
|
1323
1596
|
# Contains information about where the text with a citation begins and
|
1324
1597
|
# ends in the generated output.
|
data/sig/client.rbs
CHANGED
@@ -130,6 +130,11 @@ module Aws
|
|
130
130
|
},
|
131
131
|
?retrieve_and_generate_configuration: {
|
132
132
|
knowledge_base_configuration: {
|
133
|
+
generation_configuration: {
|
134
|
+
prompt_template: {
|
135
|
+
text_prompt_template: ::String?
|
136
|
+
}?
|
137
|
+
}?,
|
133
138
|
knowledge_base_id: ::String,
|
134
139
|
model_arn: ::String,
|
135
140
|
retrieval_configuration: {
|
data/sig/types.rbs
CHANGED
@@ -75,6 +75,11 @@ module Aws::BedrockAgentRuntime
|
|
75
75
|
SENSITIVE: [:text_response_part]
|
76
76
|
end
|
77
77
|
|
78
|
+
class GenerationConfiguration
|
79
|
+
attr_accessor prompt_template: Types::PromptTemplate
|
80
|
+
SENSITIVE: []
|
81
|
+
end
|
82
|
+
|
78
83
|
class InferenceConfiguration
|
79
84
|
attr_accessor maximum_length: ::Integer
|
80
85
|
attr_accessor stop_sequences: ::Array[::String]
|
@@ -145,6 +150,7 @@ module Aws::BedrockAgentRuntime
|
|
145
150
|
end
|
146
151
|
|
147
152
|
class KnowledgeBaseRetrieveAndGenerateConfiguration
|
153
|
+
attr_accessor generation_configuration: Types::GenerationConfiguration
|
148
154
|
attr_accessor knowledge_base_id: ::String
|
149
155
|
attr_accessor model_arn: ::String
|
150
156
|
attr_accessor retrieval_configuration: Types::KnowledgeBaseRetrievalConfiguration
|
@@ -263,6 +269,11 @@ module Aws::BedrockAgentRuntime
|
|
263
269
|
end
|
264
270
|
end
|
265
271
|
|
272
|
+
class PromptTemplate
|
273
|
+
attr_accessor text_prompt_template: ::String
|
274
|
+
SENSITIVE: [:text_prompt_template]
|
275
|
+
end
|
276
|
+
|
266
277
|
class Rationale
|
267
278
|
attr_accessor text: ::String
|
268
279
|
attr_accessor trace_id: ::String
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-bedrockagentruntime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|