aws-sdk-bedrockruntime 1.15.0 → 1.17.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/client.rb +156 -6
- data/lib/aws-sdk-bedrockruntime/client_api.rb +107 -1
- data/lib/aws-sdk-bedrockruntime/endpoints.rb +14 -0
- data/lib/aws-sdk-bedrockruntime/errors.rb +16 -0
- data/lib/aws-sdk-bedrockruntime/event_streams.rb +10 -0
- data/lib/aws-sdk-bedrockruntime/plugins/endpoints.rb +2 -0
- data/lib/aws-sdk-bedrockruntime/types.rb +331 -41
- data/lib/aws-sdk-bedrockruntime.rb +2 -2
- data/sig/client.rbs +31 -4
- data/sig/errors.rbs +3 -0
- data/sig/types.rbs +71 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e948bde4e28178c5d1046859bc1766ad18aab73d4b4a6a0cc251b5f4b66159fe
|
4
|
+
data.tar.gz: 96b7093be2065ceca06bf4644bea0055c4bb1048a6d8d892915f5008137f7459
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47f8582f3c4c4f78a6ce0f6272c705702df29663a6afe2fcf5d22614d470164dea10ee3aad47dbd7b9e2b0c26662ee5b02af17ac8fec2bc138f20c372158da23
|
7
|
+
data.tar.gz: 4cfdbfeddc2a7adafa369b949cfe0104c39d7cef1c08e2e1cc95bff903529ef0d037d43b40068210a6290bf55d335a32c0379360ac53a26d79202b48b983ed76
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
Unreleased Changes
|
2
2
|
------------------
|
3
3
|
|
4
|
+
1.17.0 (2024-07-25)
|
5
|
+
------------------
|
6
|
+
|
7
|
+
* Feature - Provides ServiceUnavailableException error message
|
8
|
+
|
9
|
+
1.16.0 (2024-07-10)
|
10
|
+
------------------
|
11
|
+
|
12
|
+
* Feature - Add support for contextual grounding check and ApplyGuardrail API for Guardrails for Amazon Bedrock.
|
13
|
+
|
4
14
|
1.15.0 (2024-07-02)
|
5
15
|
------------------
|
6
16
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.17.0
|
@@ -436,11 +436,102 @@ module Aws::BedrockRuntime
|
|
436
436
|
|
437
437
|
# @!group API Operations
|
438
438
|
|
439
|
+
# The action to apply a guardrail.
|
440
|
+
#
|
441
|
+
# @option params [required, String] :guardrail_identifier
|
442
|
+
# The guardrail identifier used in the request to apply the guardrail.
|
443
|
+
#
|
444
|
+
# @option params [required, String] :guardrail_version
|
445
|
+
# The guardrail version used in the request to apply the guardrail.
|
446
|
+
#
|
447
|
+
# @option params [required, String] :source
|
448
|
+
# The source of data used in the request to apply the guardrail.
|
449
|
+
#
|
450
|
+
# @option params [required, Array<Types::GuardrailContentBlock>] :content
|
451
|
+
# The content details used in the request to apply the guardrail.
|
452
|
+
#
|
453
|
+
# @return [Types::ApplyGuardrailResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
454
|
+
#
|
455
|
+
# * {Types::ApplyGuardrailResponse#usage #usage} => Types::GuardrailUsage
|
456
|
+
# * {Types::ApplyGuardrailResponse#action #action} => String
|
457
|
+
# * {Types::ApplyGuardrailResponse#outputs #outputs} => Array<Types::GuardrailOutputContent>
|
458
|
+
# * {Types::ApplyGuardrailResponse#assessments #assessments} => Array<Types::GuardrailAssessment>
|
459
|
+
#
|
460
|
+
# @example Request syntax with placeholder values
|
461
|
+
#
|
462
|
+
# resp = client.apply_guardrail({
|
463
|
+
# guardrail_identifier: "GuardrailIdentifier", # required
|
464
|
+
# guardrail_version: "GuardrailVersion", # required
|
465
|
+
# source: "INPUT", # required, accepts INPUT, OUTPUT
|
466
|
+
# content: [ # required
|
467
|
+
# {
|
468
|
+
# text: {
|
469
|
+
# text: "String", # required
|
470
|
+
# qualifiers: ["grounding_source"], # accepts grounding_source, query, guard_content
|
471
|
+
# },
|
472
|
+
# },
|
473
|
+
# ],
|
474
|
+
# })
|
475
|
+
#
|
476
|
+
# @example Response structure
|
477
|
+
#
|
478
|
+
# resp.usage.topic_policy_units #=> Integer
|
479
|
+
# resp.usage.content_policy_units #=> Integer
|
480
|
+
# resp.usage.word_policy_units #=> Integer
|
481
|
+
# resp.usage.sensitive_information_policy_units #=> Integer
|
482
|
+
# resp.usage.sensitive_information_policy_free_units #=> Integer
|
483
|
+
# resp.usage.contextual_grounding_policy_units #=> Integer
|
484
|
+
# resp.action #=> String, one of "NONE", "GUARDRAIL_INTERVENED"
|
485
|
+
# resp.outputs #=> Array
|
486
|
+
# resp.outputs[0].text #=> String
|
487
|
+
# resp.assessments #=> Array
|
488
|
+
# resp.assessments[0].topic_policy.topics #=> Array
|
489
|
+
# resp.assessments[0].topic_policy.topics[0].name #=> String
|
490
|
+
# resp.assessments[0].topic_policy.topics[0].type #=> String, one of "DENY"
|
491
|
+
# resp.assessments[0].topic_policy.topics[0].action #=> String, one of "BLOCKED"
|
492
|
+
# resp.assessments[0].content_policy.filters #=> Array
|
493
|
+
# resp.assessments[0].content_policy.filters[0].type #=> String, one of "INSULTS", "HATE", "SEXUAL", "VIOLENCE", "MISCONDUCT", "PROMPT_ATTACK"
|
494
|
+
# resp.assessments[0].content_policy.filters[0].confidence #=> String, one of "NONE", "LOW", "MEDIUM", "HIGH"
|
495
|
+
# resp.assessments[0].content_policy.filters[0].action #=> String, one of "BLOCKED"
|
496
|
+
# resp.assessments[0].word_policy.custom_words #=> Array
|
497
|
+
# resp.assessments[0].word_policy.custom_words[0].match #=> String
|
498
|
+
# resp.assessments[0].word_policy.custom_words[0].action #=> String, one of "BLOCKED"
|
499
|
+
# resp.assessments[0].word_policy.managed_word_lists #=> Array
|
500
|
+
# resp.assessments[0].word_policy.managed_word_lists[0].match #=> String
|
501
|
+
# resp.assessments[0].word_policy.managed_word_lists[0].type #=> String, one of "PROFANITY"
|
502
|
+
# resp.assessments[0].word_policy.managed_word_lists[0].action #=> String, one of "BLOCKED"
|
503
|
+
# resp.assessments[0].sensitive_information_policy.pii_entities #=> Array
|
504
|
+
# resp.assessments[0].sensitive_information_policy.pii_entities[0].match #=> String
|
505
|
+
# resp.assessments[0].sensitive_information_policy.pii_entities[0].type #=> String, one of "ADDRESS", "AGE", "AWS_ACCESS_KEY", "AWS_SECRET_KEY", "CA_HEALTH_NUMBER", "CA_SOCIAL_INSURANCE_NUMBER", "CREDIT_DEBIT_CARD_CVV", "CREDIT_DEBIT_CARD_EXPIRY", "CREDIT_DEBIT_CARD_NUMBER", "DRIVER_ID", "EMAIL", "INTERNATIONAL_BANK_ACCOUNT_NUMBER", "IP_ADDRESS", "LICENSE_PLATE", "MAC_ADDRESS", "NAME", "PASSWORD", "PHONE", "PIN", "SWIFT_CODE", "UK_NATIONAL_HEALTH_SERVICE_NUMBER", "UK_NATIONAL_INSURANCE_NUMBER", "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER", "URL", "USERNAME", "US_BANK_ACCOUNT_NUMBER", "US_BANK_ROUTING_NUMBER", "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER", "US_PASSPORT_NUMBER", "US_SOCIAL_SECURITY_NUMBER", "VEHICLE_IDENTIFICATION_NUMBER"
|
506
|
+
# resp.assessments[0].sensitive_information_policy.pii_entities[0].action #=> String, one of "ANONYMIZED", "BLOCKED"
|
507
|
+
# resp.assessments[0].sensitive_information_policy.regexes #=> Array
|
508
|
+
# resp.assessments[0].sensitive_information_policy.regexes[0].name #=> String
|
509
|
+
# resp.assessments[0].sensitive_information_policy.regexes[0].match #=> String
|
510
|
+
# resp.assessments[0].sensitive_information_policy.regexes[0].regex #=> String
|
511
|
+
# resp.assessments[0].sensitive_information_policy.regexes[0].action #=> String, one of "ANONYMIZED", "BLOCKED"
|
512
|
+
# resp.assessments[0].contextual_grounding_policy.filters #=> Array
|
513
|
+
# resp.assessments[0].contextual_grounding_policy.filters[0].type #=> String, one of "GROUNDING", "RELEVANCE"
|
514
|
+
# resp.assessments[0].contextual_grounding_policy.filters[0].threshold #=> Float
|
515
|
+
# resp.assessments[0].contextual_grounding_policy.filters[0].score #=> Float
|
516
|
+
# resp.assessments[0].contextual_grounding_policy.filters[0].action #=> String, one of "BLOCKED", "NONE"
|
517
|
+
#
|
518
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/ApplyGuardrail AWS API Documentation
|
519
|
+
#
|
520
|
+
# @overload apply_guardrail(params = {})
|
521
|
+
# @param [Hash] params ({})
|
522
|
+
def apply_guardrail(params = {}, options = {})
|
523
|
+
req = build_request(:apply_guardrail, params)
|
524
|
+
req.send_request(options)
|
525
|
+
end
|
526
|
+
|
439
527
|
# Sends messages to the specified Amazon Bedrock model. `Converse`
|
440
528
|
# provides a consistent interface that works with all models that
|
441
529
|
# support messages. This allows you to write code once and use it with
|
442
|
-
# different models.
|
443
|
-
#
|
530
|
+
# different models. If a model has unique inference parameters, you can
|
531
|
+
# also pass those unique parameters to the model.
|
532
|
+
#
|
533
|
+
# Amazon Bedrock doesn't store any text, images, or documents that you
|
534
|
+
# provide as content. The data is only used to generate the response.
|
444
535
|
#
|
445
536
|
# For information about the Converse API, see *Use the Converse API* in
|
446
537
|
# the *Amazon Bedrock User Guide*. To use a guardrail, see *Use a
|
@@ -603,6 +694,7 @@ module Aws::BedrockRuntime
|
|
603
694
|
# guard_content: {
|
604
695
|
# text: {
|
605
696
|
# text: "String", # required
|
697
|
+
# qualifiers: ["grounding_source"], # accepts grounding_source, query, guard_content
|
606
698
|
# },
|
607
699
|
# },
|
608
700
|
# },
|
@@ -615,6 +707,7 @@ module Aws::BedrockRuntime
|
|
615
707
|
# guard_content: {
|
616
708
|
# text: {
|
617
709
|
# text: "String", # required
|
710
|
+
# qualifiers: ["grounding_source"], # accepts grounding_source, query, guard_content
|
618
711
|
# },
|
619
712
|
# },
|
620
713
|
# },
|
@@ -680,6 +773,8 @@ module Aws::BedrockRuntime
|
|
680
773
|
# resp.output.message.content[0].tool_result.content[0].document.source.bytes #=> String
|
681
774
|
# resp.output.message.content[0].tool_result.status #=> String, one of "success", "error"
|
682
775
|
# resp.output.message.content[0].guard_content.text.text #=> String
|
776
|
+
# resp.output.message.content[0].guard_content.text.qualifiers #=> Array
|
777
|
+
# resp.output.message.content[0].guard_content.text.qualifiers[0] #=> String, one of "grounding_source", "query", "guard_content"
|
683
778
|
# resp.stop_reason #=> String, one of "end_turn", "tool_use", "max_tokens", "stop_sequence", "guardrail_intervened", "content_filtered"
|
684
779
|
# resp.usage.input_tokens #=> Integer
|
685
780
|
# resp.usage.output_tokens #=> Integer
|
@@ -712,6 +807,11 @@ module Aws::BedrockRuntime
|
|
712
807
|
# resp.trace.guardrail.input_assessment["String"].sensitive_information_policy.regexes[0].match #=> String
|
713
808
|
# resp.trace.guardrail.input_assessment["String"].sensitive_information_policy.regexes[0].regex #=> String
|
714
809
|
# resp.trace.guardrail.input_assessment["String"].sensitive_information_policy.regexes[0].action #=> String, one of "ANONYMIZED", "BLOCKED"
|
810
|
+
# resp.trace.guardrail.input_assessment["String"].contextual_grounding_policy.filters #=> Array
|
811
|
+
# resp.trace.guardrail.input_assessment["String"].contextual_grounding_policy.filters[0].type #=> String, one of "GROUNDING", "RELEVANCE"
|
812
|
+
# resp.trace.guardrail.input_assessment["String"].contextual_grounding_policy.filters[0].threshold #=> Float
|
813
|
+
# resp.trace.guardrail.input_assessment["String"].contextual_grounding_policy.filters[0].score #=> Float
|
814
|
+
# resp.trace.guardrail.input_assessment["String"].contextual_grounding_policy.filters[0].action #=> String, one of "BLOCKED", "NONE"
|
715
815
|
# resp.trace.guardrail.output_assessments #=> Hash
|
716
816
|
# resp.trace.guardrail.output_assessments["String"] #=> Array
|
717
817
|
# resp.trace.guardrail.output_assessments["String"][0].topic_policy.topics #=> Array
|
@@ -738,6 +838,11 @@ module Aws::BedrockRuntime
|
|
738
838
|
# resp.trace.guardrail.output_assessments["String"][0].sensitive_information_policy.regexes[0].match #=> String
|
739
839
|
# resp.trace.guardrail.output_assessments["String"][0].sensitive_information_policy.regexes[0].regex #=> String
|
740
840
|
# resp.trace.guardrail.output_assessments["String"][0].sensitive_information_policy.regexes[0].action #=> String, one of "ANONYMIZED", "BLOCKED"
|
841
|
+
# resp.trace.guardrail.output_assessments["String"][0].contextual_grounding_policy.filters #=> Array
|
842
|
+
# resp.trace.guardrail.output_assessments["String"][0].contextual_grounding_policy.filters[0].type #=> String, one of "GROUNDING", "RELEVANCE"
|
843
|
+
# resp.trace.guardrail.output_assessments["String"][0].contextual_grounding_policy.filters[0].threshold #=> Float
|
844
|
+
# resp.trace.guardrail.output_assessments["String"][0].contextual_grounding_policy.filters[0].score #=> Float
|
845
|
+
# resp.trace.guardrail.output_assessments["String"][0].contextual_grounding_policy.filters[0].action #=> String, one of "BLOCKED", "NONE"
|
741
846
|
#
|
742
847
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/Converse AWS API Documentation
|
743
848
|
#
|
@@ -759,6 +864,14 @@ module Aws::BedrockRuntime
|
|
759
864
|
# [GetFoundationModel][1] and check the `responseStreamingSupported`
|
760
865
|
# field in the response.
|
761
866
|
#
|
867
|
+
# <note markdown="1"> The CLI doesn't support streaming operations in Amazon Bedrock,
|
868
|
+
# including `ConverseStream`.
|
869
|
+
#
|
870
|
+
# </note>
|
871
|
+
#
|
872
|
+
# Amazon Bedrock doesn't store any text, images, or documents that you
|
873
|
+
# provide as content. The data is only used to generate the response.
|
874
|
+
#
|
762
875
|
# For information about the Converse API, see *Use the Converse API* in
|
763
876
|
# the *Amazon Bedrock User Guide*. To use a guardrail, see *Use a
|
764
877
|
# guardrail with the Converse API* in the *Amazon Bedrock User Guide*.
|
@@ -930,6 +1043,9 @@ module Aws::BedrockRuntime
|
|
930
1043
|
# handler.on_throttling_exception_event do |event|
|
931
1044
|
# event # => Aws::BedrockRuntime::Types::throttlingException
|
932
1045
|
# end
|
1046
|
+
# handler.on_service_unavailable_exception_event do |event|
|
1047
|
+
# event # => Aws::BedrockRuntime::Types::serviceUnavailableException
|
1048
|
+
# end
|
933
1049
|
#
|
934
1050
|
# client.converse_stream( # params input #, event_stream_handler: handler)
|
935
1051
|
#
|
@@ -967,6 +1083,9 @@ module Aws::BedrockRuntime
|
|
967
1083
|
# stream.on_throttling_exception_event do |event|
|
968
1084
|
# event # => Aws::BedrockRuntime::Types::throttlingException
|
969
1085
|
# end
|
1086
|
+
# stream.on_service_unavailable_exception_event do |event|
|
1087
|
+
# event # => Aws::BedrockRuntime::Types::serviceUnavailableException
|
1088
|
+
# end
|
970
1089
|
# end
|
971
1090
|
#
|
972
1091
|
# client.converse_stream( # params input #, event_stream_handler: handler)
|
@@ -1004,6 +1123,9 @@ module Aws::BedrockRuntime
|
|
1004
1123
|
# handler.on_throttling_exception_event do |event|
|
1005
1124
|
# event # => Aws::BedrockRuntime::Types::throttlingException
|
1006
1125
|
# end
|
1126
|
+
# handler.on_service_unavailable_exception_event do |event|
|
1127
|
+
# event # => Aws::BedrockRuntime::Types::serviceUnavailableException
|
1128
|
+
# end
|
1007
1129
|
#
|
1008
1130
|
# client.converse_stream( # params input #, event_stream_handler: handler) do |stream|
|
1009
1131
|
# stream.on_error_event do |event|
|
@@ -1077,6 +1199,7 @@ module Aws::BedrockRuntime
|
|
1077
1199
|
# guard_content: {
|
1078
1200
|
# text: {
|
1079
1201
|
# text: "String", # required
|
1202
|
+
# qualifiers: ["grounding_source"], # accepts grounding_source, query, guard_content
|
1080
1203
|
# },
|
1081
1204
|
# },
|
1082
1205
|
# },
|
@@ -1089,6 +1212,7 @@ module Aws::BedrockRuntime
|
|
1089
1212
|
# guard_content: {
|
1090
1213
|
# text: {
|
1091
1214
|
# text: "String", # required
|
1215
|
+
# qualifiers: ["grounding_source"], # accepts grounding_source, query, guard_content
|
1092
1216
|
# },
|
1093
1217
|
# },
|
1094
1218
|
# },
|
@@ -1137,7 +1261,7 @@ module Aws::BedrockRuntime
|
|
1137
1261
|
#
|
1138
1262
|
# All events are available at resp.stream:
|
1139
1263
|
# resp.stream #=> Enumerator
|
1140
|
-
# resp.stream.event_types #=> [:message_start, :content_block_start, :content_block_delta, :content_block_stop, :message_stop, :metadata, :internal_server_exception, :model_stream_error_exception, :validation_exception, :throttling_exception]
|
1264
|
+
# resp.stream.event_types #=> [:message_start, :content_block_start, :content_block_delta, :content_block_stop, :message_stop, :metadata, :internal_server_exception, :model_stream_error_exception, :validation_exception, :throttling_exception, :service_unavailable_exception]
|
1141
1265
|
#
|
1142
1266
|
# For :message_start event available at #on_message_start_event callback and response eventstream enumerator:
|
1143
1267
|
# event.role #=> String, one of "user", "assistant"
|
@@ -1190,6 +1314,11 @@ module Aws::BedrockRuntime
|
|
1190
1314
|
# event.trace.guardrail.input_assessment["String"].sensitive_information_policy.regexes[0].match #=> String
|
1191
1315
|
# event.trace.guardrail.input_assessment["String"].sensitive_information_policy.regexes[0].regex #=> String
|
1192
1316
|
# event.trace.guardrail.input_assessment["String"].sensitive_information_policy.regexes[0].action #=> String, one of "ANONYMIZED", "BLOCKED"
|
1317
|
+
# event.trace.guardrail.input_assessment["String"].contextual_grounding_policy.filters #=> Array
|
1318
|
+
# event.trace.guardrail.input_assessment["String"].contextual_grounding_policy.filters[0].type #=> String, one of "GROUNDING", "RELEVANCE"
|
1319
|
+
# event.trace.guardrail.input_assessment["String"].contextual_grounding_policy.filters[0].threshold #=> Float
|
1320
|
+
# event.trace.guardrail.input_assessment["String"].contextual_grounding_policy.filters[0].score #=> Float
|
1321
|
+
# event.trace.guardrail.input_assessment["String"].contextual_grounding_policy.filters[0].action #=> String, one of "BLOCKED", "NONE"
|
1193
1322
|
# event.trace.guardrail.output_assessments #=> Hash
|
1194
1323
|
# event.trace.guardrail.output_assessments["String"] #=> Array
|
1195
1324
|
# event.trace.guardrail.output_assessments["String"][0].topic_policy.topics #=> Array
|
@@ -1216,6 +1345,11 @@ module Aws::BedrockRuntime
|
|
1216
1345
|
# event.trace.guardrail.output_assessments["String"][0].sensitive_information_policy.regexes[0].match #=> String
|
1217
1346
|
# event.trace.guardrail.output_assessments["String"][0].sensitive_information_policy.regexes[0].regex #=> String
|
1218
1347
|
# event.trace.guardrail.output_assessments["String"][0].sensitive_information_policy.regexes[0].action #=> String, one of "ANONYMIZED", "BLOCKED"
|
1348
|
+
# event.trace.guardrail.output_assessments["String"][0].contextual_grounding_policy.filters #=> Array
|
1349
|
+
# event.trace.guardrail.output_assessments["String"][0].contextual_grounding_policy.filters[0].type #=> String, one of "GROUNDING", "RELEVANCE"
|
1350
|
+
# event.trace.guardrail.output_assessments["String"][0].contextual_grounding_policy.filters[0].threshold #=> Float
|
1351
|
+
# event.trace.guardrail.output_assessments["String"][0].contextual_grounding_policy.filters[0].score #=> Float
|
1352
|
+
# event.trace.guardrail.output_assessments["String"][0].contextual_grounding_policy.filters[0].action #=> String, one of "BLOCKED", "NONE"
|
1219
1353
|
#
|
1220
1354
|
# For :internal_server_exception event available at #on_internal_server_exception_event callback and response eventstream enumerator:
|
1221
1355
|
# event.message #=> String
|
@@ -1231,6 +1365,9 @@ module Aws::BedrockRuntime
|
|
1231
1365
|
# For :throttling_exception event available at #on_throttling_exception_event callback and response eventstream enumerator:
|
1232
1366
|
# event.message #=> String
|
1233
1367
|
#
|
1368
|
+
# For :service_unavailable_exception event available at #on_service_unavailable_exception_event callback and response eventstream enumerator:
|
1369
|
+
# event.message #=> String
|
1370
|
+
#
|
1234
1371
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/ConverseStream AWS API Documentation
|
1235
1372
|
#
|
1236
1373
|
# @overload converse_stream(params = {})
|
@@ -1372,7 +1509,8 @@ module Aws::BedrockRuntime
|
|
1372
1509
|
# To see if a model supports streaming, call [GetFoundationModel][1] and
|
1373
1510
|
# check the `responseStreamingSupported` field in the response.
|
1374
1511
|
#
|
1375
|
-
# <note markdown="1"> The CLI doesn't support
|
1512
|
+
# <note markdown="1"> The CLI doesn't support streaming operations in Amazon Bedrock,
|
1513
|
+
# including `InvokeModelWithResponseStream`.
|
1376
1514
|
#
|
1377
1515
|
# </note>
|
1378
1516
|
#
|
@@ -1518,6 +1656,9 @@ module Aws::BedrockRuntime
|
|
1518
1656
|
# handler.on_model_timeout_exception_event do |event|
|
1519
1657
|
# event # => Aws::BedrockRuntime::Types::modelTimeoutException
|
1520
1658
|
# end
|
1659
|
+
# handler.on_service_unavailable_exception_event do |event|
|
1660
|
+
# event # => Aws::BedrockRuntime::Types::serviceUnavailableException
|
1661
|
+
# end
|
1521
1662
|
#
|
1522
1663
|
# client.invoke_model_with_response_stream( # params input #, event_stream_handler: handler)
|
1523
1664
|
#
|
@@ -1543,6 +1684,9 @@ module Aws::BedrockRuntime
|
|
1543
1684
|
# stream.on_model_timeout_exception_event do |event|
|
1544
1685
|
# event # => Aws::BedrockRuntime::Types::modelTimeoutException
|
1545
1686
|
# end
|
1687
|
+
# stream.on_service_unavailable_exception_event do |event|
|
1688
|
+
# event # => Aws::BedrockRuntime::Types::serviceUnavailableException
|
1689
|
+
# end
|
1546
1690
|
# end
|
1547
1691
|
#
|
1548
1692
|
# client.invoke_model_with_response_stream( # params input #, event_stream_handler: handler)
|
@@ -1568,6 +1712,9 @@ module Aws::BedrockRuntime
|
|
1568
1712
|
# handler.on_model_timeout_exception_event do |event|
|
1569
1713
|
# event # => Aws::BedrockRuntime::Types::modelTimeoutException
|
1570
1714
|
# end
|
1715
|
+
# handler.on_service_unavailable_exception_event do |event|
|
1716
|
+
# event # => Aws::BedrockRuntime::Types::serviceUnavailableException
|
1717
|
+
# end
|
1571
1718
|
#
|
1572
1719
|
# client.invoke_model_with_response_stream( # params input #, event_stream_handler: handler) do |stream|
|
1573
1720
|
# stream.on_error_event do |event|
|
@@ -1601,7 +1748,7 @@ module Aws::BedrockRuntime
|
|
1601
1748
|
#
|
1602
1749
|
# All events are available at resp.body:
|
1603
1750
|
# resp.body #=> Enumerator
|
1604
|
-
# resp.body.event_types #=> [:chunk, :internal_server_exception, :model_stream_error_exception, :validation_exception, :throttling_exception, :model_timeout_exception]
|
1751
|
+
# resp.body.event_types #=> [:chunk, :internal_server_exception, :model_stream_error_exception, :validation_exception, :throttling_exception, :model_timeout_exception, :service_unavailable_exception]
|
1605
1752
|
#
|
1606
1753
|
# For :chunk event available at #on_chunk_event callback and response eventstream enumerator:
|
1607
1754
|
# event.bytes #=> String
|
@@ -1623,6 +1770,9 @@ module Aws::BedrockRuntime
|
|
1623
1770
|
# For :model_timeout_exception event available at #on_model_timeout_exception_event callback and response eventstream enumerator:
|
1624
1771
|
# event.message #=> String
|
1625
1772
|
#
|
1773
|
+
# For :service_unavailable_exception event available at #on_service_unavailable_exception_event callback and response eventstream enumerator:
|
1774
|
+
# event.message #=> String
|
1775
|
+
#
|
1626
1776
|
# resp.content_type #=> String
|
1627
1777
|
#
|
1628
1778
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModelWithResponseStream AWS API Documentation
|
@@ -1665,7 +1815,7 @@ module Aws::BedrockRuntime
|
|
1665
1815
|
params: params,
|
1666
1816
|
config: config)
|
1667
1817
|
context[:gem_name] = 'aws-sdk-bedrockruntime'
|
1668
|
-
context[:gem_version] = '1.
|
1818
|
+
context[:gem_version] = '1.17.0'
|
1669
1819
|
Seahorse::Client::Request.new(handlers, context)
|
1670
1820
|
end
|
1671
1821
|
|
@@ -15,6 +15,8 @@ module Aws::BedrockRuntime
|
|
15
15
|
|
16
16
|
AccessDeniedException = Shapes::StructureShape.new(name: 'AccessDeniedException')
|
17
17
|
AnyToolChoice = Shapes::StructureShape.new(name: 'AnyToolChoice')
|
18
|
+
ApplyGuardrailRequest = Shapes::StructureShape.new(name: 'ApplyGuardrailRequest')
|
19
|
+
ApplyGuardrailResponse = Shapes::StructureShape.new(name: 'ApplyGuardrailResponse')
|
18
20
|
AutoToolChoice = Shapes::StructureShape.new(name: 'AutoToolChoice')
|
19
21
|
Body = Shapes::BlobShape.new(name: 'Body')
|
20
22
|
ContentBlock = Shapes::UnionShape.new(name: 'ContentBlock')
|
@@ -47,18 +49,35 @@ module Aws::BedrockRuntime
|
|
47
49
|
DocumentFormat = Shapes::StringShape.new(name: 'DocumentFormat')
|
48
50
|
DocumentSource = Shapes::UnionShape.new(name: 'DocumentSource')
|
49
51
|
DocumentSourceBytesBlob = Shapes::BlobShape.new(name: 'DocumentSourceBytesBlob')
|
52
|
+
GuardrailAction = Shapes::StringShape.new(name: 'GuardrailAction')
|
50
53
|
GuardrailAssessment = Shapes::StructureShape.new(name: 'GuardrailAssessment')
|
51
54
|
GuardrailAssessmentList = Shapes::ListShape.new(name: 'GuardrailAssessmentList')
|
52
55
|
GuardrailAssessmentListMap = Shapes::MapShape.new(name: 'GuardrailAssessmentListMap')
|
53
56
|
GuardrailAssessmentMap = Shapes::MapShape.new(name: 'GuardrailAssessmentMap')
|
54
57
|
GuardrailConfiguration = Shapes::StructureShape.new(name: 'GuardrailConfiguration')
|
58
|
+
GuardrailContentBlock = Shapes::UnionShape.new(name: 'GuardrailContentBlock')
|
59
|
+
GuardrailContentBlockList = Shapes::ListShape.new(name: 'GuardrailContentBlockList')
|
55
60
|
GuardrailContentFilter = Shapes::StructureShape.new(name: 'GuardrailContentFilter')
|
56
61
|
GuardrailContentFilterConfidence = Shapes::StringShape.new(name: 'GuardrailContentFilterConfidence')
|
57
62
|
GuardrailContentFilterList = Shapes::ListShape.new(name: 'GuardrailContentFilterList')
|
58
63
|
GuardrailContentFilterType = Shapes::StringShape.new(name: 'GuardrailContentFilterType')
|
59
64
|
GuardrailContentPolicyAction = Shapes::StringShape.new(name: 'GuardrailContentPolicyAction')
|
60
65
|
GuardrailContentPolicyAssessment = Shapes::StructureShape.new(name: 'GuardrailContentPolicyAssessment')
|
66
|
+
GuardrailContentPolicyUnitsProcessed = Shapes::IntegerShape.new(name: 'GuardrailContentPolicyUnitsProcessed')
|
67
|
+
GuardrailContentQualifier = Shapes::StringShape.new(name: 'GuardrailContentQualifier')
|
68
|
+
GuardrailContentQualifierList = Shapes::ListShape.new(name: 'GuardrailContentQualifierList')
|
69
|
+
GuardrailContentSource = Shapes::StringShape.new(name: 'GuardrailContentSource')
|
70
|
+
GuardrailContextualGroundingFilter = Shapes::StructureShape.new(name: 'GuardrailContextualGroundingFilter')
|
71
|
+
GuardrailContextualGroundingFilterScoreDouble = Shapes::FloatShape.new(name: 'GuardrailContextualGroundingFilterScoreDouble')
|
72
|
+
GuardrailContextualGroundingFilterThresholdDouble = Shapes::FloatShape.new(name: 'GuardrailContextualGroundingFilterThresholdDouble')
|
73
|
+
GuardrailContextualGroundingFilterType = Shapes::StringShape.new(name: 'GuardrailContextualGroundingFilterType')
|
74
|
+
GuardrailContextualGroundingFilters = Shapes::ListShape.new(name: 'GuardrailContextualGroundingFilters')
|
75
|
+
GuardrailContextualGroundingPolicyAction = Shapes::StringShape.new(name: 'GuardrailContextualGroundingPolicyAction')
|
76
|
+
GuardrailContextualGroundingPolicyAssessment = Shapes::StructureShape.new(name: 'GuardrailContextualGroundingPolicyAssessment')
|
77
|
+
GuardrailContextualGroundingPolicyUnitsProcessed = Shapes::IntegerShape.new(name: 'GuardrailContextualGroundingPolicyUnitsProcessed')
|
61
78
|
GuardrailConverseContentBlock = Shapes::UnionShape.new(name: 'GuardrailConverseContentBlock')
|
79
|
+
GuardrailConverseContentQualifier = Shapes::StringShape.new(name: 'GuardrailConverseContentQualifier')
|
80
|
+
GuardrailConverseContentQualifierList = Shapes::ListShape.new(name: 'GuardrailConverseContentQualifierList')
|
62
81
|
GuardrailConverseTextBlock = Shapes::StructureShape.new(name: 'GuardrailConverseTextBlock')
|
63
82
|
GuardrailCustomWord = Shapes::StructureShape.new(name: 'GuardrailCustomWord')
|
64
83
|
GuardrailCustomWordList = Shapes::ListShape.new(name: 'GuardrailCustomWordList')
|
@@ -66,6 +85,8 @@ module Aws::BedrockRuntime
|
|
66
85
|
GuardrailManagedWord = Shapes::StructureShape.new(name: 'GuardrailManagedWord')
|
67
86
|
GuardrailManagedWordList = Shapes::ListShape.new(name: 'GuardrailManagedWordList')
|
68
87
|
GuardrailManagedWordType = Shapes::StringShape.new(name: 'GuardrailManagedWordType')
|
88
|
+
GuardrailOutputContent = Shapes::StructureShape.new(name: 'GuardrailOutputContent')
|
89
|
+
GuardrailOutputContentList = Shapes::ListShape.new(name: 'GuardrailOutputContentList')
|
69
90
|
GuardrailOutputText = Shapes::StringShape.new(name: 'GuardrailOutputText')
|
70
91
|
GuardrailPiiEntityFilter = Shapes::StructureShape.new(name: 'GuardrailPiiEntityFilter')
|
71
92
|
GuardrailPiiEntityFilterList = Shapes::ListShape.new(name: 'GuardrailPiiEntityFilterList')
|
@@ -74,18 +95,24 @@ module Aws::BedrockRuntime
|
|
74
95
|
GuardrailRegexFilterList = Shapes::ListShape.new(name: 'GuardrailRegexFilterList')
|
75
96
|
GuardrailSensitiveInformationPolicyAction = Shapes::StringShape.new(name: 'GuardrailSensitiveInformationPolicyAction')
|
76
97
|
GuardrailSensitiveInformationPolicyAssessment = Shapes::StructureShape.new(name: 'GuardrailSensitiveInformationPolicyAssessment')
|
98
|
+
GuardrailSensitiveInformationPolicyFreeUnitsProcessed = Shapes::IntegerShape.new(name: 'GuardrailSensitiveInformationPolicyFreeUnitsProcessed')
|
99
|
+
GuardrailSensitiveInformationPolicyUnitsProcessed = Shapes::IntegerShape.new(name: 'GuardrailSensitiveInformationPolicyUnitsProcessed')
|
77
100
|
GuardrailStreamConfiguration = Shapes::StructureShape.new(name: 'GuardrailStreamConfiguration')
|
78
101
|
GuardrailStreamProcessingMode = Shapes::StringShape.new(name: 'GuardrailStreamProcessingMode')
|
102
|
+
GuardrailTextBlock = Shapes::StructureShape.new(name: 'GuardrailTextBlock')
|
79
103
|
GuardrailTopic = Shapes::StructureShape.new(name: 'GuardrailTopic')
|
80
104
|
GuardrailTopicList = Shapes::ListShape.new(name: 'GuardrailTopicList')
|
81
105
|
GuardrailTopicPolicyAction = Shapes::StringShape.new(name: 'GuardrailTopicPolicyAction')
|
82
106
|
GuardrailTopicPolicyAssessment = Shapes::StructureShape.new(name: 'GuardrailTopicPolicyAssessment')
|
107
|
+
GuardrailTopicPolicyUnitsProcessed = Shapes::IntegerShape.new(name: 'GuardrailTopicPolicyUnitsProcessed')
|
83
108
|
GuardrailTopicType = Shapes::StringShape.new(name: 'GuardrailTopicType')
|
84
109
|
GuardrailTrace = Shapes::StringShape.new(name: 'GuardrailTrace')
|
85
110
|
GuardrailTraceAssessment = Shapes::StructureShape.new(name: 'GuardrailTraceAssessment')
|
111
|
+
GuardrailUsage = Shapes::StructureShape.new(name: 'GuardrailUsage')
|
86
112
|
GuardrailVersion = Shapes::StringShape.new(name: 'GuardrailVersion')
|
87
113
|
GuardrailWordPolicyAction = Shapes::StringShape.new(name: 'GuardrailWordPolicyAction')
|
88
114
|
GuardrailWordPolicyAssessment = Shapes::StructureShape.new(name: 'GuardrailWordPolicyAssessment')
|
115
|
+
GuardrailWordPolicyUnitsProcessed = Shapes::IntegerShape.new(name: 'GuardrailWordPolicyUnitsProcessed')
|
89
116
|
ImageBlock = Shapes::StructureShape.new(name: 'ImageBlock')
|
90
117
|
ImageFormat = Shapes::StringShape.new(name: 'ImageFormat')
|
91
118
|
ImageSource = Shapes::UnionShape.new(name: 'ImageSource')
|
@@ -120,6 +147,7 @@ module Aws::BedrockRuntime
|
|
120
147
|
ResourceNotFoundException = Shapes::StructureShape.new(name: 'ResourceNotFoundException')
|
121
148
|
ResponseStream = Shapes::StructureShape.new(name: 'ResponseStream')
|
122
149
|
ServiceQuotaExceededException = Shapes::StructureShape.new(name: 'ServiceQuotaExceededException')
|
150
|
+
ServiceUnavailableException = Shapes::StructureShape.new(name: 'ServiceUnavailableException')
|
123
151
|
SpecificToolChoice = Shapes::StructureShape.new(name: 'SpecificToolChoice')
|
124
152
|
StatusCode = Shapes::IntegerShape.new(name: 'StatusCode')
|
125
153
|
StopReason = Shapes::StringShape.new(name: 'StopReason')
|
@@ -154,6 +182,18 @@ module Aws::BedrockRuntime
|
|
154
182
|
|
155
183
|
AnyToolChoice.struct_class = Types::AnyToolChoice
|
156
184
|
|
185
|
+
ApplyGuardrailRequest.add_member(:guardrail_identifier, Shapes::ShapeRef.new(shape: GuardrailIdentifier, required: true, location: "uri", location_name: "guardrailIdentifier"))
|
186
|
+
ApplyGuardrailRequest.add_member(:guardrail_version, Shapes::ShapeRef.new(shape: GuardrailVersion, required: true, location: "uri", location_name: "guardrailVersion"))
|
187
|
+
ApplyGuardrailRequest.add_member(:source, Shapes::ShapeRef.new(shape: GuardrailContentSource, required: true, location_name: "source"))
|
188
|
+
ApplyGuardrailRequest.add_member(:content, Shapes::ShapeRef.new(shape: GuardrailContentBlockList, required: true, location_name: "content"))
|
189
|
+
ApplyGuardrailRequest.struct_class = Types::ApplyGuardrailRequest
|
190
|
+
|
191
|
+
ApplyGuardrailResponse.add_member(:usage, Shapes::ShapeRef.new(shape: GuardrailUsage, required: true, location_name: "usage"))
|
192
|
+
ApplyGuardrailResponse.add_member(:action, Shapes::ShapeRef.new(shape: GuardrailAction, required: true, location_name: "action"))
|
193
|
+
ApplyGuardrailResponse.add_member(:outputs, Shapes::ShapeRef.new(shape: GuardrailOutputContentList, required: true, location_name: "outputs"))
|
194
|
+
ApplyGuardrailResponse.add_member(:assessments, Shapes::ShapeRef.new(shape: GuardrailAssessmentList, required: true, location_name: "assessments"))
|
195
|
+
ApplyGuardrailResponse.struct_class = Types::ApplyGuardrailResponse
|
196
|
+
|
157
197
|
AutoToolChoice.struct_class = Types::AutoToolChoice
|
158
198
|
|
159
199
|
ContentBlock.add_member(:text, Shapes::ShapeRef.new(shape: String, location_name: "text"))
|
@@ -246,6 +286,7 @@ module Aws::BedrockRuntime
|
|
246
286
|
ConverseStreamOutput.add_member(:model_stream_error_exception, Shapes::ShapeRef.new(shape: ModelStreamErrorException, location_name: "modelStreamErrorException"))
|
247
287
|
ConverseStreamOutput.add_member(:validation_exception, Shapes::ShapeRef.new(shape: ValidationException, location_name: "validationException"))
|
248
288
|
ConverseStreamOutput.add_member(:throttling_exception, Shapes::ShapeRef.new(shape: ThrottlingException, location_name: "throttlingException"))
|
289
|
+
ConverseStreamOutput.add_member(:service_unavailable_exception, Shapes::ShapeRef.new(shape: ServiceUnavailableException, location_name: "serviceUnavailableException"))
|
249
290
|
ConverseStreamOutput.struct_class = Types::ConverseStreamOutput
|
250
291
|
|
251
292
|
ConverseStreamRequest.add_member(:model_id, Shapes::ShapeRef.new(shape: ConversationalModelId, required: true, location: "uri", location_name: "modelId"))
|
@@ -286,6 +327,7 @@ module Aws::BedrockRuntime
|
|
286
327
|
GuardrailAssessment.add_member(:content_policy, Shapes::ShapeRef.new(shape: GuardrailContentPolicyAssessment, location_name: "contentPolicy"))
|
287
328
|
GuardrailAssessment.add_member(:word_policy, Shapes::ShapeRef.new(shape: GuardrailWordPolicyAssessment, location_name: "wordPolicy"))
|
288
329
|
GuardrailAssessment.add_member(:sensitive_information_policy, Shapes::ShapeRef.new(shape: GuardrailSensitiveInformationPolicyAssessment, location_name: "sensitiveInformationPolicy"))
|
330
|
+
GuardrailAssessment.add_member(:contextual_grounding_policy, Shapes::ShapeRef.new(shape: GuardrailContextualGroundingPolicyAssessment, location_name: "contextualGroundingPolicy"))
|
289
331
|
GuardrailAssessment.struct_class = Types::GuardrailAssessment
|
290
332
|
|
291
333
|
GuardrailAssessmentList.member = Shapes::ShapeRef.new(shape: GuardrailAssessment)
|
@@ -301,6 +343,14 @@ module Aws::BedrockRuntime
|
|
301
343
|
GuardrailConfiguration.add_member(:trace, Shapes::ShapeRef.new(shape: GuardrailTrace, location_name: "trace"))
|
302
344
|
GuardrailConfiguration.struct_class = Types::GuardrailConfiguration
|
303
345
|
|
346
|
+
GuardrailContentBlock.add_member(:text, Shapes::ShapeRef.new(shape: GuardrailTextBlock, location_name: "text"))
|
347
|
+
GuardrailContentBlock.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
|
348
|
+
GuardrailContentBlock.add_member_subclass(:text, Types::GuardrailContentBlock::Text)
|
349
|
+
GuardrailContentBlock.add_member_subclass(:unknown, Types::GuardrailContentBlock::Unknown)
|
350
|
+
GuardrailContentBlock.struct_class = Types::GuardrailContentBlock
|
351
|
+
|
352
|
+
GuardrailContentBlockList.member = Shapes::ShapeRef.new(shape: GuardrailContentBlock)
|
353
|
+
|
304
354
|
GuardrailContentFilter.add_member(:type, Shapes::ShapeRef.new(shape: GuardrailContentFilterType, required: true, location_name: "type"))
|
305
355
|
GuardrailContentFilter.add_member(:confidence, Shapes::ShapeRef.new(shape: GuardrailContentFilterConfidence, required: true, location_name: "confidence"))
|
306
356
|
GuardrailContentFilter.add_member(:action, Shapes::ShapeRef.new(shape: GuardrailContentPolicyAction, required: true, location_name: "action"))
|
@@ -311,13 +361,29 @@ module Aws::BedrockRuntime
|
|
311
361
|
GuardrailContentPolicyAssessment.add_member(:filters, Shapes::ShapeRef.new(shape: GuardrailContentFilterList, required: true, location_name: "filters"))
|
312
362
|
GuardrailContentPolicyAssessment.struct_class = Types::GuardrailContentPolicyAssessment
|
313
363
|
|
364
|
+
GuardrailContentQualifierList.member = Shapes::ShapeRef.new(shape: GuardrailContentQualifier)
|
365
|
+
|
366
|
+
GuardrailContextualGroundingFilter.add_member(:type, Shapes::ShapeRef.new(shape: GuardrailContextualGroundingFilterType, required: true, location_name: "type"))
|
367
|
+
GuardrailContextualGroundingFilter.add_member(:threshold, Shapes::ShapeRef.new(shape: GuardrailContextualGroundingFilterThresholdDouble, required: true, location_name: "threshold"))
|
368
|
+
GuardrailContextualGroundingFilter.add_member(:score, Shapes::ShapeRef.new(shape: GuardrailContextualGroundingFilterScoreDouble, required: true, location_name: "score"))
|
369
|
+
GuardrailContextualGroundingFilter.add_member(:action, Shapes::ShapeRef.new(shape: GuardrailContextualGroundingPolicyAction, required: true, location_name: "action"))
|
370
|
+
GuardrailContextualGroundingFilter.struct_class = Types::GuardrailContextualGroundingFilter
|
371
|
+
|
372
|
+
GuardrailContextualGroundingFilters.member = Shapes::ShapeRef.new(shape: GuardrailContextualGroundingFilter)
|
373
|
+
|
374
|
+
GuardrailContextualGroundingPolicyAssessment.add_member(:filters, Shapes::ShapeRef.new(shape: GuardrailContextualGroundingFilters, location_name: "filters"))
|
375
|
+
GuardrailContextualGroundingPolicyAssessment.struct_class = Types::GuardrailContextualGroundingPolicyAssessment
|
376
|
+
|
314
377
|
GuardrailConverseContentBlock.add_member(:text, Shapes::ShapeRef.new(shape: GuardrailConverseTextBlock, location_name: "text"))
|
315
378
|
GuardrailConverseContentBlock.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
|
316
379
|
GuardrailConverseContentBlock.add_member_subclass(:text, Types::GuardrailConverseContentBlock::Text)
|
317
380
|
GuardrailConverseContentBlock.add_member_subclass(:unknown, Types::GuardrailConverseContentBlock::Unknown)
|
318
381
|
GuardrailConverseContentBlock.struct_class = Types::GuardrailConverseContentBlock
|
319
382
|
|
383
|
+
GuardrailConverseContentQualifierList.member = Shapes::ShapeRef.new(shape: GuardrailConverseContentQualifier)
|
384
|
+
|
320
385
|
GuardrailConverseTextBlock.add_member(:text, Shapes::ShapeRef.new(shape: String, required: true, location_name: "text"))
|
386
|
+
GuardrailConverseTextBlock.add_member(:qualifiers, Shapes::ShapeRef.new(shape: GuardrailConverseContentQualifierList, location_name: "qualifiers"))
|
321
387
|
GuardrailConverseTextBlock.struct_class = Types::GuardrailConverseTextBlock
|
322
388
|
|
323
389
|
GuardrailCustomWord.add_member(:match, Shapes::ShapeRef.new(shape: String, required: true, location_name: "match"))
|
@@ -333,6 +399,11 @@ module Aws::BedrockRuntime
|
|
333
399
|
|
334
400
|
GuardrailManagedWordList.member = Shapes::ShapeRef.new(shape: GuardrailManagedWord)
|
335
401
|
|
402
|
+
GuardrailOutputContent.add_member(:text, Shapes::ShapeRef.new(shape: GuardrailOutputText, location_name: "text"))
|
403
|
+
GuardrailOutputContent.struct_class = Types::GuardrailOutputContent
|
404
|
+
|
405
|
+
GuardrailOutputContentList.member = Shapes::ShapeRef.new(shape: GuardrailOutputContent)
|
406
|
+
|
336
407
|
GuardrailPiiEntityFilter.add_member(:match, Shapes::ShapeRef.new(shape: String, required: true, location_name: "match"))
|
337
408
|
GuardrailPiiEntityFilter.add_member(:type, Shapes::ShapeRef.new(shape: GuardrailPiiEntityType, required: true, location_name: "type"))
|
338
409
|
GuardrailPiiEntityFilter.add_member(:action, Shapes::ShapeRef.new(shape: GuardrailSensitiveInformationPolicyAction, required: true, location_name: "action"))
|
@@ -358,6 +429,10 @@ module Aws::BedrockRuntime
|
|
358
429
|
GuardrailStreamConfiguration.add_member(:stream_processing_mode, Shapes::ShapeRef.new(shape: GuardrailStreamProcessingMode, location_name: "streamProcessingMode"))
|
359
430
|
GuardrailStreamConfiguration.struct_class = Types::GuardrailStreamConfiguration
|
360
431
|
|
432
|
+
GuardrailTextBlock.add_member(:text, Shapes::ShapeRef.new(shape: String, required: true, location_name: "text"))
|
433
|
+
GuardrailTextBlock.add_member(:qualifiers, Shapes::ShapeRef.new(shape: GuardrailContentQualifierList, location_name: "qualifiers"))
|
434
|
+
GuardrailTextBlock.struct_class = Types::GuardrailTextBlock
|
435
|
+
|
361
436
|
GuardrailTopic.add_member(:name, Shapes::ShapeRef.new(shape: String, required: true, location_name: "name"))
|
362
437
|
GuardrailTopic.add_member(:type, Shapes::ShapeRef.new(shape: GuardrailTopicType, required: true, location_name: "type"))
|
363
438
|
GuardrailTopic.add_member(:action, Shapes::ShapeRef.new(shape: GuardrailTopicPolicyAction, required: true, location_name: "action"))
|
@@ -373,6 +448,14 @@ module Aws::BedrockRuntime
|
|
373
448
|
GuardrailTraceAssessment.add_member(:output_assessments, Shapes::ShapeRef.new(shape: GuardrailAssessmentListMap, location_name: "outputAssessments"))
|
374
449
|
GuardrailTraceAssessment.struct_class = Types::GuardrailTraceAssessment
|
375
450
|
|
451
|
+
GuardrailUsage.add_member(:topic_policy_units, Shapes::ShapeRef.new(shape: GuardrailTopicPolicyUnitsProcessed, required: true, location_name: "topicPolicyUnits"))
|
452
|
+
GuardrailUsage.add_member(:content_policy_units, Shapes::ShapeRef.new(shape: GuardrailContentPolicyUnitsProcessed, required: true, location_name: "contentPolicyUnits"))
|
453
|
+
GuardrailUsage.add_member(:word_policy_units, Shapes::ShapeRef.new(shape: GuardrailWordPolicyUnitsProcessed, required: true, location_name: "wordPolicyUnits"))
|
454
|
+
GuardrailUsage.add_member(:sensitive_information_policy_units, Shapes::ShapeRef.new(shape: GuardrailSensitiveInformationPolicyUnitsProcessed, required: true, location_name: "sensitiveInformationPolicyUnits"))
|
455
|
+
GuardrailUsage.add_member(:sensitive_information_policy_free_units, Shapes::ShapeRef.new(shape: GuardrailSensitiveInformationPolicyFreeUnitsProcessed, required: true, location_name: "sensitiveInformationPolicyFreeUnits"))
|
456
|
+
GuardrailUsage.add_member(:contextual_grounding_policy_units, Shapes::ShapeRef.new(shape: GuardrailContextualGroundingPolicyUnitsProcessed, required: true, location_name: "contextualGroundingPolicyUnits"))
|
457
|
+
GuardrailUsage.struct_class = Types::GuardrailUsage
|
458
|
+
|
376
459
|
GuardrailWordPolicyAssessment.add_member(:custom_words, Shapes::ShapeRef.new(shape: GuardrailCustomWordList, required: true, location_name: "customWords"))
|
377
460
|
GuardrailWordPolicyAssessment.add_member(:managed_word_lists, Shapes::ShapeRef.new(shape: GuardrailManagedWordList, required: true, location_name: "managedWordLists"))
|
378
461
|
GuardrailWordPolicyAssessment.struct_class = Types::GuardrailWordPolicyAssessment
|
@@ -475,11 +558,15 @@ module Aws::BedrockRuntime
|
|
475
558
|
ResponseStream.add_member(:validation_exception, Shapes::ShapeRef.new(shape: ValidationException, location_name: "validationException"))
|
476
559
|
ResponseStream.add_member(:throttling_exception, Shapes::ShapeRef.new(shape: ThrottlingException, location_name: "throttlingException"))
|
477
560
|
ResponseStream.add_member(:model_timeout_exception, Shapes::ShapeRef.new(shape: ModelTimeoutException, location_name: "modelTimeoutException"))
|
561
|
+
ResponseStream.add_member(:service_unavailable_exception, Shapes::ShapeRef.new(shape: ServiceUnavailableException, location_name: "serviceUnavailableException"))
|
478
562
|
ResponseStream.struct_class = Types::ResponseStream
|
479
563
|
|
480
564
|
ServiceQuotaExceededException.add_member(:message, Shapes::ShapeRef.new(shape: NonBlankString, location_name: "message"))
|
481
565
|
ServiceQuotaExceededException.struct_class = Types::ServiceQuotaExceededException
|
482
566
|
|
567
|
+
ServiceUnavailableException.add_member(:message, Shapes::ShapeRef.new(shape: NonBlankString, location_name: "message"))
|
568
|
+
ServiceUnavailableException.struct_class = Types::ServiceUnavailableException
|
569
|
+
|
483
570
|
SpecificToolChoice.add_member(:name, Shapes::ShapeRef.new(shape: ToolName, required: true, location_name: "name"))
|
484
571
|
SpecificToolChoice.struct_class = Types::SpecificToolChoice
|
485
572
|
|
@@ -576,9 +663,10 @@ module Aws::BedrockRuntime
|
|
576
663
|
|
577
664
|
api.metadata = {
|
578
665
|
"apiVersion" => "2023-09-30",
|
666
|
+
"auth" => ["aws.auth#sigv4"],
|
579
667
|
"endpointPrefix" => "bedrock-runtime",
|
580
|
-
"jsonVersion" => "1.1",
|
581
668
|
"protocol" => "rest-json",
|
669
|
+
"protocols" => ["rest-json"],
|
582
670
|
"serviceFullName" => "Amazon Bedrock Runtime",
|
583
671
|
"serviceId" => "Bedrock Runtime",
|
584
672
|
"signatureVersion" => "v4",
|
@@ -586,6 +674,20 @@ module Aws::BedrockRuntime
|
|
586
674
|
"uid" => "bedrock-runtime-2023-09-30",
|
587
675
|
}
|
588
676
|
|
677
|
+
api.add_operation(:apply_guardrail, Seahorse::Model::Operation.new.tap do |o|
|
678
|
+
o.name = "ApplyGuardrail"
|
679
|
+
o.http_method = "POST"
|
680
|
+
o.http_request_uri = "/guardrail/{guardrailIdentifier}/version/{guardrailVersion}/apply"
|
681
|
+
o.input = Shapes::ShapeRef.new(shape: ApplyGuardrailRequest)
|
682
|
+
o.output = Shapes::ShapeRef.new(shape: ApplyGuardrailResponse)
|
683
|
+
o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
|
684
|
+
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
|
685
|
+
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
|
686
|
+
o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
|
687
|
+
o.errors << Shapes::ShapeRef.new(shape: ValidationException)
|
688
|
+
o.errors << Shapes::ShapeRef.new(shape: ServiceQuotaExceededException)
|
689
|
+
end)
|
690
|
+
|
589
691
|
api.add_operation(:converse, Seahorse::Model::Operation.new.tap do |o|
|
590
692
|
o.name = "Converse"
|
591
693
|
o.http_method = "POST"
|
@@ -597,6 +699,7 @@ module Aws::BedrockRuntime
|
|
597
699
|
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
|
598
700
|
o.errors << Shapes::ShapeRef.new(shape: ModelTimeoutException)
|
599
701
|
o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
|
702
|
+
o.errors << Shapes::ShapeRef.new(shape: ServiceUnavailableException)
|
600
703
|
o.errors << Shapes::ShapeRef.new(shape: ValidationException)
|
601
704
|
o.errors << Shapes::ShapeRef.new(shape: ModelNotReadyException)
|
602
705
|
o.errors << Shapes::ShapeRef.new(shape: ModelErrorException)
|
@@ -613,6 +716,7 @@ module Aws::BedrockRuntime
|
|
613
716
|
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
|
614
717
|
o.errors << Shapes::ShapeRef.new(shape: ModelTimeoutException)
|
615
718
|
o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
|
719
|
+
o.errors << Shapes::ShapeRef.new(shape: ServiceUnavailableException)
|
616
720
|
o.errors << Shapes::ShapeRef.new(shape: ValidationException)
|
617
721
|
o.errors << Shapes::ShapeRef.new(shape: ModelNotReadyException)
|
618
722
|
o.errors << Shapes::ShapeRef.new(shape: ModelErrorException)
|
@@ -629,6 +733,7 @@ module Aws::BedrockRuntime
|
|
629
733
|
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
|
630
734
|
o.errors << Shapes::ShapeRef.new(shape: ModelTimeoutException)
|
631
735
|
o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
|
736
|
+
o.errors << Shapes::ShapeRef.new(shape: ServiceUnavailableException)
|
632
737
|
o.errors << Shapes::ShapeRef.new(shape: ValidationException)
|
633
738
|
o.errors << Shapes::ShapeRef.new(shape: ModelNotReadyException)
|
634
739
|
o.errors << Shapes::ShapeRef.new(shape: ServiceQuotaExceededException)
|
@@ -646,6 +751,7 @@ module Aws::BedrockRuntime
|
|
646
751
|
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
|
647
752
|
o.errors << Shapes::ShapeRef.new(shape: ModelTimeoutException)
|
648
753
|
o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
|
754
|
+
o.errors << Shapes::ShapeRef.new(shape: ServiceUnavailableException)
|
649
755
|
o.errors << Shapes::ShapeRef.new(shape: ModelStreamErrorException)
|
650
756
|
o.errors << Shapes::ShapeRef.new(shape: ValidationException)
|
651
757
|
o.errors << Shapes::ShapeRef.new(shape: ModelNotReadyException)
|