aws-sdk-bedrockruntime 1.63.0 → 1.71.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.
@@ -27,6 +27,22 @@ Aws::Plugins::GlobalConfiguration.add_identifier(:bedrockruntime)
27
27
  #
28
28
  # See {Client} for more information.
29
29
  #
30
+ # # Async Client
31
+ #
32
+ # The {AsyncClient} class provides one asynchronous method for each API operation.
33
+ # Operation methods each accept a hash of request parameters and return an async
34
+ # response. For streaming operations, you can signal input events and register
35
+ # output event callbacks before waiting on the response.
36
+ #
37
+ # bedrock_runtime = Aws::BedrockRuntime::AsyncClient.new
38
+ # resp = bedrock_runtime.apply_guardrail(
39
+ # # params and input stream
40
+ # ) do |output_stream|
41
+ # # register callbacks for events
42
+ # end
43
+ #
44
+ # See {AsyncClient} for more information.
45
+ #
30
46
  # # Errors
31
47
  #
32
48
  # Errors returned from Amazon Bedrock Runtime are defined in the
@@ -57,7 +73,7 @@ module Aws::BedrockRuntime
57
73
  autoload :AsyncClient, 'aws-sdk-bedrockruntime/async_client'
58
74
  autoload :EventStreams, 'aws-sdk-bedrockruntime/event_streams'
59
75
 
60
- GEM_VERSION = '1.63.0'
76
+ GEM_VERSION = '1.71.0'
61
77
 
62
78
  end
63
79
 
data/sig/client.rbs CHANGED
@@ -116,12 +116,13 @@ module Aws
116
116
  interface _ConverseResponseSuccess
117
117
  include ::Seahorse::Client::_ResponseSuccess[Types::ConverseResponse]
118
118
  def output: () -> Types::ConverseOutput
119
- def stop_reason: () -> ("end_turn" | "tool_use" | "max_tokens" | "stop_sequence" | "guardrail_intervened" | "content_filtered" | "model_context_window_exceeded")
119
+ def stop_reason: () -> ("end_turn" | "tool_use" | "max_tokens" | "stop_sequence" | "guardrail_intervened" | "content_filtered" | "malformed_model_output" | "malformed_tool_use" | "model_context_window_exceeded")
120
120
  def usage: () -> Types::TokenUsage
121
121
  def metrics: () -> Types::ConverseMetrics
122
122
  def additional_model_response_fields: () -> untyped
123
123
  def trace: () -> Types::ConverseTrace
124
124
  def performance_config: () -> Types::PerformanceConfiguration
125
+ def service_tier: () -> Types::ServiceTier
125
126
  end
126
127
  # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/BedrockRuntime/Client.html#converse-instance_method
127
128
  def converse: (
@@ -140,7 +141,10 @@ module Aws
140
141
  uri: ::String,
141
142
  bucket_owner: ::String?
142
143
  }?
143
- }
144
+ },
145
+ error: {
146
+ message: ::String?
147
+ }?
144
148
  }?,
145
149
  document: {
146
150
  format: ("pdf" | "csv" | "doc" | "docx" | "xls" | "xlsx" | "html" | "txt" | "md")?,
@@ -173,6 +177,19 @@ module Aws
173
177
  }?
174
178
  }
175
179
  }?,
180
+ audio: {
181
+ format: ("mp3" | "opus" | "wav" | "aac" | "flac" | "mp4" | "ogg" | "mkv" | "mka" | "x-aac" | "m4a" | "mpeg" | "mpga" | "pcm" | "webm"),
182
+ source: {
183
+ bytes: ::String?,
184
+ s3_location: {
185
+ uri: ::String,
186
+ bucket_owner: ::String?
187
+ }?
188
+ },
189
+ error: {
190
+ message: ::String?
191
+ }?
192
+ }?,
176
193
  tool_use: {
177
194
  tool_use_id: ::String,
178
195
  name: ::String,
@@ -195,7 +212,10 @@ module Aws
195
212
  uri: ::String,
196
213
  bucket_owner: ::String?
197
214
  }?
198
- }
215
+ },
216
+ error: {
217
+ message: ::String?
218
+ }?
199
219
  }?,
200
220
  document: {
201
221
  format: ("pdf" | "csv" | "doc" | "docx" | "xls" | "xlsx" | "html" | "txt" | "md")?,
@@ -227,6 +247,18 @@ module Aws
227
247
  bucket_owner: ::String?
228
248
  }?
229
249
  }
250
+ }?,
251
+ search_result: {
252
+ source: ::String,
253
+ title: ::String,
254
+ content: Array[
255
+ {
256
+ text: ::String
257
+ },
258
+ ],
259
+ citations: {
260
+ enabled: bool
261
+ }?
230
262
  }?
231
263
  },
232
264
  ],
@@ -264,6 +296,7 @@ module Aws
264
296
  citations: Array[
265
297
  {
266
298
  title: ::String?,
299
+ source: ::String?,
267
300
  source_content: Array[
268
301
  {
269
302
  text: ::String?
@@ -288,10 +321,27 @@ module Aws
288
321
  document_index: ::Integer?,
289
322
  start: ::Integer?,
290
323
  end: ::Integer?
324
+ }?,
325
+ search_result_location: {
326
+ search_result_index: ::Integer?,
327
+ start: ::Integer?,
328
+ end: ::Integer?
291
329
  }?
292
330
  }?
293
331
  },
294
332
  ]?
333
+ }?,
334
+ search_result: {
335
+ source: ::String,
336
+ title: ::String,
337
+ content: Array[
338
+ {
339
+ text: ::String
340
+ },
341
+ ],
342
+ citations: {
343
+ enabled: bool
344
+ }?
295
345
  }?
296
346
  },
297
347
  ]
@@ -353,8 +403,8 @@ module Aws
353
403
  }?
354
404
  },
355
405
  ?guardrail_config: {
356
- guardrail_identifier: ::String,
357
- guardrail_version: ::String,
406
+ guardrail_identifier: ::String?,
407
+ guardrail_version: ::String?,
358
408
  trace: ("enabled" | "disabled" | "enabled_full")?
359
409
  },
360
410
  ?additional_model_request_fields: {
@@ -366,6 +416,9 @@ module Aws
366
416
  ?request_metadata: Hash[::String, ::String],
367
417
  ?performance_config: {
368
418
  latency: ("standard" | "optimized")?
419
+ },
420
+ ?service_tier: {
421
+ type: ("priority" | "default" | "flex" | "reserved")
369
422
  }
370
423
  ) -> _ConverseResponseSuccess
371
424
  | (Hash[Symbol, untyped] params, ?Hash[Symbol, untyped] options) -> _ConverseResponseSuccess
@@ -391,7 +444,10 @@ module Aws
391
444
  uri: ::String,
392
445
  bucket_owner: ::String?
393
446
  }?
394
- }
447
+ },
448
+ error: {
449
+ message: ::String?
450
+ }?
395
451
  }?,
396
452
  document: {
397
453
  format: ("pdf" | "csv" | "doc" | "docx" | "xls" | "xlsx" | "html" | "txt" | "md")?,
@@ -424,6 +480,19 @@ module Aws
424
480
  }?
425
481
  }
426
482
  }?,
483
+ audio: {
484
+ format: ("mp3" | "opus" | "wav" | "aac" | "flac" | "mp4" | "ogg" | "mkv" | "mka" | "x-aac" | "m4a" | "mpeg" | "mpga" | "pcm" | "webm"),
485
+ source: {
486
+ bytes: ::String?,
487
+ s3_location: {
488
+ uri: ::String,
489
+ bucket_owner: ::String?
490
+ }?
491
+ },
492
+ error: {
493
+ message: ::String?
494
+ }?
495
+ }?,
427
496
  tool_use: {
428
497
  tool_use_id: ::String,
429
498
  name: ::String,
@@ -446,7 +515,10 @@ module Aws
446
515
  uri: ::String,
447
516
  bucket_owner: ::String?
448
517
  }?
449
- }
518
+ },
519
+ error: {
520
+ message: ::String?
521
+ }?
450
522
  }?,
451
523
  document: {
452
524
  format: ("pdf" | "csv" | "doc" | "docx" | "xls" | "xlsx" | "html" | "txt" | "md")?,
@@ -478,6 +550,18 @@ module Aws
478
550
  bucket_owner: ::String?
479
551
  }?
480
552
  }
553
+ }?,
554
+ search_result: {
555
+ source: ::String,
556
+ title: ::String,
557
+ content: Array[
558
+ {
559
+ text: ::String
560
+ },
561
+ ],
562
+ citations: {
563
+ enabled: bool
564
+ }?
481
565
  }?
482
566
  },
483
567
  ],
@@ -515,6 +599,7 @@ module Aws
515
599
  citations: Array[
516
600
  {
517
601
  title: ::String?,
602
+ source: ::String?,
518
603
  source_content: Array[
519
604
  {
520
605
  text: ::String?
@@ -539,10 +624,27 @@ module Aws
539
624
  document_index: ::Integer?,
540
625
  start: ::Integer?,
541
626
  end: ::Integer?
627
+ }?,
628
+ search_result_location: {
629
+ search_result_index: ::Integer?,
630
+ start: ::Integer?,
631
+ end: ::Integer?
542
632
  }?
543
633
  }?
544
634
  },
545
635
  ]?
636
+ }?,
637
+ search_result: {
638
+ source: ::String,
639
+ title: ::String,
640
+ content: Array[
641
+ {
642
+ text: ::String
643
+ },
644
+ ],
645
+ citations: {
646
+ enabled: bool
647
+ }?
546
648
  }?
547
649
  },
548
650
  ]
@@ -604,8 +706,8 @@ module Aws
604
706
  }?
605
707
  },
606
708
  ?guardrail_config: {
607
- guardrail_identifier: ::String,
608
- guardrail_version: ::String,
709
+ guardrail_identifier: ::String?,
710
+ guardrail_version: ::String?,
609
711
  trace: ("enabled" | "disabled" | "enabled_full")?,
610
712
  stream_processing_mode: ("sync" | "async")?
611
713
  },
@@ -618,6 +720,9 @@ module Aws
618
720
  ?request_metadata: Hash[::String, ::String],
619
721
  ?performance_config: {
620
722
  latency: ("standard" | "optimized")?
723
+ },
724
+ ?service_tier: {
725
+ type: ("priority" | "default" | "flex" | "reserved")
621
726
  }
622
727
  ) ?{ (*untyped) -> void } -> _ConverseStreamResponseSuccess
623
728
  | (Hash[Symbol, untyped] params, ?Hash[Symbol, untyped] options) ?{ (*untyped) -> void } -> _ConverseStreamResponseSuccess
@@ -648,7 +753,10 @@ module Aws
648
753
  uri: ::String,
649
754
  bucket_owner: ::String?
650
755
  }?
651
- }
756
+ },
757
+ error: {
758
+ message: ::String?
759
+ }?
652
760
  }?,
653
761
  document: {
654
762
  format: ("pdf" | "csv" | "doc" | "docx" | "xls" | "xlsx" | "html" | "txt" | "md")?,
@@ -681,6 +789,19 @@ module Aws
681
789
  }?
682
790
  }
683
791
  }?,
792
+ audio: {
793
+ format: ("mp3" | "opus" | "wav" | "aac" | "flac" | "mp4" | "ogg" | "mkv" | "mka" | "x-aac" | "m4a" | "mpeg" | "mpga" | "pcm" | "webm"),
794
+ source: {
795
+ bytes: ::String?,
796
+ s3_location: {
797
+ uri: ::String,
798
+ bucket_owner: ::String?
799
+ }?
800
+ },
801
+ error: {
802
+ message: ::String?
803
+ }?
804
+ }?,
684
805
  tool_use: {
685
806
  tool_use_id: ::String,
686
807
  name: ::String,
@@ -703,7 +824,10 @@ module Aws
703
824
  uri: ::String,
704
825
  bucket_owner: ::String?
705
826
  }?
706
- }
827
+ },
828
+ error: {
829
+ message: ::String?
830
+ }?
707
831
  }?,
708
832
  document: {
709
833
  format: ("pdf" | "csv" | "doc" | "docx" | "xls" | "xlsx" | "html" | "txt" | "md")?,
@@ -735,6 +859,18 @@ module Aws
735
859
  bucket_owner: ::String?
736
860
  }?
737
861
  }
862
+ }?,
863
+ search_result: {
864
+ source: ::String,
865
+ title: ::String,
866
+ content: Array[
867
+ {
868
+ text: ::String
869
+ },
870
+ ],
871
+ citations: {
872
+ enabled: bool
873
+ }?
738
874
  }?
739
875
  },
740
876
  ],
@@ -772,6 +908,7 @@ module Aws
772
908
  citations: Array[
773
909
  {
774
910
  title: ::String?,
911
+ source: ::String?,
775
912
  source_content: Array[
776
913
  {
777
914
  text: ::String?
@@ -796,10 +933,27 @@ module Aws
796
933
  document_index: ::Integer?,
797
934
  start: ::Integer?,
798
935
  end: ::Integer?
936
+ }?,
937
+ search_result_location: {
938
+ search_result_index: ::Integer?,
939
+ start: ::Integer?,
940
+ end: ::Integer?
799
941
  }?
800
942
  }?
801
943
  },
802
944
  ]?
945
+ }?,
946
+ search_result: {
947
+ source: ::String,
948
+ title: ::String,
949
+ content: Array[
950
+ {
951
+ text: ::String
952
+ },
953
+ ],
954
+ citations: {
955
+ enabled: bool
956
+ }?
803
957
  }?
804
958
  },
805
959
  ]
@@ -824,7 +978,38 @@ module Aws
824
978
  type: ("default")
825
979
  }?
826
980
  },
827
- ]?
981
+ ]?,
982
+ tool_config: {
983
+ tools: Array[
984
+ {
985
+ tool_spec: {
986
+ name: ::String,
987
+ description: ::String?,
988
+ input_schema: {
989
+ json: {
990
+ }?
991
+ }
992
+ }?,
993
+ system_tool: {
994
+ name: ::String
995
+ }?,
996
+ cache_point: {
997
+ type: ("default")
998
+ }?
999
+ },
1000
+ ],
1001
+ tool_choice: {
1002
+ auto: {
1003
+ }?,
1004
+ any: {
1005
+ }?,
1006
+ tool: {
1007
+ name: ::String
1008
+ }?
1009
+ }?
1010
+ }?,
1011
+ additional_model_request_fields: {
1012
+ }?
828
1013
  }?
829
1014
  }
830
1015
  ) -> _CountTokensResponseSuccess
@@ -853,6 +1038,7 @@ module Aws
853
1038
  def body: () -> ::String
854
1039
  def content_type: () -> ::String
855
1040
  def performance_config_latency: () -> ("standard" | "optimized")
1041
+ def service_tier: () -> ("priority" | "default" | "flex" | "reserved")
856
1042
  end
857
1043
  # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/BedrockRuntime/Client.html#invoke_model-instance_method
858
1044
  def invoke_model: (
@@ -863,7 +1049,8 @@ module Aws
863
1049
  ?trace: ("ENABLED" | "DISABLED" | "ENABLED_FULL"),
864
1050
  ?guardrail_identifier: ::String,
865
1051
  ?guardrail_version: ::String,
866
- ?performance_config_latency: ("standard" | "optimized")
1052
+ ?performance_config_latency: ("standard" | "optimized"),
1053
+ ?service_tier: ("priority" | "default" | "flex" | "reserved")
867
1054
  ) -> _InvokeModelResponseSuccess
868
1055
  | (Hash[Symbol, untyped] params, ?Hash[Symbol, untyped] options) -> _InvokeModelResponseSuccess
869
1056
 
@@ -872,6 +1059,7 @@ module Aws
872
1059
  def body: () -> Types::ResponseStream
873
1060
  def content_type: () -> ::String
874
1061
  def performance_config_latency: () -> ("standard" | "optimized")
1062
+ def service_tier: () -> ("priority" | "default" | "flex" | "reserved")
875
1063
  end
876
1064
  # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/BedrockRuntime/Client.html#invoke_model_with_response_stream-instance_method
877
1065
  def invoke_model_with_response_stream: (
@@ -882,7 +1070,8 @@ module Aws
882
1070
  ?trace: ("ENABLED" | "DISABLED" | "ENABLED_FULL"),
883
1071
  ?guardrail_identifier: ::String,
884
1072
  ?guardrail_version: ::String,
885
- ?performance_config_latency: ("standard" | "optimized")
1073
+ ?performance_config_latency: ("standard" | "optimized"),
1074
+ ?service_tier: ("priority" | "default" | "flex" | "reserved")
886
1075
  ) ?{ (*untyped) -> void } -> _InvokeModelWithResponseStreamResponseSuccess
887
1076
  | (Hash[Symbol, untyped] params, ?Hash[Symbol, untyped] options) ?{ (*untyped) -> void } -> _InvokeModelWithResponseStreamResponseSuccess
888
1077