aws-sdk-bedrockruntime 1.15.0 → 1.17.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 +10 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-bedrockruntime/client.rb +156 -6
- data/lib/aws-sdk-bedrockruntime/client_api.rb +107 -1
- data/lib/aws-sdk-bedrockruntime/endpoints.rb +14 -0
- data/lib/aws-sdk-bedrockruntime/errors.rb +16 -0
- data/lib/aws-sdk-bedrockruntime/event_streams.rb +10 -0
- data/lib/aws-sdk-bedrockruntime/plugins/endpoints.rb +2 -0
- data/lib/aws-sdk-bedrockruntime/types.rb +331 -41
- data/lib/aws-sdk-bedrockruntime.rb +2 -2
- data/sig/client.rbs +31 -4
- data/sig/errors.rbs +3 -0
- data/sig/types.rbs +71 -2
- metadata +4 -4
data/sig/client.rbs
CHANGED
@@ -76,6 +76,29 @@ module Aws
|
|
76
76
|
| (?Hash[Symbol, untyped]) -> instance
|
77
77
|
|
78
78
|
|
79
|
+
interface _ApplyGuardrailResponseSuccess
|
80
|
+
include ::Seahorse::Client::_ResponseSuccess[Types::ApplyGuardrailResponse]
|
81
|
+
def usage: () -> Types::GuardrailUsage
|
82
|
+
def action: () -> ("NONE" | "GUARDRAIL_INTERVENED")
|
83
|
+
def outputs: () -> ::Array[Types::GuardrailOutputContent]
|
84
|
+
def assessments: () -> ::Array[Types::GuardrailAssessment]
|
85
|
+
end
|
86
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/BedrockRuntime/Client.html#apply_guardrail-instance_method
|
87
|
+
def apply_guardrail: (
|
88
|
+
guardrail_identifier: ::String,
|
89
|
+
guardrail_version: ::String,
|
90
|
+
source: ("INPUT" | "OUTPUT"),
|
91
|
+
content: Array[
|
92
|
+
{
|
93
|
+
text: {
|
94
|
+
text: ::String,
|
95
|
+
qualifiers: Array[("grounding_source" | "query" | "guard_content")]?
|
96
|
+
}?
|
97
|
+
},
|
98
|
+
]
|
99
|
+
) -> _ApplyGuardrailResponseSuccess
|
100
|
+
| (Hash[Symbol, untyped] params, ?Hash[Symbol, untyped] options) -> _ApplyGuardrailResponseSuccess
|
101
|
+
|
79
102
|
interface _ConverseResponseSuccess
|
80
103
|
include ::Seahorse::Client::_ResponseSuccess[Types::ConverseResponse]
|
81
104
|
def output: () -> Types::ConverseOutput
|
@@ -139,7 +162,8 @@ module Aws
|
|
139
162
|
}?,
|
140
163
|
guard_content: {
|
141
164
|
text: {
|
142
|
-
text: ::String
|
165
|
+
text: ::String,
|
166
|
+
qualifiers: Array[("grounding_source" | "query" | "guard_content")]?
|
143
167
|
}?
|
144
168
|
}?
|
145
169
|
},
|
@@ -151,7 +175,8 @@ module Aws
|
|
151
175
|
text: ::String?,
|
152
176
|
guard_content: {
|
153
177
|
text: {
|
154
|
-
text: ::String
|
178
|
+
text: ::String,
|
179
|
+
qualifiers: Array[("grounding_source" | "query" | "guard_content")]?
|
155
180
|
}?
|
156
181
|
}?
|
157
182
|
},
|
@@ -254,7 +279,8 @@ module Aws
|
|
254
279
|
}?,
|
255
280
|
guard_content: {
|
256
281
|
text: {
|
257
|
-
text: ::String
|
282
|
+
text: ::String,
|
283
|
+
qualifiers: Array[("grounding_source" | "query" | "guard_content")]?
|
258
284
|
}?
|
259
285
|
}?
|
260
286
|
},
|
@@ -266,7 +292,8 @@ module Aws
|
|
266
292
|
text: ::String?,
|
267
293
|
guard_content: {
|
268
294
|
text: {
|
269
|
-
text: ::String
|
295
|
+
text: ::String,
|
296
|
+
qualifiers: Array[("grounding_source" | "query" | "guard_content")]?
|
270
297
|
}?
|
271
298
|
}?
|
272
299
|
},
|
data/sig/errors.rbs
CHANGED
@@ -39,6 +39,9 @@ module Aws
|
|
39
39
|
class ServiceQuotaExceededException < ::Aws::Errors::ServiceError
|
40
40
|
def message: () -> ::String
|
41
41
|
end
|
42
|
+
class ServiceUnavailableException < ::Aws::Errors::ServiceError
|
43
|
+
def message: () -> ::String
|
44
|
+
end
|
42
45
|
class ThrottlingException < ::Aws::Errors::ServiceError
|
43
46
|
def message: () -> ::String
|
44
47
|
end
|
data/sig/types.rbs
CHANGED
@@ -16,6 +16,22 @@ module Aws::BedrockRuntime
|
|
16
16
|
class AnyToolChoice < Aws::EmptyStructure
|
17
17
|
end
|
18
18
|
|
19
|
+
class ApplyGuardrailRequest
|
20
|
+
attr_accessor guardrail_identifier: ::String
|
21
|
+
attr_accessor guardrail_version: ::String
|
22
|
+
attr_accessor source: ("INPUT" | "OUTPUT")
|
23
|
+
attr_accessor content: ::Array[Types::GuardrailContentBlock]
|
24
|
+
SENSITIVE: []
|
25
|
+
end
|
26
|
+
|
27
|
+
class ApplyGuardrailResponse
|
28
|
+
attr_accessor usage: Types::GuardrailUsage
|
29
|
+
attr_accessor action: ("NONE" | "GUARDRAIL_INTERVENED")
|
30
|
+
attr_accessor outputs: ::Array[Types::GuardrailOutputContent]
|
31
|
+
attr_accessor assessments: ::Array[Types::GuardrailAssessment]
|
32
|
+
SENSITIVE: []
|
33
|
+
end
|
34
|
+
|
19
35
|
class AutoToolChoice < Aws::EmptyStructure
|
20
36
|
end
|
21
37
|
|
@@ -191,6 +207,7 @@ module Aws::BedrockRuntime
|
|
191
207
|
attr_accessor content_policy: Types::GuardrailContentPolicyAssessment
|
192
208
|
attr_accessor word_policy: Types::GuardrailWordPolicyAssessment
|
193
209
|
attr_accessor sensitive_information_policy: Types::GuardrailSensitiveInformationPolicyAssessment
|
210
|
+
attr_accessor contextual_grounding_policy: Types::GuardrailContextualGroundingPolicyAssessment
|
194
211
|
SENSITIVE: []
|
195
212
|
end
|
196
213
|
|
@@ -201,6 +218,17 @@ module Aws::BedrockRuntime
|
|
201
218
|
SENSITIVE: []
|
202
219
|
end
|
203
220
|
|
221
|
+
class GuardrailContentBlock
|
222
|
+
attr_accessor text: Types::GuardrailTextBlock
|
223
|
+
attr_accessor unknown: untyped
|
224
|
+
SENSITIVE: []
|
225
|
+
|
226
|
+
class Text < GuardrailContentBlock
|
227
|
+
end
|
228
|
+
class Unknown < GuardrailContentBlock
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
204
232
|
class GuardrailContentFilter
|
205
233
|
attr_accessor type: ("INSULTS" | "HATE" | "SEXUAL" | "VIOLENCE" | "MISCONDUCT" | "PROMPT_ATTACK")
|
206
234
|
attr_accessor confidence: ("NONE" | "LOW" | "MEDIUM" | "HIGH")
|
@@ -213,6 +241,19 @@ module Aws::BedrockRuntime
|
|
213
241
|
SENSITIVE: []
|
214
242
|
end
|
215
243
|
|
244
|
+
class GuardrailContextualGroundingFilter
|
245
|
+
attr_accessor type: ("GROUNDING" | "RELEVANCE")
|
246
|
+
attr_accessor threshold: ::Float
|
247
|
+
attr_accessor score: ::Float
|
248
|
+
attr_accessor action: ("BLOCKED" | "NONE")
|
249
|
+
SENSITIVE: []
|
250
|
+
end
|
251
|
+
|
252
|
+
class GuardrailContextualGroundingPolicyAssessment
|
253
|
+
attr_accessor filters: ::Array[Types::GuardrailContextualGroundingFilter]
|
254
|
+
SENSITIVE: []
|
255
|
+
end
|
256
|
+
|
216
257
|
class GuardrailConverseContentBlock
|
217
258
|
attr_accessor text: Types::GuardrailConverseTextBlock
|
218
259
|
attr_accessor unknown: untyped
|
@@ -226,6 +267,7 @@ module Aws::BedrockRuntime
|
|
226
267
|
|
227
268
|
class GuardrailConverseTextBlock
|
228
269
|
attr_accessor text: ::String
|
270
|
+
attr_accessor qualifiers: ::Array[("grounding_source" | "query" | "guard_content")]
|
229
271
|
SENSITIVE: []
|
230
272
|
end
|
231
273
|
|
@@ -242,6 +284,11 @@ module Aws::BedrockRuntime
|
|
242
284
|
SENSITIVE: []
|
243
285
|
end
|
244
286
|
|
287
|
+
class GuardrailOutputContent
|
288
|
+
attr_accessor text: ::String
|
289
|
+
SENSITIVE: []
|
290
|
+
end
|
291
|
+
|
245
292
|
class GuardrailPiiEntityFilter
|
246
293
|
attr_accessor match: ::String
|
247
294
|
attr_accessor type: ("ADDRESS" | "AGE" | "AWS_ACCESS_KEY" | "AWS_SECRET_KEY" | "CA_HEALTH_NUMBER" | "CA_SOCIAL_INSURANCE_NUMBER" | "CREDIT_DEBIT_CARD_CVV" | "CREDIT_DEBIT_CARD_EXPIRY" | "CREDIT_DEBIT_CARD_NUMBER" | "DRIVER_ID" | "EMAIL" | "INTERNATIONAL_BANK_ACCOUNT_NUMBER" | "IP_ADDRESS" | "LICENSE_PLATE" | "MAC_ADDRESS" | "NAME" | "PASSWORD" | "PHONE" | "PIN" | "SWIFT_CODE" | "UK_NATIONAL_HEALTH_SERVICE_NUMBER" | "UK_NATIONAL_INSURANCE_NUMBER" | "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" | "URL" | "USERNAME" | "US_BANK_ACCOUNT_NUMBER" | "US_BANK_ROUTING_NUMBER" | "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" | "US_PASSPORT_NUMBER" | "US_SOCIAL_SECURITY_NUMBER" | "VEHICLE_IDENTIFICATION_NUMBER")
|
@@ -271,6 +318,12 @@ module Aws::BedrockRuntime
|
|
271
318
|
SENSITIVE: []
|
272
319
|
end
|
273
320
|
|
321
|
+
class GuardrailTextBlock
|
322
|
+
attr_accessor text: ::String
|
323
|
+
attr_accessor qualifiers: ::Array[("grounding_source" | "query" | "guard_content")]
|
324
|
+
SENSITIVE: []
|
325
|
+
end
|
326
|
+
|
274
327
|
class GuardrailTopic
|
275
328
|
attr_accessor name: ::String
|
276
329
|
attr_accessor type: ("DENY")
|
@@ -290,6 +343,16 @@ module Aws::BedrockRuntime
|
|
290
343
|
SENSITIVE: []
|
291
344
|
end
|
292
345
|
|
346
|
+
class GuardrailUsage
|
347
|
+
attr_accessor topic_policy_units: ::Integer
|
348
|
+
attr_accessor content_policy_units: ::Integer
|
349
|
+
attr_accessor word_policy_units: ::Integer
|
350
|
+
attr_accessor sensitive_information_policy_units: ::Integer
|
351
|
+
attr_accessor sensitive_information_policy_free_units: ::Integer
|
352
|
+
attr_accessor contextual_grounding_policy_units: ::Integer
|
353
|
+
SENSITIVE: []
|
354
|
+
end
|
355
|
+
|
293
356
|
class GuardrailWordPolicyAssessment
|
294
357
|
attr_accessor custom_words: ::Array[Types::GuardrailCustomWord]
|
295
358
|
attr_accessor managed_word_lists: ::Array[Types::GuardrailManagedWord]
|
@@ -422,6 +485,12 @@ module Aws::BedrockRuntime
|
|
422
485
|
SENSITIVE: []
|
423
486
|
end
|
424
487
|
|
488
|
+
class ServiceUnavailableException
|
489
|
+
attr_accessor message: ::String
|
490
|
+
attr_accessor event_type: untyped
|
491
|
+
SENSITIVE: []
|
492
|
+
end
|
493
|
+
|
425
494
|
class SpecificToolChoice
|
426
495
|
attr_accessor name: ::String
|
427
496
|
SENSITIVE: []
|
@@ -558,11 +627,11 @@ module Aws::BedrockRuntime
|
|
558
627
|
end
|
559
628
|
|
560
629
|
class ConverseStreamOutput < Enumerator[untyped, untyped]
|
561
|
-
def event_types: () -> [:message_start, :content_block_start, :content_block_delta, :content_block_stop, :message_stop, :metadata, :internal_server_exception, :model_stream_error_exception, :validation_exception, :throttling_exception]
|
630
|
+
def event_types: () -> [:message_start, :content_block_start, :content_block_delta, :content_block_stop, :message_stop, :metadata, :internal_server_exception, :model_stream_error_exception, :validation_exception, :throttling_exception, :service_unavailable_exception]
|
562
631
|
end
|
563
632
|
|
564
633
|
class ResponseStream < Enumerator[untyped, untyped]
|
565
|
-
def event_types: () -> [:chunk, :internal_server_exception, :model_stream_error_exception, :validation_exception, :throttling_exception, :model_timeout_exception]
|
634
|
+
def event_types: () -> [:chunk, :internal_server_exception, :model_stream_error_exception, :validation_exception, :throttling_exception, :model_timeout_exception, :service_unavailable_exception]
|
566
635
|
end
|
567
636
|
end
|
568
637
|
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
|
+
version: 1.17.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-07-
|
11
|
+
date: 2024-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '1.
|
39
|
+
version: '1.5'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '1.
|
46
|
+
version: '1.5'
|
47
47
|
description: Official AWS Ruby gem for Amazon Bedrock Runtime. This gem is part of
|
48
48
|
the AWS SDK for Ruby.
|
49
49
|
email:
|