aws-sdk-bedrockruntime 1.5.0 → 1.6.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 +5 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-bedrockruntime/client.rb +129 -26
- data/lib/aws-sdk-bedrockruntime/client_api.rb +9 -0
- data/lib/aws-sdk-bedrockruntime/types.rb +121 -16
- data/lib/aws-sdk-bedrockruntime.rb +1 -1
- data/sig/client.rbs +8 -2
- data/sig/types.rbs +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05ac5cf213225401dee8f1d85bd87baca64269050aa19649e39fed908f5fce68
|
4
|
+
data.tar.gz: 121c36482bd45e94e7dbac139e68dd848c29a16617ed13a3035a707cd44f7ed5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f2af4974cc0e698f31d104c9eb93cdac14deb00ce6a6dfb99c1d21549eb78410bea396dde2e7035f5d97a27f87afb282969b6d2946d4453dc92691d79af81c3
|
7
|
+
data.tar.gz: 2f74aa9635507203db1f7f5f38406b1018fa6aca5fcceff772dddd1b46102484fd55039351d38cc2a01f2b17e47d457ac710eaa3ef649f520fed94db4a7c0c78
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
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
|
403
|
-
# provided in the request body. You use
|
404
|
-
#
|
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
|
407
|
-
# Guide
|
406
|
+
# For example code, see *Invoke model code examples* in the *Amazon
|
407
|
+
# Bedrock User Guide*.
|
408
408
|
#
|
409
|
-
#
|
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
|
-
#
|
417
|
-
# To see the format and content of
|
418
|
-
# refer to [Inference
|
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
|
-
#
|
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
|
464
|
-
#
|
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
|
-
#
|
467
|
-
#
|
513
|
+
# To see if a model supports streaming, call [GetFoundationModel][1] and
|
514
|
+
# check the `responseStreamingSupported` field in the response.
|
468
515
|
#
|
469
|
-
#
|
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
|
-
#
|
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
|
-
#
|
478
|
-
#
|
479
|
-
# [Inference
|
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
|
-
#
|
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.
|
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)
|
@@ -38,13 +38,16 @@ module Aws::BedrockRuntime
|
|
38
38
|
end
|
39
39
|
|
40
40
|
# @!attribute [rw] body
|
41
|
-
#
|
42
|
-
# header. To see the format and content of
|
43
|
-
# models, refer to
|
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
|
-
#
|
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
|
-
#
|
78
|
-
#
|
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
|
-
#
|
100
|
-
#
|
101
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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]
|
data/sig/client.rbs
CHANGED
@@ -85,7 +85,10 @@ module Aws
|
|
85
85
|
body: ::String,
|
86
86
|
?content_type: ::String,
|
87
87
|
?accept: ::String,
|
88
|
-
model_id: ::String
|
88
|
+
model_id: ::String,
|
89
|
+
?trace: ("ENABLED" | "DISABLED"),
|
90
|
+
?guardrail_identifier: ::String,
|
91
|
+
?guardrail_version: ::String
|
89
92
|
) -> _InvokeModelResponseSuccess
|
90
93
|
| (Hash[Symbol, untyped] params, ?Hash[Symbol, untyped] options) -> _InvokeModelResponseSuccess
|
91
94
|
|
@@ -99,7 +102,10 @@ module Aws
|
|
99
102
|
body: ::String,
|
100
103
|
?content_type: ::String,
|
101
104
|
?accept: ::String,
|
102
|
-
model_id: ::String
|
105
|
+
model_id: ::String,
|
106
|
+
?trace: ("ENABLED" | "DISABLED"),
|
107
|
+
?guardrail_identifier: ::String,
|
108
|
+
?guardrail_version: ::String
|
103
109
|
) ?{ (*untyped) -> void } -> _InvokeModelWithResponseStreamResponseSuccess
|
104
110
|
| (Hash[Symbol, untyped] params, ?Hash[Symbol, untyped] options) ?{ (*untyped) -> void } -> _InvokeModelWithResponseStreamResponseSuccess
|
105
111
|
end
|
data/sig/types.rbs
CHANGED
@@ -24,6 +24,9 @@ module Aws::BedrockRuntime
|
|
24
24
|
attr_accessor content_type: ::String
|
25
25
|
attr_accessor accept: ::String
|
26
26
|
attr_accessor model_id: ::String
|
27
|
+
attr_accessor trace: ("ENABLED" | "DISABLED")
|
28
|
+
attr_accessor guardrail_identifier: ::String
|
29
|
+
attr_accessor guardrail_version: ::String
|
27
30
|
SENSITIVE: [:body]
|
28
31
|
end
|
29
32
|
|
@@ -38,6 +41,9 @@ module Aws::BedrockRuntime
|
|
38
41
|
attr_accessor content_type: ::String
|
39
42
|
attr_accessor accept: ::String
|
40
43
|
attr_accessor model_id: ::String
|
44
|
+
attr_accessor trace: ("ENABLED" | "DISABLED")
|
45
|
+
attr_accessor guardrail_identifier: ::String
|
46
|
+
attr_accessor guardrail_version: ::String
|
41
47
|
SENSITIVE: [:body]
|
42
48
|
end
|
43
49
|
|
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
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
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
|