aws-sdk-bedrockruntime 1.43.0 → 1.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-bedrockruntime/async_client.rb +626 -0
- data/lib/aws-sdk-bedrockruntime/client.rb +41 -1
- data/lib/aws-sdk-bedrockruntime/client_api.rb +64 -4
- data/lib/aws-sdk-bedrockruntime/event_streams.rb +87 -0
- data/lib/aws-sdk-bedrockruntime/types.rb +147 -2
- data/lib/aws-sdk-bedrockruntime.rb +2 -1
- data/sig/client.rbs +51 -8
- data/sig/types.rbs +37 -0
- metadata +3 -2
@@ -818,6 +818,10 @@ module Aws::BedrockRuntime
|
|
818
818
|
# format: "png", # required, accepts png, jpeg, gif, webp
|
819
819
|
# source: { # required
|
820
820
|
# bytes: "data",
|
821
|
+
# s3_location: {
|
822
|
+
# uri: "S3Uri", # required
|
823
|
+
# bucket_owner: "AccountId",
|
824
|
+
# },
|
821
825
|
# },
|
822
826
|
# },
|
823
827
|
# document: {
|
@@ -825,6 +829,10 @@ module Aws::BedrockRuntime
|
|
825
829
|
# name: "DocumentBlockNameString", # required
|
826
830
|
# source: { # required
|
827
831
|
# bytes: "data",
|
832
|
+
# s3_location: {
|
833
|
+
# uri: "S3Uri", # required
|
834
|
+
# bucket_owner: "AccountId",
|
835
|
+
# },
|
828
836
|
# },
|
829
837
|
# },
|
830
838
|
# video: {
|
@@ -854,6 +862,10 @@ module Aws::BedrockRuntime
|
|
854
862
|
# format: "png", # required, accepts png, jpeg, gif, webp
|
855
863
|
# source: { # required
|
856
864
|
# bytes: "data",
|
865
|
+
# s3_location: {
|
866
|
+
# uri: "S3Uri", # required
|
867
|
+
# bucket_owner: "AccountId",
|
868
|
+
# },
|
857
869
|
# },
|
858
870
|
# },
|
859
871
|
# document: {
|
@@ -861,6 +873,10 @@ module Aws::BedrockRuntime
|
|
861
873
|
# name: "DocumentBlockNameString", # required
|
862
874
|
# source: { # required
|
863
875
|
# bytes: "data",
|
876
|
+
# s3_location: {
|
877
|
+
# uri: "S3Uri", # required
|
878
|
+
# bucket_owner: "AccountId",
|
879
|
+
# },
|
864
880
|
# },
|
865
881
|
# },
|
866
882
|
# video: {
|
@@ -983,9 +999,13 @@ module Aws::BedrockRuntime
|
|
983
999
|
# resp.output.message.content[0].text #=> String
|
984
1000
|
# resp.output.message.content[0].image.format #=> String, one of "png", "jpeg", "gif", "webp"
|
985
1001
|
# resp.output.message.content[0].image.source.bytes #=> String
|
1002
|
+
# resp.output.message.content[0].image.source.s3_location.uri #=> String
|
1003
|
+
# resp.output.message.content[0].image.source.s3_location.bucket_owner #=> String
|
986
1004
|
# resp.output.message.content[0].document.format #=> String, one of "pdf", "csv", "doc", "docx", "xls", "xlsx", "html", "txt", "md"
|
987
1005
|
# resp.output.message.content[0].document.name #=> String
|
988
1006
|
# resp.output.message.content[0].document.source.bytes #=> String
|
1007
|
+
# resp.output.message.content[0].document.source.s3_location.uri #=> String
|
1008
|
+
# resp.output.message.content[0].document.source.s3_location.bucket_owner #=> String
|
989
1009
|
# resp.output.message.content[0].video.format #=> String, one of "mkv", "mov", "mp4", "webm", "flv", "mpeg", "mpg", "wmv", "three_gp"
|
990
1010
|
# resp.output.message.content[0].video.source.bytes #=> String
|
991
1011
|
# resp.output.message.content[0].video.source.s3_location.uri #=> String
|
@@ -997,9 +1017,13 @@ module Aws::BedrockRuntime
|
|
997
1017
|
# resp.output.message.content[0].tool_result.content[0].text #=> String
|
998
1018
|
# resp.output.message.content[0].tool_result.content[0].image.format #=> String, one of "png", "jpeg", "gif", "webp"
|
999
1019
|
# resp.output.message.content[0].tool_result.content[0].image.source.bytes #=> String
|
1020
|
+
# resp.output.message.content[0].tool_result.content[0].image.source.s3_location.uri #=> String
|
1021
|
+
# resp.output.message.content[0].tool_result.content[0].image.source.s3_location.bucket_owner #=> String
|
1000
1022
|
# resp.output.message.content[0].tool_result.content[0].document.format #=> String, one of "pdf", "csv", "doc", "docx", "xls", "xlsx", "html", "txt", "md"
|
1001
1023
|
# resp.output.message.content[0].tool_result.content[0].document.name #=> String
|
1002
1024
|
# resp.output.message.content[0].tool_result.content[0].document.source.bytes #=> String
|
1025
|
+
# resp.output.message.content[0].tool_result.content[0].document.source.s3_location.uri #=> String
|
1026
|
+
# resp.output.message.content[0].tool_result.content[0].document.source.s3_location.bucket_owner #=> String
|
1003
1027
|
# resp.output.message.content[0].tool_result.content[0].video.format #=> String, one of "mkv", "mov", "mp4", "webm", "flv", "mpeg", "mpg", "wmv", "three_gp"
|
1004
1028
|
# resp.output.message.content[0].tool_result.content[0].video.source.bytes #=> String
|
1005
1029
|
# resp.output.message.content[0].tool_result.content[0].video.source.s3_location.uri #=> String
|
@@ -1511,6 +1535,10 @@ module Aws::BedrockRuntime
|
|
1511
1535
|
# format: "png", # required, accepts png, jpeg, gif, webp
|
1512
1536
|
# source: { # required
|
1513
1537
|
# bytes: "data",
|
1538
|
+
# s3_location: {
|
1539
|
+
# uri: "S3Uri", # required
|
1540
|
+
# bucket_owner: "AccountId",
|
1541
|
+
# },
|
1514
1542
|
# },
|
1515
1543
|
# },
|
1516
1544
|
# document: {
|
@@ -1518,6 +1546,10 @@ module Aws::BedrockRuntime
|
|
1518
1546
|
# name: "DocumentBlockNameString", # required
|
1519
1547
|
# source: { # required
|
1520
1548
|
# bytes: "data",
|
1549
|
+
# s3_location: {
|
1550
|
+
# uri: "S3Uri", # required
|
1551
|
+
# bucket_owner: "AccountId",
|
1552
|
+
# },
|
1521
1553
|
# },
|
1522
1554
|
# },
|
1523
1555
|
# video: {
|
@@ -1547,6 +1579,10 @@ module Aws::BedrockRuntime
|
|
1547
1579
|
# format: "png", # required, accepts png, jpeg, gif, webp
|
1548
1580
|
# source: { # required
|
1549
1581
|
# bytes: "data",
|
1582
|
+
# s3_location: {
|
1583
|
+
# uri: "S3Uri", # required
|
1584
|
+
# bucket_owner: "AccountId",
|
1585
|
+
# },
|
1550
1586
|
# },
|
1551
1587
|
# },
|
1552
1588
|
# document: {
|
@@ -1554,6 +1590,10 @@ module Aws::BedrockRuntime
|
|
1554
1590
|
# name: "DocumentBlockNameString", # required
|
1555
1591
|
# source: { # required
|
1556
1592
|
# bytes: "data",
|
1593
|
+
# s3_location: {
|
1594
|
+
# uri: "S3Uri", # required
|
1595
|
+
# bucket_owner: "AccountId",
|
1596
|
+
# },
|
1557
1597
|
# },
|
1558
1598
|
# },
|
1559
1599
|
# video: {
|
@@ -2548,7 +2588,7 @@ module Aws::BedrockRuntime
|
|
2548
2588
|
tracer: tracer
|
2549
2589
|
)
|
2550
2590
|
context[:gem_name] = 'aws-sdk-bedrockruntime'
|
2551
|
-
context[:gem_version] = '1.
|
2591
|
+
context[:gem_version] = '1.45.0'
|
2552
2592
|
Seahorse::Client::Request.new(handlers, context)
|
2553
2593
|
end
|
2554
2594
|
|
@@ -29,6 +29,8 @@ module Aws::BedrockRuntime
|
|
29
29
|
AsyncInvokeSummaries = Shapes::ListShape.new(name: 'AsyncInvokeSummaries')
|
30
30
|
AsyncInvokeSummary = Shapes::StructureShape.new(name: 'AsyncInvokeSummary')
|
31
31
|
AutoToolChoice = Shapes::StructureShape.new(name: 'AutoToolChoice')
|
32
|
+
BidirectionalInputPayloadPart = Shapes::StructureShape.new(name: 'BidirectionalInputPayloadPart')
|
33
|
+
BidirectionalOutputPayloadPart = Shapes::StructureShape.new(name: 'BidirectionalOutputPayloadPart')
|
32
34
|
Blob = Shapes::BlobShape.new(name: 'Blob')
|
33
35
|
Body = Shapes::BlobShape.new(name: 'Body')
|
34
36
|
Boolean = Shapes::BooleanShape.new(name: 'Boolean')
|
@@ -163,6 +165,10 @@ module Aws::BedrockRuntime
|
|
163
165
|
InvokeModelIdentifier = Shapes::StringShape.new(name: 'InvokeModelIdentifier')
|
164
166
|
InvokeModelRequest = Shapes::StructureShape.new(name: 'InvokeModelRequest')
|
165
167
|
InvokeModelResponse = Shapes::StructureShape.new(name: 'InvokeModelResponse')
|
168
|
+
InvokeModelWithBidirectionalStreamInput = Shapes::StructureShape.new(name: 'InvokeModelWithBidirectionalStreamInput')
|
169
|
+
InvokeModelWithBidirectionalStreamOutput = Shapes::StructureShape.new(name: 'InvokeModelWithBidirectionalStreamOutput')
|
170
|
+
InvokeModelWithBidirectionalStreamRequest = Shapes::StructureShape.new(name: 'InvokeModelWithBidirectionalStreamRequest')
|
171
|
+
InvokeModelWithBidirectionalStreamResponse = Shapes::StructureShape.new(name: 'InvokeModelWithBidirectionalStreamResponse')
|
166
172
|
InvokeModelWithResponseStreamRequest = Shapes::StructureShape.new(name: 'InvokeModelWithResponseStreamRequest')
|
167
173
|
InvokeModelWithResponseStreamResponse = Shapes::StructureShape.new(name: 'InvokeModelWithResponseStreamResponse')
|
168
174
|
InvokedModelId = Shapes::StringShape.new(name: 'InvokedModelId')
|
@@ -297,6 +303,12 @@ module Aws::BedrockRuntime
|
|
297
303
|
|
298
304
|
AutoToolChoice.struct_class = Types::AutoToolChoice
|
299
305
|
|
306
|
+
BidirectionalInputPayloadPart.add_member(:bytes, Shapes::ShapeRef.new(shape: PartBody, location_name: "bytes"))
|
307
|
+
BidirectionalInputPayloadPart.struct_class = Types::BidirectionalInputPayloadPart
|
308
|
+
|
309
|
+
BidirectionalOutputPayloadPart.add_member(:bytes, Shapes::ShapeRef.new(shape: PartBody, location_name: "bytes"))
|
310
|
+
BidirectionalOutputPayloadPart.struct_class = Types::BidirectionalOutputPayloadPart
|
311
|
+
|
300
312
|
CachePointBlock.add_member(:type, Shapes::ShapeRef.new(shape: CachePointType, required: true, location_name: "type"))
|
301
313
|
CachePointBlock.struct_class = Types::CachePointBlock
|
302
314
|
|
@@ -443,8 +455,10 @@ module Aws::BedrockRuntime
|
|
443
455
|
DocumentBlock.struct_class = Types::DocumentBlock
|
444
456
|
|
445
457
|
DocumentSource.add_member(:bytes, Shapes::ShapeRef.new(shape: DocumentSourceBytesBlob, location_name: "bytes"))
|
458
|
+
DocumentSource.add_member(:s3_location, Shapes::ShapeRef.new(shape: S3Location, location_name: "s3Location"))
|
446
459
|
DocumentSource.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
|
447
460
|
DocumentSource.add_member_subclass(:bytes, Types::DocumentSource::Bytes)
|
461
|
+
DocumentSource.add_member_subclass(:s3_location, Types::DocumentSource::S3Location)
|
448
462
|
DocumentSource.add_member_subclass(:unknown, Types::DocumentSource::Unknown)
|
449
463
|
DocumentSource.struct_class = Types::DocumentSource
|
450
464
|
|
@@ -656,8 +670,10 @@ module Aws::BedrockRuntime
|
|
656
670
|
ImageBlock.struct_class = Types::ImageBlock
|
657
671
|
|
658
672
|
ImageSource.add_member(:bytes, Shapes::ShapeRef.new(shape: ImageSourceBytesBlob, location_name: "bytes"))
|
673
|
+
ImageSource.add_member(:s3_location, Shapes::ShapeRef.new(shape: S3Location, location_name: "s3Location"))
|
659
674
|
ImageSource.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
|
660
675
|
ImageSource.add_member_subclass(:bytes, Types::ImageSource::Bytes)
|
676
|
+
ImageSource.add_member_subclass(:s3_location, Types::ImageSource::S3Location)
|
661
677
|
ImageSource.add_member_subclass(:unknown, Types::ImageSource::Unknown)
|
662
678
|
ImageSource.struct_class = Types::ImageSource
|
663
679
|
|
@@ -691,6 +707,29 @@ module Aws::BedrockRuntime
|
|
691
707
|
InvokeModelResponse[:payload] = :body
|
692
708
|
InvokeModelResponse[:payload_member] = InvokeModelResponse.member(:body)
|
693
709
|
|
710
|
+
InvokeModelWithBidirectionalStreamInput.add_member(:chunk, Shapes::ShapeRef.new(shape: BidirectionalInputPayloadPart, event: true, location_name: "chunk"))
|
711
|
+
InvokeModelWithBidirectionalStreamInput.struct_class = Types::InvokeModelWithBidirectionalStreamInput
|
712
|
+
|
713
|
+
InvokeModelWithBidirectionalStreamOutput.add_member(:chunk, Shapes::ShapeRef.new(shape: BidirectionalOutputPayloadPart, event: true, location_name: "chunk"))
|
714
|
+
InvokeModelWithBidirectionalStreamOutput.add_member(:internal_server_exception, Shapes::ShapeRef.new(shape: InternalServerException, location_name: "internalServerException"))
|
715
|
+
InvokeModelWithBidirectionalStreamOutput.add_member(:model_stream_error_exception, Shapes::ShapeRef.new(shape: ModelStreamErrorException, location_name: "modelStreamErrorException"))
|
716
|
+
InvokeModelWithBidirectionalStreamOutput.add_member(:validation_exception, Shapes::ShapeRef.new(shape: ValidationException, location_name: "validationException"))
|
717
|
+
InvokeModelWithBidirectionalStreamOutput.add_member(:throttling_exception, Shapes::ShapeRef.new(shape: ThrottlingException, location_name: "throttlingException"))
|
718
|
+
InvokeModelWithBidirectionalStreamOutput.add_member(:model_timeout_exception, Shapes::ShapeRef.new(shape: ModelTimeoutException, location_name: "modelTimeoutException"))
|
719
|
+
InvokeModelWithBidirectionalStreamOutput.add_member(:service_unavailable_exception, Shapes::ShapeRef.new(shape: ServiceUnavailableException, location_name: "serviceUnavailableException"))
|
720
|
+
InvokeModelWithBidirectionalStreamOutput.struct_class = Types::InvokeModelWithBidirectionalStreamOutput
|
721
|
+
|
722
|
+
InvokeModelWithBidirectionalStreamRequest.add_member(:model_id, Shapes::ShapeRef.new(shape: InvokeModelIdentifier, required: true, location: "uri", location_name: "modelId"))
|
723
|
+
InvokeModelWithBidirectionalStreamRequest.add_member(:body, Shapes::ShapeRef.new(shape: InvokeModelWithBidirectionalStreamInput, required: true, eventstream: true, location_name: "body"))
|
724
|
+
InvokeModelWithBidirectionalStreamRequest.struct_class = Types::InvokeModelWithBidirectionalStreamRequest
|
725
|
+
InvokeModelWithBidirectionalStreamRequest[:payload] = :body
|
726
|
+
InvokeModelWithBidirectionalStreamRequest[:payload_member] = InvokeModelWithBidirectionalStreamRequest.member(:body)
|
727
|
+
|
728
|
+
InvokeModelWithBidirectionalStreamResponse.add_member(:body, Shapes::ShapeRef.new(shape: InvokeModelWithBidirectionalStreamOutput, required: true, eventstream: true, location_name: "body"))
|
729
|
+
InvokeModelWithBidirectionalStreamResponse.struct_class = Types::InvokeModelWithBidirectionalStreamResponse
|
730
|
+
InvokeModelWithBidirectionalStreamResponse[:payload] = :body
|
731
|
+
InvokeModelWithBidirectionalStreamResponse[:payload_member] = InvokeModelWithBidirectionalStreamResponse.member(:body)
|
732
|
+
|
694
733
|
InvokeModelWithResponseStreamRequest.add_member(:body, Shapes::ShapeRef.new(shape: Body, location_name: "body"))
|
695
734
|
InvokeModelWithResponseStreamRequest.add_member(:content_type, Shapes::ShapeRef.new(shape: MimeType, location: "header", location_name: "Content-Type"))
|
696
735
|
InvokeModelWithResponseStreamRequest.add_member(:accept, Shapes::ShapeRef.new(shape: MimeType, location: "header", location_name: "X-Amzn-Bedrock-Accept"))
|
@@ -954,6 +993,7 @@ module Aws::BedrockRuntime
|
|
954
993
|
"auth" => ["aws.auth#sigv4"],
|
955
994
|
"endpointPrefix" => "bedrock-runtime",
|
956
995
|
"protocol" => "rest-json",
|
996
|
+
"protocolSettings" => {"h2"=>"optional"},
|
957
997
|
"protocols" => ["rest-json"],
|
958
998
|
"serviceFullName" => "Amazon Bedrock Runtime",
|
959
999
|
"serviceId" => "Bedrock Runtime",
|
@@ -983,8 +1023,8 @@ module Aws::BedrockRuntime
|
|
983
1023
|
o.input = Shapes::ShapeRef.new(shape: ConverseRequest)
|
984
1024
|
o.output = Shapes::ShapeRef.new(shape: ConverseResponse)
|
985
1025
|
o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
|
986
|
-
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
|
987
1026
|
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
|
1027
|
+
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
|
988
1028
|
o.errors << Shapes::ShapeRef.new(shape: ModelTimeoutException)
|
989
1029
|
o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
|
990
1030
|
o.errors << Shapes::ShapeRef.new(shape: ServiceUnavailableException)
|
@@ -1000,8 +1040,8 @@ module Aws::BedrockRuntime
|
|
1000
1040
|
o.input = Shapes::ShapeRef.new(shape: ConverseStreamRequest)
|
1001
1041
|
o.output = Shapes::ShapeRef.new(shape: ConverseStreamResponse)
|
1002
1042
|
o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
|
1003
|
-
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
|
1004
1043
|
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
|
1044
|
+
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
|
1005
1045
|
o.errors << Shapes::ShapeRef.new(shape: ModelTimeoutException)
|
1006
1046
|
o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
|
1007
1047
|
o.errors << Shapes::ShapeRef.new(shape: ServiceUnavailableException)
|
@@ -1035,9 +1075,29 @@ module Aws::BedrockRuntime
|
|
1035
1075
|
o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
|
1036
1076
|
o.errors << Shapes::ShapeRef.new(shape: ServiceUnavailableException)
|
1037
1077
|
o.errors << Shapes::ShapeRef.new(shape: ValidationException)
|
1078
|
+
o.errors << Shapes::ShapeRef.new(shape: ServiceQuotaExceededException)
|
1038
1079
|
o.errors << Shapes::ShapeRef.new(shape: ModelNotReadyException)
|
1080
|
+
o.errors << Shapes::ShapeRef.new(shape: ModelErrorException)
|
1081
|
+
end)
|
1082
|
+
|
1083
|
+
api.add_operation(:invoke_model_with_bidirectional_stream, Seahorse::Model::Operation.new.tap do |o|
|
1084
|
+
o.name = "InvokeModelWithBidirectionalStream"
|
1085
|
+
o.http_method = "POST"
|
1086
|
+
o.http_request_uri = "/model/{modelId}/invoke-with-bidirectional-stream"
|
1087
|
+
o.input = Shapes::ShapeRef.new(shape: InvokeModelWithBidirectionalStreamRequest)
|
1088
|
+
o.output = Shapes::ShapeRef.new(shape: InvokeModelWithBidirectionalStreamResponse)
|
1089
|
+
o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
|
1090
|
+
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
|
1091
|
+
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
|
1092
|
+
o.errors << Shapes::ShapeRef.new(shape: ModelTimeoutException)
|
1093
|
+
o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
|
1094
|
+
o.errors << Shapes::ShapeRef.new(shape: ServiceUnavailableException)
|
1095
|
+
o.errors << Shapes::ShapeRef.new(shape: ModelStreamErrorException)
|
1096
|
+
o.errors << Shapes::ShapeRef.new(shape: ValidationException)
|
1039
1097
|
o.errors << Shapes::ShapeRef.new(shape: ServiceQuotaExceededException)
|
1098
|
+
o.errors << Shapes::ShapeRef.new(shape: ModelNotReadyException)
|
1040
1099
|
o.errors << Shapes::ShapeRef.new(shape: ModelErrorException)
|
1100
|
+
o.async = true
|
1041
1101
|
end)
|
1042
1102
|
|
1043
1103
|
api.add_operation(:invoke_model_with_response_stream, Seahorse::Model::Operation.new.tap do |o|
|
@@ -1054,8 +1114,8 @@ module Aws::BedrockRuntime
|
|
1054
1114
|
o.errors << Shapes::ShapeRef.new(shape: ServiceUnavailableException)
|
1055
1115
|
o.errors << Shapes::ShapeRef.new(shape: ModelStreamErrorException)
|
1056
1116
|
o.errors << Shapes::ShapeRef.new(shape: ValidationException)
|
1057
|
-
o.errors << Shapes::ShapeRef.new(shape: ModelNotReadyException)
|
1058
1117
|
o.errors << Shapes::ShapeRef.new(shape: ServiceQuotaExceededException)
|
1118
|
+
o.errors << Shapes::ShapeRef.new(shape: ModelNotReadyException)
|
1059
1119
|
o.errors << Shapes::ShapeRef.new(shape: ModelErrorException)
|
1060
1120
|
end)
|
1061
1121
|
|
@@ -1084,8 +1144,8 @@ module Aws::BedrockRuntime
|
|
1084
1144
|
o.input = Shapes::ShapeRef.new(shape: StartAsyncInvokeRequest)
|
1085
1145
|
o.output = Shapes::ShapeRef.new(shape: StartAsyncInvokeResponse)
|
1086
1146
|
o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
|
1087
|
-
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
|
1088
1147
|
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
|
1148
|
+
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
|
1089
1149
|
o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
|
1090
1150
|
o.errors << Shapes::ShapeRef.new(shape: ServiceUnavailableException)
|
1091
1151
|
o.errors << Shapes::ShapeRef.new(shape: ValidationException)
|
@@ -9,6 +9,29 @@
|
|
9
9
|
|
10
10
|
module Aws::BedrockRuntime
|
11
11
|
module EventStreams
|
12
|
+
class InvokeModelWithBidirectionalStreamInput
|
13
|
+
|
14
|
+
def initialize
|
15
|
+
@event_emitter = Aws::EventEmitter.new
|
16
|
+
end
|
17
|
+
|
18
|
+
# @option params [String, StringIO, File] :bytes
|
19
|
+
# The audio content for the bidirectional input.
|
20
|
+
#
|
21
|
+
def signal_chunk_event(params = {})
|
22
|
+
@event_emitter.emit(:chunk, params)
|
23
|
+
end
|
24
|
+
|
25
|
+
def signal_end_stream
|
26
|
+
@event_emitter.emit(:end_stream, {})
|
27
|
+
end
|
28
|
+
|
29
|
+
# @api private
|
30
|
+
# @return Aws::EventEmitter
|
31
|
+
attr_reader :event_emitter
|
32
|
+
|
33
|
+
end
|
34
|
+
|
12
35
|
class ConverseStreamOutput
|
13
36
|
|
14
37
|
def initialize
|
@@ -92,6 +115,70 @@ module Aws::BedrockRuntime
|
|
92
115
|
# @return Aws::EventEmitter
|
93
116
|
attr_reader :event_emitter
|
94
117
|
|
118
|
+
end
|
119
|
+
class InvokeModelWithBidirectionalStreamOutput
|
120
|
+
|
121
|
+
def initialize
|
122
|
+
@event_emitter = Aws::EventEmitter.new
|
123
|
+
end
|
124
|
+
|
125
|
+
def on_chunk_event(&block)
|
126
|
+
@event_emitter.on(:chunk, block) if block_given?
|
127
|
+
end
|
128
|
+
|
129
|
+
def on_internal_server_exception_event(&block)
|
130
|
+
@event_emitter.on(:internal_server_exception, block) if block_given?
|
131
|
+
end
|
132
|
+
|
133
|
+
def on_model_stream_error_exception_event(&block)
|
134
|
+
@event_emitter.on(:model_stream_error_exception, block) if block_given?
|
135
|
+
end
|
136
|
+
|
137
|
+
def on_validation_exception_event(&block)
|
138
|
+
@event_emitter.on(:validation_exception, block) if block_given?
|
139
|
+
end
|
140
|
+
|
141
|
+
def on_throttling_exception_event(&block)
|
142
|
+
@event_emitter.on(:throttling_exception, block) if block_given?
|
143
|
+
end
|
144
|
+
|
145
|
+
def on_model_timeout_exception_event(&block)
|
146
|
+
@event_emitter.on(:model_timeout_exception, block) if block_given?
|
147
|
+
end
|
148
|
+
|
149
|
+
def on_service_unavailable_exception_event(&block)
|
150
|
+
@event_emitter.on(:service_unavailable_exception, block) if block_given?
|
151
|
+
end
|
152
|
+
|
153
|
+
def on_error_event(&block)
|
154
|
+
@event_emitter.on(:error, block) if block_given?
|
155
|
+
end
|
156
|
+
|
157
|
+
def on_initial_response_event(&block)
|
158
|
+
@event_emitter.on(:initial_response, block) if block_given?
|
159
|
+
end
|
160
|
+
|
161
|
+
def on_unknown_event(&block)
|
162
|
+
@event_emitter.on(:unknown_event, block) if block_given?
|
163
|
+
end
|
164
|
+
|
165
|
+
def on_event(&block)
|
166
|
+
on_chunk_event(&block)
|
167
|
+
on_internal_server_exception_event(&block)
|
168
|
+
on_model_stream_error_exception_event(&block)
|
169
|
+
on_validation_exception_event(&block)
|
170
|
+
on_throttling_exception_event(&block)
|
171
|
+
on_model_timeout_exception_event(&block)
|
172
|
+
on_service_unavailable_exception_event(&block)
|
173
|
+
on_error_event(&block)
|
174
|
+
on_initial_response_event(&block)
|
175
|
+
on_unknown_event(&block)
|
176
|
+
end
|
177
|
+
|
178
|
+
# @api private
|
179
|
+
# @return Aws::EventEmitter
|
180
|
+
attr_reader :event_emitter
|
181
|
+
|
95
182
|
end
|
96
183
|
class ResponseStream
|
97
184
|
|
@@ -225,6 +225,38 @@ module Aws::BedrockRuntime
|
|
225
225
|
#
|
226
226
|
class AutoToolChoice < Aws::EmptyStructure; end
|
227
227
|
|
228
|
+
# Payload content for the bidirectional input. The input is an audio
|
229
|
+
# stream.
|
230
|
+
#
|
231
|
+
# @!attribute [rw] bytes
|
232
|
+
# The audio content for the bidirectional input.
|
233
|
+
# @return [String]
|
234
|
+
#
|
235
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/BidirectionalInputPayloadPart AWS API Documentation
|
236
|
+
#
|
237
|
+
class BidirectionalInputPayloadPart < Struct.new(
|
238
|
+
:bytes,
|
239
|
+
:event_type)
|
240
|
+
SENSITIVE = [:bytes]
|
241
|
+
include Aws::Structure
|
242
|
+
end
|
243
|
+
|
244
|
+
# Output from the bidirectional stream. The output is speech and a text
|
245
|
+
# transcription.
|
246
|
+
#
|
247
|
+
# @!attribute [rw] bytes
|
248
|
+
# The speech output of the bidirectional stream.
|
249
|
+
# @return [String]
|
250
|
+
#
|
251
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/BidirectionalOutputPayloadPart AWS API Documentation
|
252
|
+
#
|
253
|
+
class BidirectionalOutputPayloadPart < Struct.new(
|
254
|
+
:bytes,
|
255
|
+
:event_type)
|
256
|
+
SENSITIVE = [:bytes]
|
257
|
+
include Aws::Structure
|
258
|
+
end
|
259
|
+
|
228
260
|
# Defines a section of content to be cached for reuse in subsequent API
|
229
261
|
# calls.
|
230
262
|
#
|
@@ -986,16 +1018,28 @@ module Aws::BedrockRuntime
|
|
986
1018
|
# SDK, you don't need to encode the bytes in base64.
|
987
1019
|
# @return [String]
|
988
1020
|
#
|
1021
|
+
# @!attribute [rw] s3_location
|
1022
|
+
# The location of a document object in an Amazon S3 bucket. To see
|
1023
|
+
# which models support S3 uploads, see [Supported models and features
|
1024
|
+
# for Converse][1].
|
1025
|
+
#
|
1026
|
+
#
|
1027
|
+
#
|
1028
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html
|
1029
|
+
# @return [Types::S3Location]
|
1030
|
+
#
|
989
1031
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/DocumentSource AWS API Documentation
|
990
1032
|
#
|
991
1033
|
class DocumentSource < Struct.new(
|
992
1034
|
:bytes,
|
1035
|
+
:s3_location,
|
993
1036
|
:unknown)
|
994
1037
|
SENSITIVE = []
|
995
1038
|
include Aws::Structure
|
996
1039
|
include Aws::Structure::Union
|
997
1040
|
|
998
1041
|
class Bytes < DocumentSource; end
|
1042
|
+
class S3Location < DocumentSource; end
|
999
1043
|
class Unknown < DocumentSource; end
|
1000
1044
|
end
|
1001
1045
|
|
@@ -1867,16 +1911,28 @@ module Aws::BedrockRuntime
|
|
1867
1911
|
# need to encode the image bytes in base64.
|
1868
1912
|
# @return [String]
|
1869
1913
|
#
|
1914
|
+
# @!attribute [rw] s3_location
|
1915
|
+
# The location of an image object in an Amazon S3 bucket. To see which
|
1916
|
+
# models support S3 uploads, see [Supported models and features for
|
1917
|
+
# Converse][1].
|
1918
|
+
#
|
1919
|
+
#
|
1920
|
+
#
|
1921
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html
|
1922
|
+
# @return [Types::S3Location]
|
1923
|
+
#
|
1870
1924
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/ImageSource AWS API Documentation
|
1871
1925
|
#
|
1872
1926
|
class ImageSource < Struct.new(
|
1873
1927
|
:bytes,
|
1928
|
+
:s3_location,
|
1874
1929
|
:unknown)
|
1875
1930
|
SENSITIVE = []
|
1876
1931
|
include Aws::Structure
|
1877
1932
|
include Aws::Structure::Union
|
1878
1933
|
|
1879
1934
|
class Bytes < ImageSource; end
|
1935
|
+
class S3Location < ImageSource; end
|
1880
1936
|
class Unknown < ImageSource; end
|
1881
1937
|
end
|
1882
1938
|
|
@@ -2106,6 +2162,47 @@ module Aws::BedrockRuntime
|
|
2106
2162
|
include Aws::Structure
|
2107
2163
|
end
|
2108
2164
|
|
2165
|
+
# @!attribute [rw] model_id
|
2166
|
+
# The model ID or ARN of the model ID to use. Currently, only
|
2167
|
+
# `amazon.nova-sonic-v1:0` is supported.
|
2168
|
+
# @return [String]
|
2169
|
+
#
|
2170
|
+
# @!attribute [rw] body
|
2171
|
+
# The prompt and inference parameters in the format specified in the
|
2172
|
+
# `BidirectionalInputPayloadPart` in the header. You must provide the
|
2173
|
+
# body in JSON format. To see the format and content of the request
|
2174
|
+
# and response bodies for different models, refer to [Inference
|
2175
|
+
# parameters][1]. For more information, see [Run inference][2] in the
|
2176
|
+
# Bedrock User Guide.
|
2177
|
+
#
|
2178
|
+
#
|
2179
|
+
#
|
2180
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html
|
2181
|
+
# [2]: https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html
|
2182
|
+
# @return [Types::InvokeModelWithBidirectionalStreamInput]
|
2183
|
+
#
|
2184
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModelWithBidirectionalStreamRequest AWS API Documentation
|
2185
|
+
#
|
2186
|
+
class InvokeModelWithBidirectionalStreamRequest < Struct.new(
|
2187
|
+
:model_id,
|
2188
|
+
:body)
|
2189
|
+
SENSITIVE = []
|
2190
|
+
include Aws::Structure
|
2191
|
+
end
|
2192
|
+
|
2193
|
+
# @!attribute [rw] body
|
2194
|
+
# Streaming response from the model in the format specified by the
|
2195
|
+
# `BidirectionalOutputPayloadPart` header.
|
2196
|
+
# @return [Types::InvokeModelWithBidirectionalStreamOutput]
|
2197
|
+
#
|
2198
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModelWithBidirectionalStreamResponse AWS API Documentation
|
2199
|
+
#
|
2200
|
+
class InvokeModelWithBidirectionalStreamResponse < Struct.new(
|
2201
|
+
:body)
|
2202
|
+
SENSITIVE = []
|
2203
|
+
include Aws::Structure
|
2204
|
+
end
|
2205
|
+
|
2109
2206
|
# @!attribute [rw] body
|
2110
2207
|
# The prompt and inference parameters in the format specified in the
|
2111
2208
|
# `contentType` in the header. You must provide the body in JSON
|
@@ -2639,7 +2736,7 @@ module Aws::BedrockRuntime
|
|
2639
2736
|
include Aws::Structure
|
2640
2737
|
end
|
2641
2738
|
|
2642
|
-
# A storage location in an S3 bucket.
|
2739
|
+
# A storage location in an Amazon S3 bucket.
|
2643
2740
|
#
|
2644
2741
|
# @!attribute [rw] uri
|
2645
2742
|
# An object URI starting with `s3://`.
|
@@ -3215,7 +3312,13 @@ module Aws::BedrockRuntime
|
|
3215
3312
|
# @return [String]
|
3216
3313
|
#
|
3217
3314
|
# @!attribute [rw] s3_location
|
3218
|
-
# The location of a video object in an S3 bucket.
|
3315
|
+
# The location of a video object in an Amazon S3 bucket. To see which
|
3316
|
+
# models support S3 uploads, see [Supported models and features for
|
3317
|
+
# Converse][1].
|
3318
|
+
#
|
3319
|
+
#
|
3320
|
+
#
|
3321
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html
|
3219
3322
|
# @return [Types::S3Location]
|
3220
3323
|
#
|
3221
3324
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/VideoSource AWS API Documentation
|
@@ -3260,6 +3363,48 @@ module Aws::BedrockRuntime
|
|
3260
3363
|
|
3261
3364
|
end
|
3262
3365
|
|
3366
|
+
# Payload content, the speech chunk, for the bidirectional input of the
|
3367
|
+
# invocation step.
|
3368
|
+
#
|
3369
|
+
# EventStream is an Enumerator of Events.
|
3370
|
+
# #event_types #=> Array, returns all modeled event types in the stream
|
3371
|
+
#
|
3372
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModelWithBidirectionalStreamInput AWS API Documentation
|
3373
|
+
#
|
3374
|
+
class InvokeModelWithBidirectionalStreamInput < Enumerator
|
3375
|
+
|
3376
|
+
def event_types
|
3377
|
+
[
|
3378
|
+
:chunk
|
3379
|
+
]
|
3380
|
+
end
|
3381
|
+
|
3382
|
+
end
|
3383
|
+
|
3384
|
+
# Output from the bidirectional stream that was used for model
|
3385
|
+
# invocation.
|
3386
|
+
#
|
3387
|
+
# EventStream is an Enumerator of Events.
|
3388
|
+
# #event_types #=> Array, returns all modeled event types in the stream
|
3389
|
+
#
|
3390
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModelWithBidirectionalStreamOutput AWS API Documentation
|
3391
|
+
#
|
3392
|
+
class InvokeModelWithBidirectionalStreamOutput < Enumerator
|
3393
|
+
|
3394
|
+
def event_types
|
3395
|
+
[
|
3396
|
+
:chunk,
|
3397
|
+
:internal_server_exception,
|
3398
|
+
:model_stream_error_exception,
|
3399
|
+
:validation_exception,
|
3400
|
+
:throttling_exception,
|
3401
|
+
:model_timeout_exception,
|
3402
|
+
:service_unavailable_exception
|
3403
|
+
]
|
3404
|
+
end
|
3405
|
+
|
3406
|
+
end
|
3407
|
+
|
3263
3408
|
# Definition of content in the response stream.
|
3264
3409
|
#
|
3265
3410
|
# EventStream is an Enumerator of Events.
|
@@ -54,9 +54,10 @@ module Aws::BedrockRuntime
|
|
54
54
|
autoload :EndpointParameters, 'aws-sdk-bedrockruntime/endpoint_parameters'
|
55
55
|
autoload :EndpointProvider, 'aws-sdk-bedrockruntime/endpoint_provider'
|
56
56
|
autoload :Endpoints, 'aws-sdk-bedrockruntime/endpoints'
|
57
|
+
autoload :AsyncClient, 'aws-sdk-bedrockruntime/async_client'
|
57
58
|
autoload :EventStreams, 'aws-sdk-bedrockruntime/event_streams'
|
58
59
|
|
59
|
-
GEM_VERSION = '1.
|
60
|
+
GEM_VERSION = '1.45.0'
|
60
61
|
|
61
62
|
end
|
62
63
|
|