aws-sdk-bedrockruntime 1.4.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e47aba4aaaef4d803a0830d5bae55f9f5eef29e9c45c8c32ff8947c66c5437f2
4
- data.tar.gz: cc26cecb150bc309daf5105d6b2ca9c5f3d61bd0fe55d12955d4883af35e450b
3
+ metadata.gz: 05ac5cf213225401dee8f1d85bd87baca64269050aa19649e39fed908f5fce68
4
+ data.tar.gz: 121c36482bd45e94e7dbac139e68dd848c29a16617ed13a3035a707cd44f7ed5
5
5
  SHA512:
6
- metadata.gz: cc87bab9d2a5ec57c4d63739449d4628430130018c225e191116358aa90b11e79812b1185bda6012ba768897f912498a96fc0effeaaa65e5b530c5f7e96f4696
7
- data.tar.gz: d0a44c08b6c16f714413d2dd07f02897ac948f6daea73a678945230e1cbd46c506c03a7dfec44ba485a58795efcff11d30b5828bf875b49cda68f15cf02edc1b
6
+ metadata.gz: 8f2af4974cc0e698f31d104c9eb93cdac14deb00ce6a6dfb99c1d21549eb78410bea396dde2e7035f5d97a27f87afb282969b6d2946d4453dc92691d79af81c3
7
+ data.tar.gz: 2f74aa9635507203db1f7f5f38406b1018fa6aca5fcceff772dddd1b46102484fd55039351d38cc2a01f2b17e47d457ac710eaa3ef649f520fed94db4a7c0c78
data/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.6.0 (2024-04-23)
5
+ ------------------
6
+
7
+ * Feature - This release introduces Guardrails for Amazon Bedrock.
8
+
9
+ 1.5.0 (2024-01-26)
10
+ ------------------
11
+
12
+ * Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
13
+
4
14
  1.4.0 (2023-11-28)
5
15
  ------------------
6
16
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.0
1
+ 1.6.0
@@ -399,27 +399,27 @@ module Aws::BedrockRuntime
399
399
 
400
400
  # @!group API Operations
401
401
 
402
- # Invokes the specified Bedrock model to run inference using the input
403
- # provided in the request body. You use InvokeModel to run inference for
404
- # text models, image models, and embedding models.
402
+ # Invokes the specified Amazon Bedrock model to run inference using the
403
+ # prompt and inference parameters provided in the request body. You use
404
+ # model inference to generate text, images, and embeddings.
405
405
  #
406
- # For more information, see [Run inference][1] in the Bedrock User
407
- # Guide.
406
+ # For example code, see *Invoke model code examples* in the *Amazon
407
+ # Bedrock User Guide*.
408
408
  #
409
- # For example requests, see Examples (after the Errors section).
410
- #
411
- #
412
- #
413
- # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html
409
+ # This operation requires permission for the `bedrock:InvokeModel`
410
+ # action.
414
411
  #
415
412
  # @option params [required, String, StringIO, File] :body
416
- # Input data in the format specified in the content-type request header.
417
- # To see the format and content of this field for different models,
418
- # refer to [Inference parameters][1].
413
+ # The prompt and inference parameters in the format specified in the
414
+ # `contentType` in the header. To see the format and content of the
415
+ # request and response bodies for different models, refer to [Inference
416
+ # parameters][1]. For more information, see [Run inference][2] in the
417
+ # Bedrock User Guide.
419
418
  #
420
419
  #
421
420
  #
422
421
  # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html
422
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html
423
423
  #
424
424
  # @option params [String] :content_type
425
425
  # The MIME type of the input data in the request. The default value is
@@ -430,7 +430,50 @@ module Aws::BedrockRuntime
430
430
  # default value is `application/json`.
431
431
  #
432
432
  # @option params [required, String] :model_id
433
- # Identifier of the model.
433
+ # The unique identifier of the model to invoke to run inference.
434
+ #
435
+ # The `modelId` to provide depends on the type of model that you use:
436
+ #
437
+ # * If you use a base model, specify the model ID or its ARN. For a list
438
+ # of model IDs for base models, see [Amazon Bedrock base model IDs
439
+ # (on-demand throughput)][1] in the Amazon Bedrock User Guide.
440
+ #
441
+ # * If you use a provisioned model, specify the ARN of the Provisioned
442
+ # Throughput. For more information, see [Run inference using a
443
+ # Provisioned Throughput][2] in the Amazon Bedrock User Guide.
444
+ #
445
+ # * If you use a custom model, first purchase Provisioned Throughput for
446
+ # it. Then specify the ARN of the resulting provisioned model. For
447
+ # more information, see [Use a custom model in Amazon Bedrock][3] in
448
+ # the Amazon Bedrock User Guide.
449
+ #
450
+ #
451
+ #
452
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns
453
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html
454
+ # [3]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html
455
+ #
456
+ # @option params [String] :trace
457
+ # Specifies whether to enable or disable the Bedrock trace. If enabled,
458
+ # you can see the full Bedrock trace.
459
+ #
460
+ # @option params [String] :guardrail_identifier
461
+ # The unique identifier of the guardrail that you want to use. If you
462
+ # don't provide a value, no guardrail is applied to the invocation.
463
+ #
464
+ # An error will be thrown in the following situations.
465
+ #
466
+ # * You don't provide a guardrail identifier but you specify the
467
+ # `amazon-bedrock-guardrailConfig` field in the request body.
468
+ #
469
+ # * You enable the guardrail but the `contentType` isn't
470
+ # `application/json`.
471
+ #
472
+ # * You provide a guardrail identifier, but `guardrailVersion` isn't
473
+ # specified.
474
+ #
475
+ # @option params [String] :guardrail_version
476
+ # The version number for the guardrail. The value can also be `DRAFT`.
434
477
  #
435
478
  # @return [Types::InvokeModelResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
436
479
  #
@@ -444,6 +487,9 @@ module Aws::BedrockRuntime
444
487
  # content_type: "MimeType",
445
488
  # accept: "MimeType",
446
489
  # model_id: "InvokeModelIdentifier", # required
490
+ # trace: "ENABLED", # accepts ENABLED, DISABLED
491
+ # guardrail_identifier: "GuardrailIdentifier",
492
+ # guardrail_version: "GuardrailVersion",
447
493
  # })
448
494
  #
449
495
  # @example Response structure
@@ -460,27 +506,38 @@ module Aws::BedrockRuntime
460
506
  req.send_request(options)
461
507
  end
462
508
 
463
- # Invoke the specified Bedrock model to run inference using the input
464
- # provided. Return the response in a stream.
509
+ # Invoke the specified Amazon Bedrock model to run inference using the
510
+ # prompt and inference parameters provided in the request body. The
511
+ # response is returned in a stream.
465
512
  #
466
- # For more information, see [Run inference][1] in the Bedrock User
467
- # Guide.
513
+ # To see if a model supports streaming, call [GetFoundationModel][1] and
514
+ # check the `responseStreamingSupported` field in the response.
468
515
  #
469
- # For an example request and response, see Examples (after the Errors
470
- # section).
516
+ # <note markdown="1"> The CLI doesn't support `InvokeModelWithResponseStream`.
471
517
  #
518
+ # </note>
472
519
  #
520
+ # For example code, see *Invoke model with streaming code example* in
521
+ # the *Amazon Bedrock User Guide*.
473
522
  #
474
- # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html
523
+ # This operation requires permissions to perform the
524
+ # `bedrock:InvokeModelWithResponseStream` action.
525
+ #
526
+ #
527
+ #
528
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetFoundationModel.html
475
529
  #
476
530
  # @option params [required, String, StringIO, File] :body
477
- # Inference input in the format specified by the content-type. To see
478
- # the format and content of this field for different models, refer to
479
- # [Inference parameters][1].
531
+ # The prompt and inference parameters in the format specified in the
532
+ # `contentType` in the header. To see the format and content of the
533
+ # request and response bodies for different models, refer to [Inference
534
+ # parameters][1]. For more information, see [Run inference][2] in the
535
+ # Bedrock User Guide.
480
536
  #
481
537
  #
482
538
  #
483
539
  # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html
540
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html
484
541
  #
485
542
  # @option params [String] :content_type
486
543
  # The MIME type of the input data in the request. The default value is
@@ -491,7 +548,50 @@ module Aws::BedrockRuntime
491
548
  # default value is `application/json`.
492
549
  #
493
550
  # @option params [required, String] :model_id
494
- # Id of the model to invoke using the streaming request.
551
+ # The unique identifier of the model to invoke to run inference.
552
+ #
553
+ # The `modelId` to provide depends on the type of model that you use:
554
+ #
555
+ # * If you use a base model, specify the model ID or its ARN. For a list
556
+ # of model IDs for base models, see [Amazon Bedrock base model IDs
557
+ # (on-demand throughput)][1] in the Amazon Bedrock User Guide.
558
+ #
559
+ # * If you use a provisioned model, specify the ARN of the Provisioned
560
+ # Throughput. For more information, see [Run inference using a
561
+ # Provisioned Throughput][2] in the Amazon Bedrock User Guide.
562
+ #
563
+ # * If you use a custom model, first purchase Provisioned Throughput for
564
+ # it. Then specify the ARN of the resulting provisioned model. For
565
+ # more information, see [Use a custom model in Amazon Bedrock][3] in
566
+ # the Amazon Bedrock User Guide.
567
+ #
568
+ #
569
+ #
570
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns
571
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html
572
+ # [3]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html
573
+ #
574
+ # @option params [String] :trace
575
+ # Specifies whether to enable or disable the Bedrock trace. If enabled,
576
+ # you can see the full Bedrock trace.
577
+ #
578
+ # @option params [String] :guardrail_identifier
579
+ # The unique identifier of the guardrail that you want to use. If you
580
+ # don't provide a value, no guardrail is applied to the invocation.
581
+ #
582
+ # An error is thrown in the following situations.
583
+ #
584
+ # * You don't provide a guardrail identifier but you specify the
585
+ # `amazon-bedrock-guardrailConfig` field in the request body.
586
+ #
587
+ # * You enable the guardrail but the `contentType` isn't
588
+ # `application/json`.
589
+ #
590
+ # * You provide a guardrail identifier, but `guardrailVersion` isn't
591
+ # specified.
592
+ #
593
+ # @option params [String] :guardrail_version
594
+ # The version number for the guardrail. The value can also be `DRAFT`.
495
595
  #
496
596
  # @return [Types::InvokeModelWithResponseStreamResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
497
597
  #
@@ -634,6 +734,9 @@ module Aws::BedrockRuntime
634
734
  # content_type: "MimeType",
635
735
  # accept: "MimeType",
636
736
  # model_id: "InvokeModelIdentifier", # required
737
+ # trace: "ENABLED", # accepts ENABLED, DISABLED
738
+ # guardrail_identifier: "GuardrailIdentifier",
739
+ # guardrail_version: "GuardrailVersion",
637
740
  # })
638
741
  #
639
742
  # @example Response structure
@@ -704,7 +807,7 @@ module Aws::BedrockRuntime
704
807
  params: params,
705
808
  config: config)
706
809
  context[:gem_name] = 'aws-sdk-bedrockruntime'
707
- context[:gem_version] = '1.4.0'
810
+ context[:gem_version] = '1.6.0'
708
811
  Seahorse::Client::Request.new(handlers, context)
709
812
  end
710
813
 
@@ -15,6 +15,8 @@ module Aws::BedrockRuntime
15
15
 
16
16
  AccessDeniedException = Shapes::StructureShape.new(name: 'AccessDeniedException')
17
17
  Body = Shapes::BlobShape.new(name: 'Body')
18
+ GuardrailIdentifier = Shapes::StringShape.new(name: 'GuardrailIdentifier')
19
+ GuardrailVersion = Shapes::StringShape.new(name: 'GuardrailVersion')
18
20
  InternalServerException = Shapes::StructureShape.new(name: 'InternalServerException')
19
21
  InvokeModelIdentifier = Shapes::StringShape.new(name: 'InvokeModelIdentifier')
20
22
  InvokeModelRequest = Shapes::StructureShape.new(name: 'InvokeModelRequest')
@@ -34,6 +36,7 @@ module Aws::BedrockRuntime
34
36
  ServiceQuotaExceededException = Shapes::StructureShape.new(name: 'ServiceQuotaExceededException')
35
37
  StatusCode = Shapes::IntegerShape.new(name: 'StatusCode')
36
38
  ThrottlingException = Shapes::StructureShape.new(name: 'ThrottlingException')
39
+ Trace = Shapes::StringShape.new(name: 'Trace')
37
40
  ValidationException = Shapes::StructureShape.new(name: 'ValidationException')
38
41
 
39
42
  AccessDeniedException.add_member(:message, Shapes::ShapeRef.new(shape: NonBlankString, location_name: "message"))
@@ -46,6 +49,9 @@ module Aws::BedrockRuntime
46
49
  InvokeModelRequest.add_member(:content_type, Shapes::ShapeRef.new(shape: MimeType, location: "header", location_name: "Content-Type"))
47
50
  InvokeModelRequest.add_member(:accept, Shapes::ShapeRef.new(shape: MimeType, location: "header", location_name: "Accept"))
48
51
  InvokeModelRequest.add_member(:model_id, Shapes::ShapeRef.new(shape: InvokeModelIdentifier, required: true, location: "uri", location_name: "modelId"))
52
+ InvokeModelRequest.add_member(:trace, Shapes::ShapeRef.new(shape: Trace, location: "header", location_name: "X-Amzn-Bedrock-Trace"))
53
+ InvokeModelRequest.add_member(:guardrail_identifier, Shapes::ShapeRef.new(shape: GuardrailIdentifier, location: "header", location_name: "X-Amzn-Bedrock-GuardrailIdentifier"))
54
+ InvokeModelRequest.add_member(:guardrail_version, Shapes::ShapeRef.new(shape: GuardrailVersion, location: "header", location_name: "X-Amzn-Bedrock-GuardrailVersion"))
49
55
  InvokeModelRequest.struct_class = Types::InvokeModelRequest
50
56
  InvokeModelRequest[:payload] = :body
51
57
  InvokeModelRequest[:payload_member] = InvokeModelRequest.member(:body)
@@ -60,6 +66,9 @@ module Aws::BedrockRuntime
60
66
  InvokeModelWithResponseStreamRequest.add_member(:content_type, Shapes::ShapeRef.new(shape: MimeType, location: "header", location_name: "Content-Type"))
61
67
  InvokeModelWithResponseStreamRequest.add_member(:accept, Shapes::ShapeRef.new(shape: MimeType, location: "header", location_name: "X-Amzn-Bedrock-Accept"))
62
68
  InvokeModelWithResponseStreamRequest.add_member(:model_id, Shapes::ShapeRef.new(shape: InvokeModelIdentifier, required: true, location: "uri", location_name: "modelId"))
69
+ InvokeModelWithResponseStreamRequest.add_member(:trace, Shapes::ShapeRef.new(shape: Trace, location: "header", location_name: "X-Amzn-Bedrock-Trace"))
70
+ InvokeModelWithResponseStreamRequest.add_member(:guardrail_identifier, Shapes::ShapeRef.new(shape: GuardrailIdentifier, location: "header", location_name: "X-Amzn-Bedrock-GuardrailIdentifier"))
71
+ InvokeModelWithResponseStreamRequest.add_member(:guardrail_version, Shapes::ShapeRef.new(shape: GuardrailVersion, location: "header", location_name: "X-Amzn-Bedrock-GuardrailVersion"))
63
72
  InvokeModelWithResponseStreamRequest.struct_class = Types::InvokeModelWithResponseStreamRequest
64
73
  InvokeModelWithResponseStreamRequest[:payload] = :body
65
74
  InvokeModelWithResponseStreamRequest[:payload_member] = InvokeModelWithResponseStreamRequest.member(:body)
@@ -14,6 +14,7 @@ module Aws::BedrockRuntime
14
14
  option(
15
15
  :endpoint_provider,
16
16
  doc_type: 'Aws::BedrockRuntime::EndpointProvider',
17
+ rbs_type: 'untyped',
17
18
  docstring: 'The endpoint provider used to resolve endpoints. Any '\
18
19
  'object that responds to `#resolve_endpoint(parameters)` '\
19
20
  'where `parameters` is a Struct similar to '\
@@ -38,13 +38,16 @@ module Aws::BedrockRuntime
38
38
  end
39
39
 
40
40
  # @!attribute [rw] body
41
- # Input data in the format specified in the content-type request
42
- # header. To see the format and content of this field for different
43
- # models, refer to [Inference parameters][1].
41
+ # The prompt and inference parameters in the format specified in the
42
+ # `contentType` in the header. To see the format and content of the
43
+ # request and response bodies for different models, refer to
44
+ # [Inference parameters][1]. For more information, see [Run
45
+ # inference][2] in the Bedrock User Guide.
44
46
  #
45
47
  #
46
48
  #
47
49
  # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html
50
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html
48
51
  # @return [String]
49
52
  #
50
53
  # @!attribute [rw] content_type
@@ -58,7 +61,53 @@ module Aws::BedrockRuntime
58
61
  # @return [String]
59
62
  #
60
63
  # @!attribute [rw] model_id
61
- # Identifier of the model.
64
+ # The unique identifier of the model to invoke to run inference.
65
+ #
66
+ # The `modelId` to provide depends on the type of model that you use:
67
+ #
68
+ # * If you use a base model, specify the model ID or its ARN. For a
69
+ # list of model IDs for base models, see [Amazon Bedrock base model
70
+ # IDs (on-demand throughput)][1] in the Amazon Bedrock User Guide.
71
+ #
72
+ # * If you use a provisioned model, specify the ARN of the Provisioned
73
+ # Throughput. For more information, see [Run inference using a
74
+ # Provisioned Throughput][2] in the Amazon Bedrock User Guide.
75
+ #
76
+ # * If you use a custom model, first purchase Provisioned Throughput
77
+ # for it. Then specify the ARN of the resulting provisioned model.
78
+ # For more information, see [Use a custom model in Amazon
79
+ # Bedrock][3] in the Amazon Bedrock User Guide.
80
+ #
81
+ #
82
+ #
83
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns
84
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html
85
+ # [3]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html
86
+ # @return [String]
87
+ #
88
+ # @!attribute [rw] trace
89
+ # Specifies whether to enable or disable the Bedrock trace. If
90
+ # enabled, you can see the full Bedrock trace.
91
+ # @return [String]
92
+ #
93
+ # @!attribute [rw] guardrail_identifier
94
+ # The unique identifier of the guardrail that you want to use. If you
95
+ # don't provide a value, no guardrail is applied to the invocation.
96
+ #
97
+ # An error will be thrown in the following situations.
98
+ #
99
+ # * You don't provide a guardrail identifier but you specify the
100
+ # `amazon-bedrock-guardrailConfig` field in the request body.
101
+ #
102
+ # * You enable the guardrail but the `contentType` isn't
103
+ # `application/json`.
104
+ #
105
+ # * You provide a guardrail identifier, but `guardrailVersion` isn't
106
+ # specified.
107
+ # @return [String]
108
+ #
109
+ # @!attribute [rw] guardrail_version
110
+ # The version number for the guardrail. The value can also be `DRAFT`.
62
111
  # @return [String]
63
112
  #
64
113
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModelRequest AWS API Documentation
@@ -67,15 +116,19 @@ module Aws::BedrockRuntime
67
116
  :body,
68
117
  :content_type,
69
118
  :accept,
70
- :model_id)
119
+ :model_id,
120
+ :trace,
121
+ :guardrail_identifier,
122
+ :guardrail_version)
71
123
  SENSITIVE = [:body]
72
124
  include Aws::Structure
73
125
  end
74
126
 
75
127
  # @!attribute [rw] body
76
128
  # Inference response from the model in the format specified in the
77
- # content-type header field. To see the format and content of this
78
- # field for different models, refer to [Inference parameters][1].
129
+ # `contentType` header. To see the format and content of the request
130
+ # and response bodies for different models, refer to [Inference
131
+ # parameters][1].
79
132
  #
80
133
  #
81
134
  #
@@ -96,13 +149,16 @@ module Aws::BedrockRuntime
96
149
  end
97
150
 
98
151
  # @!attribute [rw] body
99
- # Inference input in the format specified by the content-type. To see
100
- # the format and content of this field for different models, refer to
101
- # [Inference parameters][1].
152
+ # The prompt and inference parameters in the format specified in the
153
+ # `contentType` in the header. To see the format and content of the
154
+ # request and response bodies for different models, refer to
155
+ # [Inference parameters][1]. For more information, see [Run
156
+ # inference][2] in the Bedrock User Guide.
102
157
  #
103
158
  #
104
159
  #
105
160
  # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html
161
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html
106
162
  # @return [String]
107
163
  #
108
164
  # @!attribute [rw] content_type
@@ -116,7 +172,53 @@ module Aws::BedrockRuntime
116
172
  # @return [String]
117
173
  #
118
174
  # @!attribute [rw] model_id
119
- # Id of the model to invoke using the streaming request.
175
+ # The unique identifier of the model to invoke to run inference.
176
+ #
177
+ # The `modelId` to provide depends on the type of model that you use:
178
+ #
179
+ # * If you use a base model, specify the model ID or its ARN. For a
180
+ # list of model IDs for base models, see [Amazon Bedrock base model
181
+ # IDs (on-demand throughput)][1] in the Amazon Bedrock User Guide.
182
+ #
183
+ # * If you use a provisioned model, specify the ARN of the Provisioned
184
+ # Throughput. For more information, see [Run inference using a
185
+ # Provisioned Throughput][2] in the Amazon Bedrock User Guide.
186
+ #
187
+ # * If you use a custom model, first purchase Provisioned Throughput
188
+ # for it. Then specify the ARN of the resulting provisioned model.
189
+ # For more information, see [Use a custom model in Amazon
190
+ # Bedrock][3] in the Amazon Bedrock User Guide.
191
+ #
192
+ #
193
+ #
194
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns
195
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html
196
+ # [3]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html
197
+ # @return [String]
198
+ #
199
+ # @!attribute [rw] trace
200
+ # Specifies whether to enable or disable the Bedrock trace. If
201
+ # enabled, you can see the full Bedrock trace.
202
+ # @return [String]
203
+ #
204
+ # @!attribute [rw] guardrail_identifier
205
+ # The unique identifier of the guardrail that you want to use. If you
206
+ # don't provide a value, no guardrail is applied to the invocation.
207
+ #
208
+ # An error is thrown in the following situations.
209
+ #
210
+ # * You don't provide a guardrail identifier but you specify the
211
+ # `amazon-bedrock-guardrailConfig` field in the request body.
212
+ #
213
+ # * You enable the guardrail but the `contentType` isn't
214
+ # `application/json`.
215
+ #
216
+ # * You provide a guardrail identifier, but `guardrailVersion` isn't
217
+ # specified.
218
+ # @return [String]
219
+ #
220
+ # @!attribute [rw] guardrail_version
221
+ # The version number for the guardrail. The value can also be `DRAFT`.
120
222
  # @return [String]
121
223
  #
122
224
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModelWithResponseStreamRequest AWS API Documentation
@@ -125,15 +227,18 @@ module Aws::BedrockRuntime
125
227
  :body,
126
228
  :content_type,
127
229
  :accept,
128
- :model_id)
230
+ :model_id,
231
+ :trace,
232
+ :guardrail_identifier,
233
+ :guardrail_version)
129
234
  SENSITIVE = [:body]
130
235
  include Aws::Structure
131
236
  end
132
237
 
133
238
  # @!attribute [rw] body
134
- # Inference response from the model in the format specified by
135
- # Content-Type. To see the format and content of this field for
136
- # different models, refer to [Inference parameters][1].
239
+ # Inference response from the model in the format specified by the
240
+ # `contentType` header. To see the format and content of this field
241
+ # for different models, refer to [Inference parameters][1].
137
242
  #
138
243
  #
139
244
  #
@@ -190,7 +295,7 @@ module Aws::BedrockRuntime
190
295
  include Aws::Structure
191
296
  end
192
297
 
193
- # An error occurred while streaming the response.
298
+ # An error occurred while streaming the response. Retry your request.
194
299
  #
195
300
  # @!attribute [rw] message
196
301
  # @return [String]
@@ -54,6 +54,6 @@ require_relative 'aws-sdk-bedrockruntime/event_streams'
54
54
  # @!group service
55
55
  module Aws::BedrockRuntime
56
56
 
57
- GEM_VERSION = '1.4.0'
57
+ GEM_VERSION = '1.6.0'
58
58
 
59
59
  end
data/sig/client.rbs ADDED
@@ -0,0 +1,114 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws
9
+ module BedrockRuntime
10
+ class Client < ::Seahorse::Client::Base
11
+ include ::Aws::ClientStubs
12
+
13
+ # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/BedrockRuntime/Client.html#initialize-instance_method
14
+ def self.new: (
15
+ ?credentials: untyped,
16
+ ?region: String,
17
+ ?access_key_id: String,
18
+ ?active_endpoint_cache: bool,
19
+ ?adaptive_retry_wait_to_fill: bool,
20
+ ?client_side_monitoring: bool,
21
+ ?client_side_monitoring_client_id: String,
22
+ ?client_side_monitoring_host: String,
23
+ ?client_side_monitoring_port: Integer,
24
+ ?client_side_monitoring_publisher: untyped,
25
+ ?convert_params: bool,
26
+ ?correct_clock_skew: bool,
27
+ ?defaults_mode: String,
28
+ ?disable_host_prefix_injection: bool,
29
+ ?disable_request_compression: bool,
30
+ ?endpoint: String,
31
+ ?endpoint_cache_max_entries: Integer,
32
+ ?endpoint_cache_max_threads: Integer,
33
+ ?endpoint_cache_poll_interval: Integer,
34
+ ?endpoint_discovery: bool,
35
+ ?event_stream_handler: Proc,
36
+ ?ignore_configured_endpoint_urls: bool,
37
+ ?input_event_stream_handler: Proc,
38
+ ?log_formatter: untyped,
39
+ ?log_level: Symbol,
40
+ ?logger: untyped,
41
+ ?max_attempts: Integer,
42
+ ?output_event_stream_handler: Proc,
43
+ ?profile: String,
44
+ ?request_min_compression_size_bytes: Integer,
45
+ ?retry_backoff: Proc,
46
+ ?retry_base_delay: Float,
47
+ ?retry_jitter: (:none | :equal | :full | ^(Integer) -> Integer),
48
+ ?retry_limit: Integer,
49
+ ?retry_max_delay: Integer,
50
+ ?retry_mode: ("legacy" | "standard" | "adaptive"),
51
+ ?sdk_ua_app_id: String,
52
+ ?secret_access_key: String,
53
+ ?session_token: String,
54
+ ?stub_responses: untyped,
55
+ ?token_provider: untyped,
56
+ ?use_dualstack_endpoint: bool,
57
+ ?use_fips_endpoint: bool,
58
+ ?validate_params: bool,
59
+ ?endpoint_provider: untyped,
60
+ ?http_proxy: String,
61
+ ?http_open_timeout: (Float | Integer),
62
+ ?http_read_timeout: (Float | Integer),
63
+ ?http_idle_timeout: (Float | Integer),
64
+ ?http_continue_timeout: (Float | Integer),
65
+ ?ssl_timeout: (Float | Integer | nil),
66
+ ?http_wire_trace: bool,
67
+ ?ssl_verify_peer: bool,
68
+ ?ssl_ca_bundle: String,
69
+ ?ssl_ca_directory: String,
70
+ ?ssl_ca_store: String,
71
+ ?on_chunk_received: Proc,
72
+ ?on_chunk_sent: Proc,
73
+ ?raise_response_errors: bool
74
+ ) -> instance
75
+ | (?Hash[Symbol, untyped]) -> instance
76
+
77
+
78
+ interface _InvokeModelResponseSuccess
79
+ include ::Seahorse::Client::_ResponseSuccess[Types::InvokeModelResponse]
80
+ def body: () -> ::String
81
+ def content_type: () -> ::String
82
+ end
83
+ # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/BedrockRuntime/Client.html#invoke_model-instance_method
84
+ def invoke_model: (
85
+ body: ::String,
86
+ ?content_type: ::String,
87
+ ?accept: ::String,
88
+ model_id: ::String,
89
+ ?trace: ("ENABLED" | "DISABLED"),
90
+ ?guardrail_identifier: ::String,
91
+ ?guardrail_version: ::String
92
+ ) -> _InvokeModelResponseSuccess
93
+ | (Hash[Symbol, untyped] params, ?Hash[Symbol, untyped] options) -> _InvokeModelResponseSuccess
94
+
95
+ interface _InvokeModelWithResponseStreamResponseSuccess
96
+ include ::Seahorse::Client::_ResponseSuccess[Types::InvokeModelWithResponseStreamResponse]
97
+ def body: () -> Types::ResponseStream
98
+ def content_type: () -> ::String
99
+ end
100
+ # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/BedrockRuntime/Client.html#invoke_model_with_response_stream-instance_method
101
+ def invoke_model_with_response_stream: (
102
+ body: ::String,
103
+ ?content_type: ::String,
104
+ ?accept: ::String,
105
+ model_id: ::String,
106
+ ?trace: ("ENABLED" | "DISABLED"),
107
+ ?guardrail_identifier: ::String,
108
+ ?guardrail_version: ::String
109
+ ) ?{ (*untyped) -> void } -> _InvokeModelWithResponseStreamResponseSuccess
110
+ | (Hash[Symbol, untyped] params, ?Hash[Symbol, untyped] options) ?{ (*untyped) -> void } -> _InvokeModelWithResponseStreamResponseSuccess
111
+ end
112
+ end
113
+ end
114
+
data/sig/errors.rbs ADDED
@@ -0,0 +1,50 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws
9
+ module BedrockRuntime
10
+ module Errors
11
+ class ServiceError < ::Aws::Errors::ServiceError
12
+ end
13
+
14
+ class AccessDeniedException < ::Aws::Errors::ServiceError
15
+ def message: () -> ::String
16
+ end
17
+ class InternalServerException < ::Aws::Errors::ServiceError
18
+ def message: () -> ::String
19
+ end
20
+ class ModelErrorException < ::Aws::Errors::ServiceError
21
+ def message: () -> ::String
22
+ def original_status_code: () -> ::String
23
+ def resource_name: () -> ::String
24
+ end
25
+ class ModelNotReadyException < ::Aws::Errors::ServiceError
26
+ def message: () -> ::String
27
+ end
28
+ class ModelStreamErrorException < ::Aws::Errors::ServiceError
29
+ def message: () -> ::String
30
+ def original_status_code: () -> ::String
31
+ def original_message: () -> ::String
32
+ end
33
+ class ModelTimeoutException < ::Aws::Errors::ServiceError
34
+ def message: () -> ::String
35
+ end
36
+ class ResourceNotFoundException < ::Aws::Errors::ServiceError
37
+ def message: () -> ::String
38
+ end
39
+ class ServiceQuotaExceededException < ::Aws::Errors::ServiceError
40
+ def message: () -> ::String
41
+ end
42
+ class ThrottlingException < ::Aws::Errors::ServiceError
43
+ def message: () -> ::String
44
+ end
45
+ class ValidationException < ::Aws::Errors::ServiceError
46
+ def message: () -> ::String
47
+ end
48
+ end
49
+ end
50
+ end
data/sig/resource.rbs ADDED
@@ -0,0 +1,82 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws
9
+ module BedrockRuntime
10
+ # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/BedrockRuntime/Resource.html
11
+ class Resource
12
+ # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/BedrockRuntime/Resource.html#initialize-instance_method
13
+ def initialize: (
14
+ ?client: Client,
15
+ ?credentials: untyped,
16
+ ?region: String,
17
+ ?access_key_id: String,
18
+ ?active_endpoint_cache: bool,
19
+ ?adaptive_retry_wait_to_fill: bool,
20
+ ?client_side_monitoring: bool,
21
+ ?client_side_monitoring_client_id: String,
22
+ ?client_side_monitoring_host: String,
23
+ ?client_side_monitoring_port: Integer,
24
+ ?client_side_monitoring_publisher: untyped,
25
+ ?convert_params: bool,
26
+ ?correct_clock_skew: bool,
27
+ ?defaults_mode: String,
28
+ ?disable_host_prefix_injection: bool,
29
+ ?disable_request_compression: bool,
30
+ ?endpoint: String,
31
+ ?endpoint_cache_max_entries: Integer,
32
+ ?endpoint_cache_max_threads: Integer,
33
+ ?endpoint_cache_poll_interval: Integer,
34
+ ?endpoint_discovery: bool,
35
+ ?event_stream_handler: Proc,
36
+ ?ignore_configured_endpoint_urls: bool,
37
+ ?input_event_stream_handler: Proc,
38
+ ?log_formatter: untyped,
39
+ ?log_level: Symbol,
40
+ ?logger: untyped,
41
+ ?max_attempts: Integer,
42
+ ?output_event_stream_handler: Proc,
43
+ ?profile: String,
44
+ ?request_min_compression_size_bytes: Integer,
45
+ ?retry_backoff: Proc,
46
+ ?retry_base_delay: Float,
47
+ ?retry_jitter: (:none | :equal | :full | ^(Integer) -> Integer),
48
+ ?retry_limit: Integer,
49
+ ?retry_max_delay: Integer,
50
+ ?retry_mode: ("legacy" | "standard" | "adaptive"),
51
+ ?sdk_ua_app_id: String,
52
+ ?secret_access_key: String,
53
+ ?session_token: String,
54
+ ?stub_responses: untyped,
55
+ ?token_provider: untyped,
56
+ ?use_dualstack_endpoint: bool,
57
+ ?use_fips_endpoint: bool,
58
+ ?validate_params: bool,
59
+ ?endpoint_provider: untyped,
60
+ ?http_proxy: String,
61
+ ?http_open_timeout: (Float | Integer),
62
+ ?http_read_timeout: (Float | Integer),
63
+ ?http_idle_timeout: (Float | Integer),
64
+ ?http_continue_timeout: (Float | Integer),
65
+ ?ssl_timeout: (Float | Integer | nil),
66
+ ?http_wire_trace: bool,
67
+ ?ssl_verify_peer: bool,
68
+ ?ssl_ca_bundle: String,
69
+ ?ssl_ca_directory: String,
70
+ ?ssl_ca_store: String,
71
+ ?on_chunk_received: Proc,
72
+ ?on_chunk_sent: Proc,
73
+ ?raise_response_errors: bool
74
+ ) -> void
75
+ | (?Hash[Symbol, untyped]) -> void
76
+
77
+ def client: () -> Client
78
+
79
+
80
+ end
81
+ end
82
+ end
data/sig/types.rbs ADDED
@@ -0,0 +1,114 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws::BedrockRuntime
9
+ module Types
10
+
11
+ class AccessDeniedException
12
+ attr_accessor message: ::String
13
+ SENSITIVE: []
14
+ end
15
+
16
+ class InternalServerException
17
+ attr_accessor message: ::String
18
+ attr_accessor event_type: untyped
19
+ SENSITIVE: []
20
+ end
21
+
22
+ class InvokeModelRequest
23
+ attr_accessor body: ::String
24
+ attr_accessor content_type: ::String
25
+ attr_accessor accept: ::String
26
+ attr_accessor model_id: ::String
27
+ attr_accessor trace: ("ENABLED" | "DISABLED")
28
+ attr_accessor guardrail_identifier: ::String
29
+ attr_accessor guardrail_version: ::String
30
+ SENSITIVE: [:body]
31
+ end
32
+
33
+ class InvokeModelResponse
34
+ attr_accessor body: ::String
35
+ attr_accessor content_type: ::String
36
+ SENSITIVE: [:body]
37
+ end
38
+
39
+ class InvokeModelWithResponseStreamRequest
40
+ attr_accessor body: ::String
41
+ attr_accessor content_type: ::String
42
+ attr_accessor accept: ::String
43
+ attr_accessor model_id: ::String
44
+ attr_accessor trace: ("ENABLED" | "DISABLED")
45
+ attr_accessor guardrail_identifier: ::String
46
+ attr_accessor guardrail_version: ::String
47
+ SENSITIVE: [:body]
48
+ end
49
+
50
+ class InvokeModelWithResponseStreamResponse
51
+ attr_accessor body: Types::ResponseStream
52
+ attr_accessor content_type: ::String
53
+ SENSITIVE: []
54
+ end
55
+
56
+ class ModelErrorException
57
+ attr_accessor message: ::String
58
+ attr_accessor original_status_code: ::Integer
59
+ attr_accessor resource_name: ::String
60
+ SENSITIVE: []
61
+ end
62
+
63
+ class ModelNotReadyException
64
+ attr_accessor message: ::String
65
+ SENSITIVE: []
66
+ end
67
+
68
+ class ModelStreamErrorException
69
+ attr_accessor message: ::String
70
+ attr_accessor original_status_code: ::Integer
71
+ attr_accessor original_message: ::String
72
+ attr_accessor event_type: untyped
73
+ SENSITIVE: []
74
+ end
75
+
76
+ class ModelTimeoutException
77
+ attr_accessor message: ::String
78
+ attr_accessor event_type: untyped
79
+ SENSITIVE: []
80
+ end
81
+
82
+ class PayloadPart
83
+ attr_accessor bytes: ::String
84
+ attr_accessor event_type: untyped
85
+ SENSITIVE: [:bytes]
86
+ end
87
+
88
+ class ResourceNotFoundException
89
+ attr_accessor message: ::String
90
+ SENSITIVE: []
91
+ end
92
+
93
+ class ServiceQuotaExceededException
94
+ attr_accessor message: ::String
95
+ SENSITIVE: []
96
+ end
97
+
98
+ class ThrottlingException
99
+ attr_accessor message: ::String
100
+ attr_accessor event_type: untyped
101
+ SENSITIVE: []
102
+ end
103
+
104
+ class ValidationException
105
+ attr_accessor message: ::String
106
+ attr_accessor event_type: untyped
107
+ SENSITIVE: []
108
+ end
109
+
110
+ class ResponseStream < Enumerator[untyped, untyped]
111
+ def event_types: () -> [:chunk, :internal_server_exception, :model_stream_error_exception, :validation_exception, :throttling_exception, :model_timeout_exception]
112
+ end
113
+ end
114
+ end
data/sig/waiters.rbs ADDED
@@ -0,0 +1,13 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws
9
+ module BedrockRuntime
10
+ module Waiters
11
+ end
12
+ end
13
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-bedrockruntime
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-28 00:00:00.000000000 Z
11
+ date: 2024-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '3'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 3.188.0
22
+ version: 3.191.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '3'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 3.188.0
32
+ version: 3.191.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: aws-sigv4
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -68,13 +68,18 @@ files:
68
68
  - lib/aws-sdk-bedrockruntime/resource.rb
69
69
  - lib/aws-sdk-bedrockruntime/types.rb
70
70
  - lib/aws-sdk-bedrockruntime/waiters.rb
71
+ - sig/client.rbs
72
+ - sig/errors.rbs
73
+ - sig/resource.rbs
74
+ - sig/types.rbs
75
+ - sig/waiters.rbs
71
76
  homepage: https://github.com/aws/aws-sdk-ruby
72
77
  licenses:
73
78
  - Apache-2.0
74
79
  metadata:
75
80
  source_code_uri: https://github.com/aws/aws-sdk-ruby/tree/version-3/gems/aws-sdk-bedrockruntime
76
81
  changelog_uri: https://github.com/aws/aws-sdk-ruby/tree/version-3/gems/aws-sdk-bedrockruntime/CHANGELOG.md
77
- post_install_message:
82
+ post_install_message:
78
83
  rdoc_options: []
79
84
  require_paths:
80
85
  - lib
@@ -89,8 +94,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
94
  - !ruby/object:Gem::Version
90
95
  version: '0'
91
96
  requirements: []
92
- rubygems_version: 3.1.6
93
- signing_key:
97
+ rubygems_version: 3.4.10
98
+ signing_key:
94
99
  specification_version: 4
95
100
  summary: AWS SDK for Ruby - Amazon Bedrock Runtime
96
101
  test_files: []