aws-sdk-bedrockruntime 1.10.0 → 1.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-bedrockruntime/client.rb +223 -31
- data/lib/aws-sdk-bedrockruntime/client_api.rb +171 -0
- data/lib/aws-sdk-bedrockruntime/types.rb +548 -47
- data/lib/aws-sdk-bedrockruntime.rb +1 -1
- data/sig/client.rbs +63 -3
- data/sig/types.rbs +156 -2
- metadata +4 -4
@@ -23,7 +23,8 @@ module Aws::BedrockRuntime
|
|
23
23
|
include Aws::Structure
|
24
24
|
end
|
25
25
|
|
26
|
-
# The model must request at least one tool (no text is generated).
|
26
|
+
# The model must request at least one tool (no text is generated). For
|
27
|
+
# example, `\{"any" : \{\}\}`.
|
27
28
|
#
|
28
29
|
# @api private
|
29
30
|
#
|
@@ -31,8 +32,8 @@ module Aws::BedrockRuntime
|
|
31
32
|
#
|
32
33
|
class AnyToolChoice < Aws::EmptyStructure; end
|
33
34
|
|
34
|
-
# The Model automatically decides if a tool should be called or
|
35
|
-
#
|
35
|
+
# The Model automatically decides if a tool should be called or whether
|
36
|
+
# to generate text instead. For example, `\{"auto" : \{\}\}`.
|
36
37
|
#
|
37
38
|
# @api private
|
38
39
|
#
|
@@ -40,7 +41,8 @@ module Aws::BedrockRuntime
|
|
40
41
|
#
|
41
42
|
class AutoToolChoice < Aws::EmptyStructure; end
|
42
43
|
|
43
|
-
# A block of content for a message
|
44
|
+
# A block of content for a message that you pass to, or receive from, a
|
45
|
+
# model with the Converse API (Converse and ConverseStream).
|
44
46
|
#
|
45
47
|
# @note ContentBlock is a union - when making an API calls you must set exactly one of the members.
|
46
48
|
#
|
@@ -58,6 +60,10 @@ module Aws::BedrockRuntime
|
|
58
60
|
# </note>
|
59
61
|
# @return [Types::ImageBlock]
|
60
62
|
#
|
63
|
+
# @!attribute [rw] document
|
64
|
+
# A document to include in the message.
|
65
|
+
# @return [Types::DocumentBlock]
|
66
|
+
#
|
61
67
|
# @!attribute [rw] tool_use
|
62
68
|
# Information about a tool use request from a model.
|
63
69
|
# @return [Types::ToolUseBlock]
|
@@ -66,13 +72,24 @@ module Aws::BedrockRuntime
|
|
66
72
|
# The result for a tool request that a model makes.
|
67
73
|
# @return [Types::ToolResultBlock]
|
68
74
|
#
|
75
|
+
# @!attribute [rw] guard_content
|
76
|
+
# Contains the content to assess with the guardrail. If you don't
|
77
|
+
# specify `guardContent` in a call to the Converse API, the guardrail
|
78
|
+
# (if passed in the Converse API) assesses the entire message.
|
79
|
+
#
|
80
|
+
# For more information, see *Use a guardrail with the Converse API* in
|
81
|
+
# the *Amazon Bedrock User Guide*. </p>
|
82
|
+
# @return [Types::GuardrailConverseContentBlock]
|
83
|
+
#
|
69
84
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/ContentBlock AWS API Documentation
|
70
85
|
#
|
71
86
|
class ContentBlock < Struct.new(
|
72
87
|
:text,
|
73
88
|
:image,
|
89
|
+
:document,
|
74
90
|
:tool_use,
|
75
91
|
:tool_result,
|
92
|
+
:guard_content,
|
76
93
|
:unknown)
|
77
94
|
SENSITIVE = []
|
78
95
|
include Aws::Structure
|
@@ -80,8 +97,10 @@ module Aws::BedrockRuntime
|
|
80
97
|
|
81
98
|
class Text < ContentBlock; end
|
82
99
|
class Image < ContentBlock; end
|
100
|
+
class Document < ContentBlock; end
|
83
101
|
class ToolUse < ContentBlock; end
|
84
102
|
class ToolResult < ContentBlock; end
|
103
|
+
class GuardContent < ContentBlock; end
|
85
104
|
class Unknown < ContentBlock; end
|
86
105
|
end
|
87
106
|
|
@@ -281,6 +300,11 @@ module Aws::BedrockRuntime
|
|
281
300
|
# </note>
|
282
301
|
# @return [Types::ToolConfiguration]
|
283
302
|
#
|
303
|
+
# @!attribute [rw] guardrail_config
|
304
|
+
# Configuration information for a guardrail that you want to use in
|
305
|
+
# the request.
|
306
|
+
# @return [Types::GuardrailConfiguration]
|
307
|
+
#
|
284
308
|
# @!attribute [rw] additional_model_request_fields
|
285
309
|
# Additional inference parameters that the model supports, beyond the
|
286
310
|
# base set of inference parameters that `Converse` supports in the
|
@@ -295,7 +319,7 @@ module Aws::BedrockRuntime
|
|
295
319
|
# @!attribute [rw] additional_model_response_field_paths
|
296
320
|
# Additional model parameters field paths to return in the response.
|
297
321
|
# `Converse` returns the requested fields as a JSON Pointer object in
|
298
|
-
# the `
|
322
|
+
# the `additionalModelResponseFields` field. The following is example
|
299
323
|
# JSON for `additionalModelResponseFieldPaths`.
|
300
324
|
#
|
301
325
|
# `[ "/stop_sequence" ]`
|
@@ -321,6 +345,7 @@ module Aws::BedrockRuntime
|
|
321
345
|
:system,
|
322
346
|
:inference_config,
|
323
347
|
:tool_config,
|
348
|
+
:guardrail_config,
|
324
349
|
:additional_model_request_fields,
|
325
350
|
:additional_model_response_field_paths)
|
326
351
|
SENSITIVE = []
|
@@ -349,6 +374,11 @@ module Aws::BedrockRuntime
|
|
349
374
|
# Additional fields in the response that are unique to the model.
|
350
375
|
# @return [Hash,Array,String,Numeric,Boolean]
|
351
376
|
#
|
377
|
+
# @!attribute [rw] trace
|
378
|
+
# A trace object that contains information about the Guardrail
|
379
|
+
# behavior.
|
380
|
+
# @return [Types::ConverseTrace]
|
381
|
+
#
|
352
382
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/ConverseResponse AWS API Documentation
|
353
383
|
#
|
354
384
|
class ConverseResponse < Struct.new(
|
@@ -356,7 +386,8 @@ module Aws::BedrockRuntime
|
|
356
386
|
:stop_reason,
|
357
387
|
:usage,
|
358
388
|
:metrics,
|
359
|
-
:additional_model_response_fields
|
389
|
+
:additional_model_response_fields,
|
390
|
+
:trace)
|
360
391
|
SENSITIVE = []
|
361
392
|
include Aws::Structure
|
362
393
|
end
|
@@ -371,11 +402,17 @@ module Aws::BedrockRuntime
|
|
371
402
|
# The metrics for the conversation stream metadata event.
|
372
403
|
# @return [Types::ConverseStreamMetrics]
|
373
404
|
#
|
405
|
+
# @!attribute [rw] trace
|
406
|
+
# The trace object in the response from ConverseStream that contains
|
407
|
+
# information about the guardrail behavior.
|
408
|
+
# @return [Types::ConverseStreamTrace]
|
409
|
+
#
|
374
410
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/ConverseStreamMetadataEvent AWS API Documentation
|
375
411
|
#
|
376
412
|
class ConverseStreamMetadataEvent < Struct.new(
|
377
413
|
:usage,
|
378
414
|
:metrics,
|
415
|
+
:trace,
|
379
416
|
:event_type)
|
380
417
|
SENSITIVE = []
|
381
418
|
include Aws::Structure
|
@@ -444,6 +481,11 @@ module Aws::BedrockRuntime
|
|
444
481
|
# </note>
|
445
482
|
# @return [Types::ToolConfiguration]
|
446
483
|
#
|
484
|
+
# @!attribute [rw] guardrail_config
|
485
|
+
# Configuration information for a guardrail that you want to use in
|
486
|
+
# the request.
|
487
|
+
# @return [Types::GuardrailStreamConfiguration]
|
488
|
+
#
|
447
489
|
# @!attribute [rw] additional_model_request_fields
|
448
490
|
# Additional inference parameters that the model supports, beyond the
|
449
491
|
# base set of inference parameters that `ConverseStream` supports in
|
@@ -453,8 +495,8 @@ module Aws::BedrockRuntime
|
|
453
495
|
# @!attribute [rw] additional_model_response_field_paths
|
454
496
|
# Additional model parameters field paths to return in the response.
|
455
497
|
# `ConverseStream` returns the requested fields as a JSON Pointer
|
456
|
-
# object in the `
|
457
|
-
# example JSON for `additionalModelResponseFieldPaths`.
|
498
|
+
# object in the `additionalModelResponseFields` field. The following
|
499
|
+
# is example JSON for `additionalModelResponseFieldPaths`.
|
458
500
|
#
|
459
501
|
# `[ "/stop_sequence" ]`
|
460
502
|
#
|
@@ -479,6 +521,7 @@ module Aws::BedrockRuntime
|
|
479
521
|
:system,
|
480
522
|
:inference_config,
|
481
523
|
:tool_config,
|
524
|
+
:guardrail_config,
|
482
525
|
:additional_model_request_fields,
|
483
526
|
:additional_model_response_field_paths)
|
484
527
|
SENSITIVE = []
|
@@ -497,6 +540,462 @@ module Aws::BedrockRuntime
|
|
497
540
|
include Aws::Structure
|
498
541
|
end
|
499
542
|
|
543
|
+
# The trace object in a response from ConverseStream. Currently, you can
|
544
|
+
# only trace guardrails.
|
545
|
+
#
|
546
|
+
# @!attribute [rw] guardrail
|
547
|
+
# The guardrail trace object.
|
548
|
+
# @return [Types::GuardrailTraceAssessment]
|
549
|
+
#
|
550
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/ConverseStreamTrace AWS API Documentation
|
551
|
+
#
|
552
|
+
class ConverseStreamTrace < Struct.new(
|
553
|
+
:guardrail)
|
554
|
+
SENSITIVE = []
|
555
|
+
include Aws::Structure
|
556
|
+
end
|
557
|
+
|
558
|
+
# The trace object in a response from Converse. Currently, you can only
|
559
|
+
# trace guardrails.
|
560
|
+
#
|
561
|
+
# @!attribute [rw] guardrail
|
562
|
+
# The guardrail trace object.
|
563
|
+
# @return [Types::GuardrailTraceAssessment]
|
564
|
+
#
|
565
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/ConverseTrace AWS API Documentation
|
566
|
+
#
|
567
|
+
class ConverseTrace < Struct.new(
|
568
|
+
:guardrail)
|
569
|
+
SENSITIVE = []
|
570
|
+
include Aws::Structure
|
571
|
+
end
|
572
|
+
|
573
|
+
# A document to include in a message when sending a [Converse][1] or
|
574
|
+
# [ConverseStream][2] request. You can include up to 5 documents in a
|
575
|
+
# request. The maximum document size is 50 MB.
|
576
|
+
#
|
577
|
+
#
|
578
|
+
#
|
579
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html
|
580
|
+
# [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html
|
581
|
+
#
|
582
|
+
# @!attribute [rw] format
|
583
|
+
# The format of a document, or its extension.
|
584
|
+
# @return [String]
|
585
|
+
#
|
586
|
+
# @!attribute [rw] name
|
587
|
+
# A name for the document.
|
588
|
+
# @return [String]
|
589
|
+
#
|
590
|
+
# @!attribute [rw] source
|
591
|
+
# Contains the content of the document.
|
592
|
+
# @return [Types::DocumentSource]
|
593
|
+
#
|
594
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/DocumentBlock AWS API Documentation
|
595
|
+
#
|
596
|
+
class DocumentBlock < Struct.new(
|
597
|
+
:format,
|
598
|
+
:name,
|
599
|
+
:source)
|
600
|
+
SENSITIVE = []
|
601
|
+
include Aws::Structure
|
602
|
+
end
|
603
|
+
|
604
|
+
# Contains the content of the document included in a message when
|
605
|
+
# sending a [Converse][1] or [ConverseStream][2] request or in the
|
606
|
+
# response.
|
607
|
+
#
|
608
|
+
#
|
609
|
+
#
|
610
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html
|
611
|
+
# [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html
|
612
|
+
#
|
613
|
+
# @note DocumentSource is a union - when making an API calls you must set exactly one of the members.
|
614
|
+
#
|
615
|
+
# @note DocumentSource is a union - when returned from an API call exactly one value will be set and the returned type will be a subclass of DocumentSource corresponding to the set member.
|
616
|
+
#
|
617
|
+
# @!attribute [rw] bytes
|
618
|
+
# A base64-encoded string of a UTF-8 encoded file, that is the
|
619
|
+
# document to include in the message.
|
620
|
+
# @return [String]
|
621
|
+
#
|
622
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/DocumentSource AWS API Documentation
|
623
|
+
#
|
624
|
+
class DocumentSource < Struct.new(
|
625
|
+
:bytes,
|
626
|
+
:unknown)
|
627
|
+
SENSITIVE = []
|
628
|
+
include Aws::Structure
|
629
|
+
include Aws::Structure::Union
|
630
|
+
|
631
|
+
class Bytes < DocumentSource; end
|
632
|
+
class Unknown < DocumentSource; end
|
633
|
+
end
|
634
|
+
|
635
|
+
# A behavior assessment of the guardrail policies used in a call to the
|
636
|
+
# Converse API.
|
637
|
+
#
|
638
|
+
# @!attribute [rw] topic_policy
|
639
|
+
# The topic policy.
|
640
|
+
# @return [Types::GuardrailTopicPolicyAssessment]
|
641
|
+
#
|
642
|
+
# @!attribute [rw] content_policy
|
643
|
+
# The content policy.
|
644
|
+
# @return [Types::GuardrailContentPolicyAssessment]
|
645
|
+
#
|
646
|
+
# @!attribute [rw] word_policy
|
647
|
+
# The word policy.
|
648
|
+
# @return [Types::GuardrailWordPolicyAssessment]
|
649
|
+
#
|
650
|
+
# @!attribute [rw] sensitive_information_policy
|
651
|
+
# The sensitive information policy.
|
652
|
+
# @return [Types::GuardrailSensitiveInformationPolicyAssessment]
|
653
|
+
#
|
654
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailAssessment AWS API Documentation
|
655
|
+
#
|
656
|
+
class GuardrailAssessment < Struct.new(
|
657
|
+
:topic_policy,
|
658
|
+
:content_policy,
|
659
|
+
:word_policy,
|
660
|
+
:sensitive_information_policy)
|
661
|
+
SENSITIVE = []
|
662
|
+
include Aws::Structure
|
663
|
+
end
|
664
|
+
|
665
|
+
# Configuration information for a guardrail that you use with the
|
666
|
+
# Converse action.
|
667
|
+
#
|
668
|
+
# @!attribute [rw] guardrail_identifier
|
669
|
+
# The identifier for the guardrail.
|
670
|
+
# @return [String]
|
671
|
+
#
|
672
|
+
# @!attribute [rw] guardrail_version
|
673
|
+
# The version of the guardrail.
|
674
|
+
# @return [String]
|
675
|
+
#
|
676
|
+
# @!attribute [rw] trace
|
677
|
+
# The trace behavior for the guardrail.
|
678
|
+
# @return [String]
|
679
|
+
#
|
680
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailConfiguration AWS API Documentation
|
681
|
+
#
|
682
|
+
class GuardrailConfiguration < Struct.new(
|
683
|
+
:guardrail_identifier,
|
684
|
+
:guardrail_version,
|
685
|
+
:trace)
|
686
|
+
SENSITIVE = []
|
687
|
+
include Aws::Structure
|
688
|
+
end
|
689
|
+
|
690
|
+
# The content filter for a guardrail.
|
691
|
+
#
|
692
|
+
# @!attribute [rw] type
|
693
|
+
# The guardrail type.
|
694
|
+
# @return [String]
|
695
|
+
#
|
696
|
+
# @!attribute [rw] confidence
|
697
|
+
# The guardrail confidence.
|
698
|
+
# @return [String]
|
699
|
+
#
|
700
|
+
# @!attribute [rw] action
|
701
|
+
# The guardrail action.
|
702
|
+
# @return [String]
|
703
|
+
#
|
704
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailContentFilter AWS API Documentation
|
705
|
+
#
|
706
|
+
class GuardrailContentFilter < Struct.new(
|
707
|
+
:type,
|
708
|
+
:confidence,
|
709
|
+
:action)
|
710
|
+
SENSITIVE = []
|
711
|
+
include Aws::Structure
|
712
|
+
end
|
713
|
+
|
714
|
+
# An assessment of a content policy for a guardrail.
|
715
|
+
#
|
716
|
+
# @!attribute [rw] filters
|
717
|
+
# The content policy filters.
|
718
|
+
# @return [Array<Types::GuardrailContentFilter>]
|
719
|
+
#
|
720
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailContentPolicyAssessment AWS API Documentation
|
721
|
+
#
|
722
|
+
class GuardrailContentPolicyAssessment < Struct.new(
|
723
|
+
:filters)
|
724
|
+
SENSITIVE = []
|
725
|
+
include Aws::Structure
|
726
|
+
end
|
727
|
+
|
728
|
+
# A content block for selective guarding with the Converse API (Converse
|
729
|
+
# and ConverseStream).
|
730
|
+
#
|
731
|
+
# @note GuardrailConverseContentBlock is a union - when making an API calls you must set exactly one of the members.
|
732
|
+
#
|
733
|
+
# @note GuardrailConverseContentBlock is a union - when returned from an API call exactly one value will be set and the returned type will be a subclass of GuardrailConverseContentBlock corresponding to the set member.
|
734
|
+
#
|
735
|
+
# @!attribute [rw] text
|
736
|
+
# The text to guard.
|
737
|
+
# @return [Types::GuardrailConverseTextBlock]
|
738
|
+
#
|
739
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailConverseContentBlock AWS API Documentation
|
740
|
+
#
|
741
|
+
class GuardrailConverseContentBlock < Struct.new(
|
742
|
+
:text,
|
743
|
+
:unknown)
|
744
|
+
SENSITIVE = []
|
745
|
+
include Aws::Structure
|
746
|
+
include Aws::Structure::Union
|
747
|
+
|
748
|
+
class Text < GuardrailConverseContentBlock; end
|
749
|
+
class Unknown < GuardrailConverseContentBlock; end
|
750
|
+
end
|
751
|
+
|
752
|
+
# A text block that contains text that you want to assess with a
|
753
|
+
# guardrail. For more information, see GuardrailConverseContentBlock.
|
754
|
+
#
|
755
|
+
# @!attribute [rw] text
|
756
|
+
# The text that you want to guard.
|
757
|
+
# @return [String]
|
758
|
+
#
|
759
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailConverseTextBlock AWS API Documentation
|
760
|
+
#
|
761
|
+
class GuardrailConverseTextBlock < Struct.new(
|
762
|
+
:text)
|
763
|
+
SENSITIVE = []
|
764
|
+
include Aws::Structure
|
765
|
+
end
|
766
|
+
|
767
|
+
# A custom word configured in a guardrail.
|
768
|
+
#
|
769
|
+
# @!attribute [rw] match
|
770
|
+
# The match for the custom word.
|
771
|
+
# @return [String]
|
772
|
+
#
|
773
|
+
# @!attribute [rw] action
|
774
|
+
# The action for the custom word.
|
775
|
+
# @return [String]
|
776
|
+
#
|
777
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailCustomWord AWS API Documentation
|
778
|
+
#
|
779
|
+
class GuardrailCustomWord < Struct.new(
|
780
|
+
:match,
|
781
|
+
:action)
|
782
|
+
SENSITIVE = []
|
783
|
+
include Aws::Structure
|
784
|
+
end
|
785
|
+
|
786
|
+
# A managed word configured in a guardrail.
|
787
|
+
#
|
788
|
+
# @!attribute [rw] match
|
789
|
+
# The match for the managed word.
|
790
|
+
# @return [String]
|
791
|
+
#
|
792
|
+
# @!attribute [rw] type
|
793
|
+
# The type for the managed word.
|
794
|
+
# @return [String]
|
795
|
+
#
|
796
|
+
# @!attribute [rw] action
|
797
|
+
# The action for the managed word.
|
798
|
+
# @return [String]
|
799
|
+
#
|
800
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailManagedWord AWS API Documentation
|
801
|
+
#
|
802
|
+
class GuardrailManagedWord < Struct.new(
|
803
|
+
:match,
|
804
|
+
:type,
|
805
|
+
:action)
|
806
|
+
SENSITIVE = []
|
807
|
+
include Aws::Structure
|
808
|
+
end
|
809
|
+
|
810
|
+
# A Personally Identifiable Information (PII) entity configured in a
|
811
|
+
# guardrail.
|
812
|
+
#
|
813
|
+
# @!attribute [rw] match
|
814
|
+
# The PII entity filter match.
|
815
|
+
# @return [String]
|
816
|
+
#
|
817
|
+
# @!attribute [rw] type
|
818
|
+
# The PII entity filter type.
|
819
|
+
# @return [String]
|
820
|
+
#
|
821
|
+
# @!attribute [rw] action
|
822
|
+
# The PII entity filter action.
|
823
|
+
# @return [String]
|
824
|
+
#
|
825
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailPiiEntityFilter AWS API Documentation
|
826
|
+
#
|
827
|
+
class GuardrailPiiEntityFilter < Struct.new(
|
828
|
+
:match,
|
829
|
+
:type,
|
830
|
+
:action)
|
831
|
+
SENSITIVE = []
|
832
|
+
include Aws::Structure
|
833
|
+
end
|
834
|
+
|
835
|
+
# A Regex filter configured in a guardrail.
|
836
|
+
#
|
837
|
+
# @!attribute [rw] name
|
838
|
+
# The regex filter name.
|
839
|
+
# @return [String]
|
840
|
+
#
|
841
|
+
# @!attribute [rw] match
|
842
|
+
# The regesx filter match.
|
843
|
+
# @return [String]
|
844
|
+
#
|
845
|
+
# @!attribute [rw] regex
|
846
|
+
# The regex query.
|
847
|
+
# @return [String]
|
848
|
+
#
|
849
|
+
# @!attribute [rw] action
|
850
|
+
# The region filter action.
|
851
|
+
# @return [String]
|
852
|
+
#
|
853
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailRegexFilter AWS API Documentation
|
854
|
+
#
|
855
|
+
class GuardrailRegexFilter < Struct.new(
|
856
|
+
:name,
|
857
|
+
:match,
|
858
|
+
:regex,
|
859
|
+
:action)
|
860
|
+
SENSITIVE = []
|
861
|
+
include Aws::Structure
|
862
|
+
end
|
863
|
+
|
864
|
+
# The assessment for aPersonally Identifiable Information (PII) policy.
|
865
|
+
#
|
866
|
+
# @!attribute [rw] pii_entities
|
867
|
+
# The PII entities in the assessment.
|
868
|
+
# @return [Array<Types::GuardrailPiiEntityFilter>]
|
869
|
+
#
|
870
|
+
# @!attribute [rw] regexes
|
871
|
+
# The regex queries in the assessment.
|
872
|
+
# @return [Array<Types::GuardrailRegexFilter>]
|
873
|
+
#
|
874
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailSensitiveInformationPolicyAssessment AWS API Documentation
|
875
|
+
#
|
876
|
+
class GuardrailSensitiveInformationPolicyAssessment < Struct.new(
|
877
|
+
:pii_entities,
|
878
|
+
:regexes)
|
879
|
+
SENSITIVE = []
|
880
|
+
include Aws::Structure
|
881
|
+
end
|
882
|
+
|
883
|
+
# Configuration information for a guardrail that you use with the
|
884
|
+
# ConverseStream action.
|
885
|
+
#
|
886
|
+
# @!attribute [rw] guardrail_identifier
|
887
|
+
# The identifier for the guardrail.
|
888
|
+
# @return [String]
|
889
|
+
#
|
890
|
+
# @!attribute [rw] guardrail_version
|
891
|
+
# The version of the guardrail.
|
892
|
+
# @return [String]
|
893
|
+
#
|
894
|
+
# @!attribute [rw] trace
|
895
|
+
# The trace behavior for the guardrail.
|
896
|
+
# @return [String]
|
897
|
+
#
|
898
|
+
# @!attribute [rw] stream_processing_mode
|
899
|
+
# The processing mode.
|
900
|
+
#
|
901
|
+
# The processing mode. For more information, see *Configure streaming
|
902
|
+
# response behavior* in the *Amazon Bedrock User Guide*.
|
903
|
+
# @return [String]
|
904
|
+
#
|
905
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailStreamConfiguration AWS API Documentation
|
906
|
+
#
|
907
|
+
class GuardrailStreamConfiguration < Struct.new(
|
908
|
+
:guardrail_identifier,
|
909
|
+
:guardrail_version,
|
910
|
+
:trace,
|
911
|
+
:stream_processing_mode)
|
912
|
+
SENSITIVE = []
|
913
|
+
include Aws::Structure
|
914
|
+
end
|
915
|
+
|
916
|
+
# Information about a topic guardrail.
|
917
|
+
#
|
918
|
+
# @!attribute [rw] name
|
919
|
+
# The name for the guardrail.
|
920
|
+
# @return [String]
|
921
|
+
#
|
922
|
+
# @!attribute [rw] type
|
923
|
+
# The type behavior that the guardrail should perform when the model
|
924
|
+
# detects the topic.
|
925
|
+
# @return [String]
|
926
|
+
#
|
927
|
+
# @!attribute [rw] action
|
928
|
+
# The action the guardrail should take when it intervenes on a topic.
|
929
|
+
# @return [String]
|
930
|
+
#
|
931
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailTopic AWS API Documentation
|
932
|
+
#
|
933
|
+
class GuardrailTopic < Struct.new(
|
934
|
+
:name,
|
935
|
+
:type,
|
936
|
+
:action)
|
937
|
+
SENSITIVE = []
|
938
|
+
include Aws::Structure
|
939
|
+
end
|
940
|
+
|
941
|
+
# A behavior assessment of a topic policy.
|
942
|
+
#
|
943
|
+
# @!attribute [rw] topics
|
944
|
+
# The topics in the assessment.
|
945
|
+
# @return [Array<Types::GuardrailTopic>]
|
946
|
+
#
|
947
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailTopicPolicyAssessment AWS API Documentation
|
948
|
+
#
|
949
|
+
class GuardrailTopicPolicyAssessment < Struct.new(
|
950
|
+
:topics)
|
951
|
+
SENSITIVE = []
|
952
|
+
include Aws::Structure
|
953
|
+
end
|
954
|
+
|
955
|
+
# A Top level guardrail trace object. For more information, see
|
956
|
+
# ConverseTrace.
|
957
|
+
#
|
958
|
+
# @!attribute [rw] model_output
|
959
|
+
# The output from the model.
|
960
|
+
# @return [Array<String>]
|
961
|
+
#
|
962
|
+
# @!attribute [rw] input_assessment
|
963
|
+
# The input assessment.
|
964
|
+
# @return [Hash<String,Types::GuardrailAssessment>]
|
965
|
+
#
|
966
|
+
# @!attribute [rw] output_assessments
|
967
|
+
# the output assessments.
|
968
|
+
# @return [Hash<String,Array<Types::GuardrailAssessment>>]
|
969
|
+
#
|
970
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailTraceAssessment AWS API Documentation
|
971
|
+
#
|
972
|
+
class GuardrailTraceAssessment < Struct.new(
|
973
|
+
:model_output,
|
974
|
+
:input_assessment,
|
975
|
+
:output_assessments)
|
976
|
+
SENSITIVE = []
|
977
|
+
include Aws::Structure
|
978
|
+
end
|
979
|
+
|
980
|
+
# The word policy assessment.
|
981
|
+
#
|
982
|
+
# @!attribute [rw] custom_words
|
983
|
+
# Custom words in the assessment.
|
984
|
+
# @return [Array<Types::GuardrailCustomWord>]
|
985
|
+
#
|
986
|
+
# @!attribute [rw] managed_word_lists
|
987
|
+
# Managed word lists in the assessment.
|
988
|
+
# @return [Array<Types::GuardrailManagedWord>]
|
989
|
+
#
|
990
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/GuardrailWordPolicyAssessment AWS API Documentation
|
991
|
+
#
|
992
|
+
class GuardrailWordPolicyAssessment < Struct.new(
|
993
|
+
:custom_words,
|
994
|
+
:managed_word_lists)
|
995
|
+
SENSITIVE = []
|
996
|
+
include Aws::Structure
|
997
|
+
end
|
998
|
+
|
500
999
|
# Image content for a message.
|
501
1000
|
#
|
502
1001
|
# @!attribute [rw] format
|
@@ -559,25 +1058,7 @@ module Aws::BedrockRuntime
|
|
559
1058
|
# The maximum number of tokens to allow in the generated response. The
|
560
1059
|
# default value is the maximum allowed value for the model that you
|
561
1060
|
# are using. For more information, see [Inference parameters for
|
562
|
-
#
|
563
|
-
# \[ \\\{ "text": "what's the weather in Queens, NY and Austin,
|
564
|
-
# TX?" \\} \] \\}, \\\{ "role": "assistant", "content": \[ \\\{
|
565
|
-
# "toolUse": \\\{ "toolUseId": "1", "name": "get\_weather",
|
566
|
-
# "input": \\\{ "city": "Queens", "state": "NY" \\} \\} \\},
|
567
|
-
# \\\{ "toolUse": \\\{ "toolUseId": "2", "name":
|
568
|
-
# "get\_weather", "input": \\\{ "city": "Austin", "state":
|
569
|
-
# "TX" \\} \\} \\} \] \\}, \\\{ "role": "user", "content": \[
|
570
|
-
# \\\{ "toolResult": \\\{ "toolUseId": "2", "content": \[ \\\{
|
571
|
-
# "json": \\\{ "weather": "40" \\} \\} \] \\} \\}, \\\{
|
572
|
-
# "text": "..." \\}, \\\{ "toolResult": \\\{ "toolUseId":
|
573
|
-
# "1", "content": \[ \\\{ "text": "result text" \\} \] \\} \\}
|
574
|
-
# \] \\} \], "toolConfig": \\\{ "tools": \[ \\\{ "name":
|
575
|
-
# "get\_weather", "description": "Get weather", "inputSchema":
|
576
|
-
# \\\{ "type": "object", "properties": \\\{ "city": \\\{
|
577
|
-
# "type": "string", "description": "City of location" \\},
|
578
|
-
# "state": \\\{ "type": "string", "description": "State of
|
579
|
-
# location" \\} \\}, "required": \["city", "state"\] \\} \\} \]
|
580
|
-
# \\} \\} n models][1].
|
1061
|
+
# foundation models][1].
|
581
1062
|
#
|
582
1063
|
#
|
583
1064
|
#
|
@@ -646,10 +1127,10 @@ module Aws::BedrockRuntime
|
|
646
1127
|
|
647
1128
|
# @!attribute [rw] body
|
648
1129
|
# The prompt and inference parameters in the format specified in the
|
649
|
-
# `contentType` in the header.
|
650
|
-
#
|
651
|
-
# [Inference parameters][1]. For
|
652
|
-
# inference][2] in the Bedrock User Guide.
|
1130
|
+
# `contentType` in the header. You must provide the body in JSON
|
1131
|
+
# format. To see the format and content of the request and response
|
1132
|
+
# bodies for different models, refer to [Inference parameters][1]. For
|
1133
|
+
# more information, see [Run inference][2] in the Bedrock User Guide.
|
653
1134
|
#
|
654
1135
|
#
|
655
1136
|
#
|
@@ -658,7 +1139,7 @@ module Aws::BedrockRuntime
|
|
658
1139
|
# @return [String]
|
659
1140
|
#
|
660
1141
|
# @!attribute [rw] content_type
|
661
|
-
# The MIME type of the input data in the request.
|
1142
|
+
# The MIME type of the input data in the request. You must specify
|
662
1143
|
# `application/json`.
|
663
1144
|
# @return [String]
|
664
1145
|
#
|
@@ -757,10 +1238,10 @@ module Aws::BedrockRuntime
|
|
757
1238
|
|
758
1239
|
# @!attribute [rw] body
|
759
1240
|
# The prompt and inference parameters in the format specified in the
|
760
|
-
# `contentType` in the header.
|
761
|
-
#
|
762
|
-
# [Inference parameters][1]. For
|
763
|
-
# inference][2] in the Bedrock User Guide.
|
1241
|
+
# `contentType` in the header. You must provide the body in JSON
|
1242
|
+
# format. To see the format and content of the request and response
|
1243
|
+
# bodies for different models, refer to [Inference parameters][1]. For
|
1244
|
+
# more information, see [Run inference][2] in the Bedrock User Guide.
|
764
1245
|
#
|
765
1246
|
#
|
766
1247
|
#
|
@@ -769,7 +1250,7 @@ module Aws::BedrockRuntime
|
|
769
1250
|
# @return [String]
|
770
1251
|
#
|
771
1252
|
# @!attribute [rw] content_type
|
772
|
-
# The MIME type of the input data in the request.
|
1253
|
+
# The MIME type of the input data in the request. You must specify
|
773
1254
|
# `application/json`.
|
774
1255
|
# @return [String]
|
775
1256
|
#
|
@@ -865,13 +1346,13 @@ module Aws::BedrockRuntime
|
|
865
1346
|
include Aws::Structure
|
866
1347
|
end
|
867
1348
|
|
868
|
-
# A message
|
869
|
-
#
|
1349
|
+
# A message input, or returned from, a call to [Converse][1] or
|
1350
|
+
# [ConverseStream][2].
|
870
1351
|
#
|
871
1352
|
#
|
872
1353
|
#
|
873
|
-
# [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/
|
874
|
-
# [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/
|
1354
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html
|
1355
|
+
# [2]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html
|
875
1356
|
#
|
876
1357
|
# @!attribute [rw] role
|
877
1358
|
# The role that the message plays in the message.
|
@@ -1044,7 +1525,8 @@ module Aws::BedrockRuntime
|
|
1044
1525
|
include Aws::Structure
|
1045
1526
|
end
|
1046
1527
|
|
1047
|
-
# The model must request a specific tool.
|
1528
|
+
# The model must request a specific tool. For example, `\{"tool" :
|
1529
|
+
# \{"name" : "Your tool name"\}\}`.
|
1048
1530
|
#
|
1049
1531
|
# <note markdown="1"> This field is only supported by Anthropic Claude 3 models.
|
1050
1532
|
#
|
@@ -1062,7 +1544,7 @@ module Aws::BedrockRuntime
|
|
1062
1544
|
include Aws::Structure
|
1063
1545
|
end
|
1064
1546
|
|
1065
|
-
# A system content block
|
1547
|
+
# A system content block.
|
1066
1548
|
#
|
1067
1549
|
# @note SystemContentBlock is a union - when making an API calls you must set exactly one of the members.
|
1068
1550
|
#
|
@@ -1070,16 +1552,26 @@ module Aws::BedrockRuntime
|
|
1070
1552
|
# A system prompt for the model.
|
1071
1553
|
# @return [String]
|
1072
1554
|
#
|
1555
|
+
# @!attribute [rw] guard_content
|
1556
|
+
# A content block to assess with the guardrail. Use with the Converse
|
1557
|
+
# API (Converse and ConverseStream).
|
1558
|
+
#
|
1559
|
+
# For more information, see *Use a guardrail with the Converse API* in
|
1560
|
+
# the *Amazon Bedrock User Guide*.
|
1561
|
+
# @return [Types::GuardrailConverseContentBlock]
|
1562
|
+
#
|
1073
1563
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/SystemContentBlock AWS API Documentation
|
1074
1564
|
#
|
1075
1565
|
class SystemContentBlock < Struct.new(
|
1076
1566
|
:text,
|
1567
|
+
:guard_content,
|
1077
1568
|
:unknown)
|
1078
1569
|
SENSITIVE = []
|
1079
1570
|
include Aws::Structure
|
1080
1571
|
include Aws::Structure::Union
|
1081
1572
|
|
1082
1573
|
class Text < SystemContentBlock; end
|
1574
|
+
class GuardContent < SystemContentBlock; end
|
1083
1575
|
class Unknown < SystemContentBlock; end
|
1084
1576
|
end
|
1085
1577
|
|
@@ -1142,13 +1634,15 @@ module Aws::BedrockRuntime
|
|
1142
1634
|
class Unknown < Tool; end
|
1143
1635
|
end
|
1144
1636
|
|
1145
|
-
#
|
1637
|
+
# Determines which tools the model should request in a call to
|
1638
|
+
# `Converse` or `ConverseStream`. `ToolChoice` is only supported by
|
1639
|
+
# Anthropic Claude 3 models and by Mistral AI Mistral Large.
|
1146
1640
|
#
|
1147
1641
|
# @note ToolChoice is a union - when making an API calls you must set exactly one of the members.
|
1148
1642
|
#
|
1149
1643
|
# @!attribute [rw] auto
|
1150
|
-
# The Model automatically decides if a tool should be
|
1151
|
-
# whether to generate text instead.
|
1644
|
+
# (Default). The Model automatically decides if a tool should be
|
1645
|
+
# called or whether to generate text instead.
|
1152
1646
|
# @return [Types::AutoToolChoice]
|
1153
1647
|
#
|
1154
1648
|
# @!attribute [rw] any
|
@@ -1156,7 +1650,8 @@ module Aws::BedrockRuntime
|
|
1156
1650
|
# @return [Types::AnyToolChoice]
|
1157
1651
|
#
|
1158
1652
|
# @!attribute [rw] tool
|
1159
|
-
# The Model must request the specified tool.
|
1653
|
+
# The Model must request the specified tool. Only supported by
|
1654
|
+
# Anthropic Claude 3 models.
|
1160
1655
|
# @return [Types::SpecificToolChoice]
|
1161
1656
|
#
|
1162
1657
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/ToolChoice AWS API Documentation
|
@@ -1277,12 +1772,17 @@ module Aws::BedrockRuntime
|
|
1277
1772
|
# </note>
|
1278
1773
|
# @return [Types::ImageBlock]
|
1279
1774
|
#
|
1775
|
+
# @!attribute [rw] document
|
1776
|
+
# A tool result that is a document.
|
1777
|
+
# @return [Types::DocumentBlock]
|
1778
|
+
#
|
1280
1779
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/ToolResultContentBlock AWS API Documentation
|
1281
1780
|
#
|
1282
1781
|
class ToolResultContentBlock < Struct.new(
|
1283
1782
|
:json,
|
1284
1783
|
:text,
|
1285
1784
|
:image,
|
1785
|
+
:document,
|
1286
1786
|
:unknown)
|
1287
1787
|
SENSITIVE = []
|
1288
1788
|
include Aws::Structure
|
@@ -1291,6 +1791,7 @@ module Aws::BedrockRuntime
|
|
1291
1791
|
class Json < ToolResultContentBlock; end
|
1292
1792
|
class Text < ToolResultContentBlock; end
|
1293
1793
|
class Image < ToolResultContentBlock; end
|
1794
|
+
class Document < ToolResultContentBlock; end
|
1294
1795
|
class Unknown < ToolResultContentBlock; end
|
1295
1796
|
end
|
1296
1797
|
|