aws-sdk-bedrockruntime 1.30.0 → 1.31.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dcfc4e7f6c78a73858c124ab8a49a9da445cdeadeaacdc30890d114afdf0de17
4
- data.tar.gz: 0ed57e3a23ea6695dcfcefc2b9009c3f02e97130585b67629eae8b0847b1902c
3
+ metadata.gz: f743e35a23c1b5da7f2f760eef26a9db4f6b4eb24e9487f0196138617e57c837
4
+ data.tar.gz: 1c5b8ca501e869cc08952699f11747f48e20f2f1164c3f106514d708773c59ef
5
5
  SHA512:
6
- metadata.gz: e7002669b089efcc7abf2e81047f1afa2c5ef506bc13286660a3114042fe56d3a9aa9c033295416d23161254e7a22c52e58365c7cb7fc4861b871e51b15d6979
7
- data.tar.gz: b66b1426d1cb3e1887d9bba00efe11fabc3c7e23dc285686d1455e8b60c3530783385ce899cf40eb8c10498c1742192f993b9c6b1ef83f6e65af44a35c5c22fb
6
+ metadata.gz: d78201650cc1ce6ac6c105b019fb07c966732c56329f34513e128af99fd12e27b4f0a29f0fb5c4e2d1ddc35314288f1376d4645de865d440bfaf2541bbb525ed
7
+ data.tar.gz: 4d330688343a70c240dd6729cf2ac635676e42fb85c0ad63dee52934d4ca3833fea6eedb090c7d60a992b470b1b14ea6c3f03f1973813bb6ec8131aed6e9d652
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.31.0 (2024-11-07)
5
+ ------------------
6
+
7
+ * Feature - Add Prompt management support to Bedrock runtime APIs: Converse, ConverseStream, InvokeModel, InvokeModelWithStreamingResponse
8
+
4
9
  1.30.0 (2024-11-06)
5
10
  ------------------
6
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.30.0
1
+ 1.31.0
@@ -568,6 +568,21 @@ module Aws::BedrockRuntime
568
568
  # Amazon Bedrock doesn't store any text, images, or documents that you
569
569
  # provide as content. The data is only used to generate the response.
570
570
  #
571
+ # You can submit a prompt by including it in the `messages` field,
572
+ # specifying the `modelId` of a foundation model or inference profile to
573
+ # run inference on it, and including any other fields that are relevant
574
+ # to your use case.
575
+ #
576
+ # You can also submit a prompt from Prompt management by specifying the
577
+ # ARN of the prompt version and including a map of variables to values
578
+ # in the `promptVariables` field. You can append more messages to the
579
+ # prompt by using the `messages` field. If you use a prompt from Prompt
580
+ # management, you can't include the following fields in the request:
581
+ # `additionalModelRequestFields`, `inferenceConfig`, `system`, or
582
+ # `toolConfig`. Instead, these fields must be defined through Prompt
583
+ # management. For more information, see [Use a prompt from Prompt
584
+ # management][1].
585
+ #
571
586
  # For information about the Converse API, see *Use the Converse API* in
572
587
  # the *Amazon Bedrock User Guide*. To use a guardrail, see *Use a
573
588
  # guardrail with the Converse API* in the *Amazon Bedrock User Guide*.
@@ -580,10 +595,13 @@ module Aws::BedrockRuntime
580
595
  # This operation requires permission for the `bedrock:InvokeModel`
581
596
  # action.
582
597
  #
583
- # @option params [required, String] :model_id
584
- # The identifier for the model that you want to call.
585
598
  #
586
- # The `modelId` to provide depends on the type of model or throughput
599
+ #
600
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-use.html
601
+ #
602
+ # @option params [required, String] :model_id
603
+ # Specifies the model or throughput with which to run inference, or the
604
+ # prompt resource to use in inference. The value depends on the resource
587
605
  # that you use:
588
606
  #
589
607
  # * If you use a base model, specify the model ID or its ARN. For a list
@@ -604,6 +622,9 @@ module Aws::BedrockRuntime
604
622
  # more information, see [Use a custom model in Amazon Bedrock][4] in
605
623
  # the Amazon Bedrock User Guide.
606
624
  #
625
+ # * To include a prompt that was defined in Prompt management, specify
626
+ # the ARN of the prompt version to use.
627
+ #
607
628
  # The Converse API doesn't support [imported models][5].
608
629
  #
609
630
  #
@@ -614,17 +635,19 @@ module Aws::BedrockRuntime
614
635
  # [4]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html
615
636
  # [5]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html
616
637
  #
617
- # @option params [required, Array<Types::Message>] :messages
638
+ # @option params [Array<Types::Message>] :messages
618
639
  # The messages that you want to send to the model.
619
640
  #
620
641
  # @option params [Array<Types::SystemContentBlock>] :system
621
- # A system prompt to pass to the model.
642
+ # A prompt that provides instructions or context to the model about the
643
+ # task it should perform, or the persona it should adopt during the
644
+ # conversation.
622
645
  #
623
646
  # @option params [Types::InferenceConfiguration] :inference_config
624
- # Inference parameters to pass to the model. `Converse` supports a base
625
- # set of inference parameters. If you need to pass additional parameters
626
- # that the model supports, use the `additionalModelRequestFields`
627
- # request field.
647
+ # Inference parameters to pass to the model. `Converse` and
648
+ # `ConverseStream` support a base set of inference parameters. If you
649
+ # need to pass additional parameters that the model supports, use the
650
+ # `additionalModelRequestFields` request field.
628
651
  #
629
652
  # @option params [Types::ToolConfiguration] :tool_config
630
653
  # Configuration information for the tools that the model can use when
@@ -637,13 +660,17 @@ module Aws::BedrockRuntime
637
660
  #
638
661
  # @option params [Types::GuardrailConfiguration] :guardrail_config
639
662
  # Configuration information for a guardrail that you want to use in the
640
- # request.
663
+ # request. If you include `guardContent` blocks in the `content` field
664
+ # in the `messages` field, the guardrail operates only on those
665
+ # messages. If you include no `guardContent` blocks, the guardrail
666
+ # operates on all messages in the request body and in any included
667
+ # prompt resource.
641
668
  #
642
669
  # @option params [Hash,Array,String,Numeric,Boolean] :additional_model_request_fields
643
670
  # Additional inference parameters that the model supports, beyond the
644
- # base set of inference parameters that `Converse` supports in the
645
- # `inferenceConfig` field. For more information, see [Model
646
- # parameters][1].
671
+ # base set of inference parameters that `Converse` and `ConverseStream`
672
+ # support in the `inferenceConfig` field. For more information, see
673
+ # [Model parameters][1].
647
674
  #
648
675
  # Document type used to carry open content
649
676
  # (Hash,Array,String,Numeric,Boolean). A document type value is
@@ -654,21 +681,27 @@ module Aws::BedrockRuntime
654
681
  #
655
682
  # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html
656
683
  #
684
+ # @option params [Hash<String,Types::PromptVariableValues>] :prompt_variables
685
+ # Contains a map of variables in a prompt from Prompt management to
686
+ # objects containing the values to fill in for them when running model
687
+ # invocation. This field is ignored if you don't specify a prompt
688
+ # resource in the `modelId` field.
689
+ #
657
690
  # @option params [Array<String>] :additional_model_response_field_paths
658
691
  # Additional model parameters field paths to return in the response.
659
- # `Converse` returns the requested fields as a JSON Pointer object in
660
- # the `additionalModelResponseFields` field. The following is example
661
- # JSON for `additionalModelResponseFieldPaths`.
692
+ # `Converse` and `ConverseStream` return the requested fields as a JSON
693
+ # Pointer object in the `additionalModelResponseFields` field. The
694
+ # following is example JSON for `additionalModelResponseFieldPaths`.
662
695
  #
663
696
  # `[ "/stop_sequence" ]`
664
697
  #
665
698
  # For information about the JSON Pointer syntax, see the [Internet
666
699
  # Engineering Task Force (IETF)][1] documentation.
667
700
  #
668
- # `Converse` rejects an empty JSON Pointer or incorrectly structured
669
- # JSON Pointer with a `400` error code. if the JSON Pointer is valid,
670
- # but the requested field is not in the model response, it is ignored by
671
- # `Converse`.
701
+ # `Converse` and `ConverseStream` reject an empty JSON Pointer or
702
+ # incorrectly structured JSON Pointer with a `400` error code. if the
703
+ # JSON Pointer is valid, but the requested field is not in the model
704
+ # response, it is ignored by `Converse`.
672
705
  #
673
706
  #
674
707
  #
@@ -687,7 +720,7 @@ module Aws::BedrockRuntime
687
720
  #
688
721
  # resp = client.converse({
689
722
  # model_id: "ConversationalModelId", # required
690
- # messages: [ # required
723
+ # messages: [
691
724
  # {
692
725
  # role: "user", # required, accepts user, assistant
693
726
  # content: [ # required
@@ -793,6 +826,11 @@ module Aws::BedrockRuntime
793
826
  # },
794
827
  # additional_model_request_fields: {
795
828
  # },
829
+ # prompt_variables: {
830
+ # "String" => {
831
+ # text: "String",
832
+ # },
833
+ # },
796
834
  # additional_model_response_field_paths: ["ConverseRequestAdditionalModelResponseFieldPathsListMemberString"],
797
835
  # })
798
836
  #
@@ -937,6 +975,21 @@ module Aws::BedrockRuntime
937
975
  # Amazon Bedrock doesn't store any text, images, or documents that you
938
976
  # provide as content. The data is only used to generate the response.
939
977
  #
978
+ # You can submit a prompt by including it in the `messages` field,
979
+ # specifying the `modelId` of a foundation model or inference profile to
980
+ # run inference on it, and including any other fields that are relevant
981
+ # to your use case.
982
+ #
983
+ # You can also submit a prompt from Prompt management by specifying the
984
+ # ARN of the prompt version and including a map of variables to values
985
+ # in the `promptVariables` field. You can append more messages to the
986
+ # prompt by using the `messages` field. If you use a prompt from Prompt
987
+ # management, you can't include the following fields in the request:
988
+ # `additionalModelRequestFields`, `inferenceConfig`, `system`, or
989
+ # `toolConfig`. Instead, these fields must be defined through Prompt
990
+ # management. For more information, see [Use a prompt from Prompt
991
+ # management][2].
992
+ #
940
993
  # For information about the Converse API, see *Use the Converse API* in
941
994
  # the *Amazon Bedrock User Guide*. To use a guardrail, see *Use a
942
995
  # guardrail with the Converse API* in the *Amazon Bedrock User Guide*.
@@ -952,11 +1005,11 @@ module Aws::BedrockRuntime
952
1005
  #
953
1006
  #
954
1007
  # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetFoundationModel.html
1008
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-use.html
955
1009
  #
956
1010
  # @option params [required, String] :model_id
957
- # The ID for the model.
958
- #
959
- # The `modelId` to provide depends on the type of model or throughput
1011
+ # Specifies the model or throughput with which to run inference, or the
1012
+ # prompt resource to use in inference. The value depends on the resource
960
1013
  # that you use:
961
1014
  #
962
1015
  # * If you use a base model, specify the model ID or its ARN. For a list
@@ -977,6 +1030,9 @@ module Aws::BedrockRuntime
977
1030
  # more information, see [Use a custom model in Amazon Bedrock][4] in
978
1031
  # the Amazon Bedrock User Guide.
979
1032
  #
1033
+ # * To include a prompt that was defined in Prompt management, specify
1034
+ # the ARN of the prompt version to use.
1035
+ #
980
1036
  # The Converse API doesn't support [imported models][5].
981
1037
  #
982
1038
  #
@@ -987,16 +1043,18 @@ module Aws::BedrockRuntime
987
1043
  # [4]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html
988
1044
  # [5]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html
989
1045
  #
990
- # @option params [required, Array<Types::Message>] :messages
1046
+ # @option params [Array<Types::Message>] :messages
991
1047
  # The messages that you want to send to the model.
992
1048
  #
993
1049
  # @option params [Array<Types::SystemContentBlock>] :system
994
- # A system prompt to send to the model.
1050
+ # A prompt that provides instructions or context to the model about the
1051
+ # task it should perform, or the persona it should adopt during the
1052
+ # conversation.
995
1053
  #
996
1054
  # @option params [Types::InferenceConfiguration] :inference_config
997
- # Inference parameters to pass to the model. `ConverseStream` supports a
998
- # base set of inference parameters. If you need to pass additional
999
- # parameters that the model supports, use the
1055
+ # Inference parameters to pass to the model. `Converse` and
1056
+ # `ConverseStream` support a base set of inference parameters. If you
1057
+ # need to pass additional parameters that the model supports, use the
1000
1058
  # `additionalModelRequestFields` request field.
1001
1059
  #
1002
1060
  # @option params [Types::ToolConfiguration] :tool_config
@@ -1009,33 +1067,48 @@ module Aws::BedrockRuntime
1009
1067
  #
1010
1068
  # @option params [Types::GuardrailStreamConfiguration] :guardrail_config
1011
1069
  # Configuration information for a guardrail that you want to use in the
1012
- # request.
1070
+ # request. If you include `guardContent` blocks in the `content` field
1071
+ # in the `messages` field, the guardrail operates only on those
1072
+ # messages. If you include no `guardContent` blocks, the guardrail
1073
+ # operates on all messages in the request body and in any included
1074
+ # prompt resource.
1013
1075
  #
1014
1076
  # @option params [Hash,Array,String,Numeric,Boolean] :additional_model_request_fields
1015
1077
  # Additional inference parameters that the model supports, beyond the
1016
- # base set of inference parameters that `ConverseStream` supports in the
1017
- # `inferenceConfig` field.
1078
+ # base set of inference parameters that `Converse` and `ConverseStream`
1079
+ # support in the `inferenceConfig` field. For more information, see
1080
+ # [Model parameters][1].
1018
1081
  #
1019
1082
  # Document type used to carry open content
1020
1083
  # (Hash,Array,String,Numeric,Boolean). A document type value is
1021
1084
  # serialized using the same format as its surroundings and requires no
1022
1085
  # additional encoding or escaping.
1023
1086
  #
1087
+ #
1088
+ #
1089
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html
1090
+ #
1091
+ # @option params [Hash<String,Types::PromptVariableValues>] :prompt_variables
1092
+ # Contains a map of variables in a prompt from Prompt management to
1093
+ # objects containing the values to fill in for them when running model
1094
+ # invocation. This field is ignored if you don't specify a prompt
1095
+ # resource in the `modelId` field.
1096
+ #
1024
1097
  # @option params [Array<String>] :additional_model_response_field_paths
1025
1098
  # Additional model parameters field paths to return in the response.
1026
- # `ConverseStream` returns the requested fields as a JSON Pointer object
1027
- # in the `additionalModelResponseFields` field. The following is example
1028
- # JSON for `additionalModelResponseFieldPaths`.
1099
+ # `Converse` and `ConverseStream` return the requested fields as a JSON
1100
+ # Pointer object in the `additionalModelResponseFields` field. The
1101
+ # following is example JSON for `additionalModelResponseFieldPaths`.
1029
1102
  #
1030
1103
  # `[ "/stop_sequence" ]`
1031
1104
  #
1032
1105
  # For information about the JSON Pointer syntax, see the [Internet
1033
1106
  # Engineering Task Force (IETF)][1] documentation.
1034
1107
  #
1035
- # `ConverseStream` rejects an empty JSON Pointer or incorrectly
1036
- # structured JSON Pointer with a `400` error code. if the JSON Pointer
1037
- # is valid, but the requested field is not in the model response, it is
1038
- # ignored by `ConverseStream`.
1108
+ # `Converse` and `ConverseStream` reject an empty JSON Pointer or
1109
+ # incorrectly structured JSON Pointer with a `400` error code. if the
1110
+ # JSON Pointer is valid, but the requested field is not in the model
1111
+ # response, it is ignored by `Converse`.
1039
1112
  #
1040
1113
  #
1041
1114
  #
@@ -1222,7 +1295,7 @@ module Aws::BedrockRuntime
1222
1295
  #
1223
1296
  # resp = client.converse_stream({
1224
1297
  # model_id: "ConversationalModelId", # required
1225
- # messages: [ # required
1298
+ # messages: [
1226
1299
  # {
1227
1300
  # role: "user", # required, accepts user, assistant
1228
1301
  # content: [ # required
@@ -1329,6 +1402,11 @@ module Aws::BedrockRuntime
1329
1402
  # },
1330
1403
  # additional_model_request_fields: {
1331
1404
  # },
1405
+ # prompt_variables: {
1406
+ # "String" => {
1407
+ # text: "String",
1408
+ # },
1409
+ # },
1332
1410
  # additional_model_response_field_paths: ["ConverseStreamRequestAdditionalModelResponseFieldPathsListMemberString"],
1333
1411
  # })
1334
1412
  #
@@ -1500,7 +1578,7 @@ module Aws::BedrockRuntime
1500
1578
  # This operation requires permission for the `bedrock:InvokeModel`
1501
1579
  # action.
1502
1580
  #
1503
- # @option params [required, String, StringIO, File] :body
1581
+ # @option params [String, StringIO, File] :body
1504
1582
  # The prompt and inference parameters in the format specified in the
1505
1583
  # `contentType` in the header. You must provide the body in JSON format.
1506
1584
  # To see the format and content of the request and response bodies for
@@ -1581,7 +1659,7 @@ module Aws::BedrockRuntime
1581
1659
  # @example Request syntax with placeholder values
1582
1660
  #
1583
1661
  # resp = client.invoke_model({
1584
- # body: "data", # required
1662
+ # body: "data",
1585
1663
  # content_type: "MimeType",
1586
1664
  # accept: "MimeType",
1587
1665
  # model_id: "InvokeModelIdentifier", # required
@@ -1626,7 +1704,7 @@ module Aws::BedrockRuntime
1626
1704
  #
1627
1705
  # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetFoundationModel.html
1628
1706
  #
1629
- # @option params [required, String, StringIO, File] :body
1707
+ # @option params [String, StringIO, File] :body
1630
1708
  # The prompt and inference parameters in the format specified in the
1631
1709
  # `contentType` in the header. You must provide the body in JSON format.
1632
1710
  # To see the format and content of the request and response bodies for
@@ -1844,7 +1922,7 @@ module Aws::BedrockRuntime
1844
1922
  # @example Request syntax with placeholder values
1845
1923
  #
1846
1924
  # resp = client.invoke_model_with_response_stream({
1847
- # body: "data", # required
1925
+ # body: "data",
1848
1926
  # content_type: "MimeType",
1849
1927
  # accept: "MimeType",
1850
1928
  # model_id: "InvokeModelIdentifier", # required
@@ -1929,7 +2007,7 @@ module Aws::BedrockRuntime
1929
2007
  tracer: tracer
1930
2008
  )
1931
2009
  context[:gem_name] = 'aws-sdk-bedrockruntime'
1932
- context[:gem_version] = '1.30.0'
2010
+ context[:gem_version] = '1.31.0'
1933
2011
  Seahorse::Client::Request.new(handlers, context)
1934
2012
  end
1935
2013
 
@@ -150,6 +150,8 @@ module Aws::BedrockRuntime
150
150
  NonNegativeInteger = Shapes::IntegerShape.new(name: 'NonNegativeInteger')
151
151
  PartBody = Shapes::BlobShape.new(name: 'PartBody')
152
152
  PayloadPart = Shapes::StructureShape.new(name: 'PayloadPart')
153
+ PromptVariableMap = Shapes::MapShape.new(name: 'PromptVariableMap')
154
+ PromptVariableValues = Shapes::UnionShape.new(name: 'PromptVariableValues')
153
155
  ResourceNotFoundException = Shapes::StructureShape.new(name: 'ResourceNotFoundException')
154
156
  ResponseStream = Shapes::StructureShape.new(name: 'ResponseStream')
155
157
  ServiceQuotaExceededException = Shapes::StructureShape.new(name: 'ServiceQuotaExceededException')
@@ -258,12 +260,13 @@ module Aws::BedrockRuntime
258
260
  ConverseOutput.struct_class = Types::ConverseOutput
259
261
 
260
262
  ConverseRequest.add_member(:model_id, Shapes::ShapeRef.new(shape: ConversationalModelId, required: true, location: "uri", location_name: "modelId"))
261
- ConverseRequest.add_member(:messages, Shapes::ShapeRef.new(shape: Messages, required: true, location_name: "messages"))
263
+ ConverseRequest.add_member(:messages, Shapes::ShapeRef.new(shape: Messages, location_name: "messages"))
262
264
  ConverseRequest.add_member(:system, Shapes::ShapeRef.new(shape: SystemContentBlocks, location_name: "system"))
263
265
  ConverseRequest.add_member(:inference_config, Shapes::ShapeRef.new(shape: InferenceConfiguration, location_name: "inferenceConfig"))
264
266
  ConverseRequest.add_member(:tool_config, Shapes::ShapeRef.new(shape: ToolConfiguration, location_name: "toolConfig"))
265
267
  ConverseRequest.add_member(:guardrail_config, Shapes::ShapeRef.new(shape: GuardrailConfiguration, location_name: "guardrailConfig"))
266
268
  ConverseRequest.add_member(:additional_model_request_fields, Shapes::ShapeRef.new(shape: Document, location_name: "additionalModelRequestFields"))
269
+ ConverseRequest.add_member(:prompt_variables, Shapes::ShapeRef.new(shape: PromptVariableMap, location_name: "promptVariables"))
267
270
  ConverseRequest.add_member(:additional_model_response_field_paths, Shapes::ShapeRef.new(shape: ConverseRequestAdditionalModelResponseFieldPathsList, location_name: "additionalModelResponseFieldPaths"))
268
271
  ConverseRequest.struct_class = Types::ConverseRequest
269
272
 
@@ -299,12 +302,13 @@ module Aws::BedrockRuntime
299
302
  ConverseStreamOutput.struct_class = Types::ConverseStreamOutput
300
303
 
301
304
  ConverseStreamRequest.add_member(:model_id, Shapes::ShapeRef.new(shape: ConversationalModelId, required: true, location: "uri", location_name: "modelId"))
302
- ConverseStreamRequest.add_member(:messages, Shapes::ShapeRef.new(shape: Messages, required: true, location_name: "messages"))
305
+ ConverseStreamRequest.add_member(:messages, Shapes::ShapeRef.new(shape: Messages, location_name: "messages"))
303
306
  ConverseStreamRequest.add_member(:system, Shapes::ShapeRef.new(shape: SystemContentBlocks, location_name: "system"))
304
307
  ConverseStreamRequest.add_member(:inference_config, Shapes::ShapeRef.new(shape: InferenceConfiguration, location_name: "inferenceConfig"))
305
308
  ConverseStreamRequest.add_member(:tool_config, Shapes::ShapeRef.new(shape: ToolConfiguration, location_name: "toolConfig"))
306
309
  ConverseStreamRequest.add_member(:guardrail_config, Shapes::ShapeRef.new(shape: GuardrailStreamConfiguration, location_name: "guardrailConfig"))
307
310
  ConverseStreamRequest.add_member(:additional_model_request_fields, Shapes::ShapeRef.new(shape: Document, location_name: "additionalModelRequestFields"))
311
+ ConverseStreamRequest.add_member(:prompt_variables, Shapes::ShapeRef.new(shape: PromptVariableMap, location_name: "promptVariables"))
308
312
  ConverseStreamRequest.add_member(:additional_model_response_field_paths, Shapes::ShapeRef.new(shape: ConverseStreamRequestAdditionalModelResponseFieldPathsList, location_name: "additionalModelResponseFieldPaths"))
309
313
  ConverseStreamRequest.struct_class = Types::ConverseStreamRequest
310
314
 
@@ -504,7 +508,7 @@ module Aws::BedrockRuntime
504
508
  InternalServerException.add_member(:message, Shapes::ShapeRef.new(shape: NonBlankString, location_name: "message"))
505
509
  InternalServerException.struct_class = Types::InternalServerException
506
510
 
507
- InvokeModelRequest.add_member(:body, Shapes::ShapeRef.new(shape: Body, required: true, location_name: "body"))
511
+ InvokeModelRequest.add_member(:body, Shapes::ShapeRef.new(shape: Body, location_name: "body"))
508
512
  InvokeModelRequest.add_member(:content_type, Shapes::ShapeRef.new(shape: MimeType, location: "header", location_name: "Content-Type"))
509
513
  InvokeModelRequest.add_member(:accept, Shapes::ShapeRef.new(shape: MimeType, location: "header", location_name: "Accept"))
510
514
  InvokeModelRequest.add_member(:model_id, Shapes::ShapeRef.new(shape: InvokeModelIdentifier, required: true, location: "uri", location_name: "modelId"))
@@ -521,7 +525,7 @@ module Aws::BedrockRuntime
521
525
  InvokeModelResponse[:payload] = :body
522
526
  InvokeModelResponse[:payload_member] = InvokeModelResponse.member(:body)
523
527
 
524
- InvokeModelWithResponseStreamRequest.add_member(:body, Shapes::ShapeRef.new(shape: Body, required: true, location_name: "body"))
528
+ InvokeModelWithResponseStreamRequest.add_member(:body, Shapes::ShapeRef.new(shape: Body, location_name: "body"))
525
529
  InvokeModelWithResponseStreamRequest.add_member(:content_type, Shapes::ShapeRef.new(shape: MimeType, location: "header", location_name: "Content-Type"))
526
530
  InvokeModelWithResponseStreamRequest.add_member(:accept, Shapes::ShapeRef.new(shape: MimeType, location: "header", location_name: "X-Amzn-Bedrock-Accept"))
527
531
  InvokeModelWithResponseStreamRequest.add_member(:model_id, Shapes::ShapeRef.new(shape: InvokeModelIdentifier, required: true, location: "uri", location_name: "modelId"))
@@ -572,6 +576,15 @@ module Aws::BedrockRuntime
572
576
  PayloadPart.add_member(:bytes, Shapes::ShapeRef.new(shape: PartBody, location_name: "bytes"))
573
577
  PayloadPart.struct_class = Types::PayloadPart
574
578
 
579
+ PromptVariableMap.key = Shapes::ShapeRef.new(shape: String)
580
+ PromptVariableMap.value = Shapes::ShapeRef.new(shape: PromptVariableValues)
581
+
582
+ PromptVariableValues.add_member(:text, Shapes::ShapeRef.new(shape: String, location_name: "text"))
583
+ PromptVariableValues.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
584
+ PromptVariableValues.add_member_subclass(:text, Types::PromptVariableValues::Text)
585
+ PromptVariableValues.add_member_subclass(:unknown, Types::PromptVariableValues::Unknown)
586
+ PromptVariableValues.struct_class = Types::PromptVariableValues
587
+
575
588
  ResourceNotFoundException.add_member(:message, Shapes::ShapeRef.new(shape: NonBlankString, location_name: "message"))
576
589
  ResourceNotFoundException.struct_class = Types::ResourceNotFoundException
577
590
 
@@ -315,10 +315,9 @@ module Aws::BedrockRuntime
315
315
  end
316
316
 
317
317
  # @!attribute [rw] model_id
318
- # The identifier for the model that you want to call.
319
- #
320
- # The `modelId` to provide depends on the type of model or throughput
321
- # that you use:
318
+ # Specifies the model or throughput with which to run inference, or
319
+ # the prompt resource to use in inference. The value depends on the
320
+ # resource that you use:
322
321
  #
323
322
  # * If you use a base model, specify the model ID or its ARN. For a
324
323
  # list of model IDs for base models, see [Amazon Bedrock base model
@@ -338,6 +337,9 @@ module Aws::BedrockRuntime
338
337
  # For more information, see [Use a custom model in Amazon
339
338
  # Bedrock][4] in the Amazon Bedrock User Guide.
340
339
  #
340
+ # * To include a prompt that was defined in Prompt management, specify
341
+ # the ARN of the prompt version to use.
342
+ #
341
343
  # The Converse API doesn't support [imported models][5].
342
344
  #
343
345
  #
@@ -354,13 +356,15 @@ module Aws::BedrockRuntime
354
356
  # @return [Array<Types::Message>]
355
357
  #
356
358
  # @!attribute [rw] system
357
- # A system prompt to pass to the model.
359
+ # A prompt that provides instructions or context to the model about
360
+ # the task it should perform, or the persona it should adopt during
361
+ # the conversation.
358
362
  # @return [Array<Types::SystemContentBlock>]
359
363
  #
360
364
  # @!attribute [rw] inference_config
361
- # Inference parameters to pass to the model. `Converse` supports a
362
- # base set of inference parameters. If you need to pass additional
363
- # parameters that the model supports, use the
365
+ # Inference parameters to pass to the model. `Converse` and
366
+ # `ConverseStream` support a base set of inference parameters. If you
367
+ # need to pass additional parameters that the model supports, use the
364
368
  # `additionalModelRequestFields` request field.
365
369
  # @return [Types::InferenceConfiguration]
366
370
  #
@@ -376,35 +380,47 @@ module Aws::BedrockRuntime
376
380
  #
377
381
  # @!attribute [rw] guardrail_config
378
382
  # Configuration information for a guardrail that you want to use in
379
- # the request.
383
+ # the request. If you include `guardContent` blocks in the `content`
384
+ # field in the `messages` field, the guardrail operates only on those
385
+ # messages. If you include no `guardContent` blocks, the guardrail
386
+ # operates on all messages in the request body and in any included
387
+ # prompt resource.
380
388
  # @return [Types::GuardrailConfiguration]
381
389
  #
382
390
  # @!attribute [rw] additional_model_request_fields
383
391
  # Additional inference parameters that the model supports, beyond the
384
- # base set of inference parameters that `Converse` supports in the
385
- # `inferenceConfig` field. For more information, see [Model
386
- # parameters][1].
392
+ # base set of inference parameters that `Converse` and
393
+ # `ConverseStream` support in the `inferenceConfig` field. For more
394
+ # information, see [Model parameters][1].
387
395
  #
388
396
  #
389
397
  #
390
398
  # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html
391
399
  # @return [Hash,Array,String,Numeric,Boolean]
392
400
  #
401
+ # @!attribute [rw] prompt_variables
402
+ # Contains a map of variables in a prompt from Prompt management to
403
+ # objects containing the values to fill in for them when running model
404
+ # invocation. This field is ignored if you don't specify a prompt
405
+ # resource in the `modelId` field.
406
+ # @return [Hash<String,Types::PromptVariableValues>]
407
+ #
393
408
  # @!attribute [rw] additional_model_response_field_paths
394
409
  # Additional model parameters field paths to return in the response.
395
- # `Converse` returns the requested fields as a JSON Pointer object in
396
- # the `additionalModelResponseFields` field. The following is example
397
- # JSON for `additionalModelResponseFieldPaths`.
410
+ # `Converse` and `ConverseStream` return the requested fields as a
411
+ # JSON Pointer object in the `additionalModelResponseFields` field.
412
+ # The following is example JSON for
413
+ # `additionalModelResponseFieldPaths`.
398
414
  #
399
415
  # `[ "/stop_sequence" ]`
400
416
  #
401
417
  # For information about the JSON Pointer syntax, see the [Internet
402
418
  # Engineering Task Force (IETF)][1] documentation.
403
419
  #
404
- # `Converse` rejects an empty JSON Pointer or incorrectly structured
405
- # JSON Pointer with a `400` error code. if the JSON Pointer is valid,
406
- # but the requested field is not in the model response, it is ignored
407
- # by `Converse`.
420
+ # `Converse` and `ConverseStream` reject an empty JSON Pointer or
421
+ # incorrectly structured JSON Pointer with a `400` error code. if the
422
+ # JSON Pointer is valid, but the requested field is not in the model
423
+ # response, it is ignored by `Converse`.
408
424
  #
409
425
  #
410
426
  #
@@ -421,8 +437,9 @@ module Aws::BedrockRuntime
421
437
  :tool_config,
422
438
  :guardrail_config,
423
439
  :additional_model_request_fields,
440
+ :prompt_variables,
424
441
  :additional_model_response_field_paths)
425
- SENSITIVE = []
442
+ SENSITIVE = [:prompt_variables]
426
443
  include Aws::Structure
427
444
  end
428
445
 
@@ -511,10 +528,9 @@ module Aws::BedrockRuntime
511
528
  end
512
529
 
513
530
  # @!attribute [rw] model_id
514
- # The ID for the model.
515
- #
516
- # The `modelId` to provide depends on the type of model or throughput
517
- # that you use:
531
+ # Specifies the model or throughput with which to run inference, or
532
+ # the prompt resource to use in inference. The value depends on the
533
+ # resource that you use:
518
534
  #
519
535
  # * If you use a base model, specify the model ID or its ARN. For a
520
536
  # list of model IDs for base models, see [Amazon Bedrock base model
@@ -534,6 +550,9 @@ module Aws::BedrockRuntime
534
550
  # For more information, see [Use a custom model in Amazon
535
551
  # Bedrock][4] in the Amazon Bedrock User Guide.
536
552
  #
553
+ # * To include a prompt that was defined in Prompt management, specify
554
+ # the ARN of the prompt version to use.
555
+ #
537
556
  # The Converse API doesn't support [imported models][5].
538
557
  #
539
558
  #
@@ -550,13 +569,15 @@ module Aws::BedrockRuntime
550
569
  # @return [Array<Types::Message>]
551
570
  #
552
571
  # @!attribute [rw] system
553
- # A system prompt to send to the model.
572
+ # A prompt that provides instructions or context to the model about
573
+ # the task it should perform, or the persona it should adopt during
574
+ # the conversation.
554
575
  # @return [Array<Types::SystemContentBlock>]
555
576
  #
556
577
  # @!attribute [rw] inference_config
557
- # Inference parameters to pass to the model. `ConverseStream` supports
558
- # a base set of inference parameters. If you need to pass additional
559
- # parameters that the model supports, use the
578
+ # Inference parameters to pass to the model. `Converse` and
579
+ # `ConverseStream` support a base set of inference parameters. If you
580
+ # need to pass additional parameters that the model supports, use the
560
581
  # `additionalModelRequestFields` request field.
561
582
  # @return [Types::InferenceConfiguration]
562
583
  #
@@ -571,30 +592,47 @@ module Aws::BedrockRuntime
571
592
  #
572
593
  # @!attribute [rw] guardrail_config
573
594
  # Configuration information for a guardrail that you want to use in
574
- # the request.
595
+ # the request. If you include `guardContent` blocks in the `content`
596
+ # field in the `messages` field, the guardrail operates only on those
597
+ # messages. If you include no `guardContent` blocks, the guardrail
598
+ # operates on all messages in the request body and in any included
599
+ # prompt resource.
575
600
  # @return [Types::GuardrailStreamConfiguration]
576
601
  #
577
602
  # @!attribute [rw] additional_model_request_fields
578
603
  # Additional inference parameters that the model supports, beyond the
579
- # base set of inference parameters that `ConverseStream` supports in
580
- # the `inferenceConfig` field.
604
+ # base set of inference parameters that `Converse` and
605
+ # `ConverseStream` support in the `inferenceConfig` field. For more
606
+ # information, see [Model parameters][1].
607
+ #
608
+ #
609
+ #
610
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html
581
611
  # @return [Hash,Array,String,Numeric,Boolean]
582
612
  #
613
+ # @!attribute [rw] prompt_variables
614
+ # Contains a map of variables in a prompt from Prompt management to
615
+ # objects containing the values to fill in for them when running model
616
+ # invocation. This field is ignored if you don't specify a prompt
617
+ # resource in the `modelId` field.
618
+ # @return [Hash<String,Types::PromptVariableValues>]
619
+ #
583
620
  # @!attribute [rw] additional_model_response_field_paths
584
621
  # Additional model parameters field paths to return in the response.
585
- # `ConverseStream` returns the requested fields as a JSON Pointer
586
- # object in the `additionalModelResponseFields` field. The following
587
- # is example JSON for `additionalModelResponseFieldPaths`.
622
+ # `Converse` and `ConverseStream` return the requested fields as a
623
+ # JSON Pointer object in the `additionalModelResponseFields` field.
624
+ # The following is example JSON for
625
+ # `additionalModelResponseFieldPaths`.
588
626
  #
589
627
  # `[ "/stop_sequence" ]`
590
628
  #
591
629
  # For information about the JSON Pointer syntax, see the [Internet
592
630
  # Engineering Task Force (IETF)][1] documentation.
593
631
  #
594
- # `ConverseStream` rejects an empty JSON Pointer or incorrectly
595
- # structured JSON Pointer with a `400` error code. if the JSON Pointer
596
- # is valid, but the requested field is not in the model response, it
597
- # is ignored by `ConverseStream`.
632
+ # `Converse` and `ConverseStream` reject an empty JSON Pointer or
633
+ # incorrectly structured JSON Pointer with a `400` error code. if the
634
+ # JSON Pointer is valid, but the requested field is not in the model
635
+ # response, it is ignored by `Converse`.
598
636
  #
599
637
  #
600
638
  #
@@ -611,8 +649,9 @@ module Aws::BedrockRuntime
611
649
  :tool_config,
612
650
  :guardrail_config,
613
651
  :additional_model_request_fields,
652
+ :prompt_variables,
614
653
  :additional_model_response_field_paths)
615
- SENSITIVE = []
654
+ SENSITIVE = [:prompt_variables]
616
655
  include Aws::Structure
617
656
  end
618
657
 
@@ -1854,6 +1893,34 @@ module Aws::BedrockRuntime
1854
1893
  include Aws::Structure
1855
1894
  end
1856
1895
 
1896
+ # Contains a map of variables in a prompt from Prompt management to an
1897
+ # object containing the values to fill in for them when running model
1898
+ # invocation. For more information, see [How Prompt management
1899
+ # works][1].
1900
+ #
1901
+ #
1902
+ #
1903
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-how.html
1904
+ #
1905
+ # @note PromptVariableValues is a union - when making an API calls you must set exactly one of the members.
1906
+ #
1907
+ # @!attribute [rw] text
1908
+ # The text value that the variable maps to.
1909
+ # @return [String]
1910
+ #
1911
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/PromptVariableValues AWS API Documentation
1912
+ #
1913
+ class PromptVariableValues < Struct.new(
1914
+ :text,
1915
+ :unknown)
1916
+ SENSITIVE = []
1917
+ include Aws::Structure
1918
+ include Aws::Structure::Union
1919
+
1920
+ class Text < PromptVariableValues; end
1921
+ class Unknown < PromptVariableValues; end
1922
+ end
1923
+
1857
1924
  # The specified resource ARN was not found. Check the ARN and try your
1858
1925
  # request again.
1859
1926
  #
@@ -56,7 +56,7 @@ module Aws::BedrockRuntime
56
56
  autoload :Endpoints, 'aws-sdk-bedrockruntime/endpoints'
57
57
  autoload :EventStreams, 'aws-sdk-bedrockruntime/event_streams'
58
58
 
59
- GEM_VERSION = '1.30.0'
59
+ GEM_VERSION = '1.31.0'
60
60
 
61
61
  end
62
62
 
data/sig/client.rbs CHANGED
@@ -114,7 +114,7 @@ module Aws
114
114
  # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/BedrockRuntime/Client.html#converse-instance_method
115
115
  def converse: (
116
116
  model_id: ::String,
117
- messages: Array[
117
+ ?messages: Array[
118
118
  {
119
119
  role: ("user" | "assistant"),
120
120
  content: Array[
@@ -220,6 +220,9 @@ module Aws
220
220
  },
221
221
  ?additional_model_request_fields: {
222
222
  },
223
+ ?prompt_variables: Hash[::String, {
224
+ text: ::String?
225
+ }],
223
226
  ?additional_model_response_field_paths: Array[::String]
224
227
  ) -> _ConverseResponseSuccess
225
228
  | (Hash[Symbol, untyped] params, ?Hash[Symbol, untyped] options) -> _ConverseResponseSuccess
@@ -231,7 +234,7 @@ module Aws
231
234
  # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/BedrockRuntime/Client.html#converse_stream-instance_method
232
235
  def converse_stream: (
233
236
  model_id: ::String,
234
- messages: Array[
237
+ ?messages: Array[
235
238
  {
236
239
  role: ("user" | "assistant"),
237
240
  content: Array[
@@ -338,6 +341,9 @@ module Aws
338
341
  },
339
342
  ?additional_model_request_fields: {
340
343
  },
344
+ ?prompt_variables: Hash[::String, {
345
+ text: ::String?
346
+ }],
341
347
  ?additional_model_response_field_paths: Array[::String]
342
348
  ) ?{ (*untyped) -> void } -> _ConverseStreamResponseSuccess
343
349
  | (Hash[Symbol, untyped] params, ?Hash[Symbol, untyped] options) ?{ (*untyped) -> void } -> _ConverseStreamResponseSuccess
@@ -349,7 +355,7 @@ module Aws
349
355
  end
350
356
  # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/BedrockRuntime/Client.html#invoke_model-instance_method
351
357
  def invoke_model: (
352
- body: ::String,
358
+ ?body: ::String,
353
359
  ?content_type: ::String,
354
360
  ?accept: ::String,
355
361
  model_id: ::String,
@@ -366,7 +372,7 @@ module Aws
366
372
  end
367
373
  # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/BedrockRuntime/Client.html#invoke_model_with_response_stream-instance_method
368
374
  def invoke_model_with_response_stream: (
369
- body: ::String,
375
+ ?body: ::String,
370
376
  ?content_type: ::String,
371
377
  ?accept: ::String,
372
378
  model_id: ::String,
data/sig/types.rbs CHANGED
@@ -131,8 +131,9 @@ module Aws::BedrockRuntime
131
131
  attr_accessor tool_config: Types::ToolConfiguration
132
132
  attr_accessor guardrail_config: Types::GuardrailConfiguration
133
133
  attr_accessor additional_model_request_fields: untyped
134
+ attr_accessor prompt_variables: ::Hash[::String, Types::PromptVariableValues]
134
135
  attr_accessor additional_model_response_field_paths: ::Array[::String]
135
- SENSITIVE: []
136
+ SENSITIVE: [:prompt_variables]
136
137
  end
137
138
 
138
139
  class ConverseResponse
@@ -166,8 +167,9 @@ module Aws::BedrockRuntime
166
167
  attr_accessor tool_config: Types::ToolConfiguration
167
168
  attr_accessor guardrail_config: Types::GuardrailStreamConfiguration
168
169
  attr_accessor additional_model_request_fields: untyped
170
+ attr_accessor prompt_variables: ::Hash[::String, Types::PromptVariableValues]
169
171
  attr_accessor additional_model_response_field_paths: ::Array[::String]
170
- SENSITIVE: []
172
+ SENSITIVE: [:prompt_variables]
171
173
  end
172
174
 
173
175
  class ConverseStreamResponse
@@ -496,6 +498,17 @@ module Aws::BedrockRuntime
496
498
  SENSITIVE: [:bytes]
497
499
  end
498
500
 
501
+ class PromptVariableValues
502
+ attr_accessor text: ::String
503
+ attr_accessor unknown: untyped
504
+ SENSITIVE: []
505
+
506
+ class Text < PromptVariableValues
507
+ end
508
+ class Unknown < PromptVariableValues
509
+ end
510
+ end
511
+
499
512
  class ResourceNotFoundException
500
513
  attr_accessor message: ::String
501
514
  SENSITIVE: []
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-bedrockruntime
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.30.0
4
+ version: 1.31.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-11-06 00:00:00.000000000 Z
11
+ date: 2024-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core