aws-sdk-bedrockruntime 1.10.0 → 1.11.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 +184 -29
- data/lib/aws-sdk-bedrockruntime/client_api.rb +151 -0
- data/lib/aws-sdk-bedrockruntime/types.rb +474 -47
- data/lib/aws-sdk-bedrockruntime.rb +1 -1
- data/sig/client.rbs +35 -3
- data/sig/types.rbs +132 -2
- metadata +2 -2
data/sig/client.rbs
CHANGED
@@ -78,10 +78,11 @@ module Aws
|
|
78
78
|
interface _ConverseResponseSuccess
|
79
79
|
include ::Seahorse::Client::_ResponseSuccess[Types::ConverseResponse]
|
80
80
|
def output: () -> Types::ConverseOutput
|
81
|
-
def stop_reason: () -> ("end_turn" | "tool_use" | "max_tokens" | "stop_sequence" | "content_filtered")
|
81
|
+
def stop_reason: () -> ("end_turn" | "tool_use" | "max_tokens" | "stop_sequence" | "guardrail_intervened" | "content_filtered")
|
82
82
|
def usage: () -> Types::TokenUsage
|
83
83
|
def metrics: () -> Types::ConverseMetrics
|
84
84
|
def additional_model_response_fields: () -> untyped
|
85
|
+
def trace: () -> Types::ConverseTrace
|
85
86
|
end
|
86
87
|
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/BedrockRuntime/Client.html#converse-instance_method
|
87
88
|
def converse: (
|
@@ -120,6 +121,11 @@ module Aws
|
|
120
121
|
},
|
121
122
|
],
|
122
123
|
status: ("success" | "error")?
|
124
|
+
}?,
|
125
|
+
guard_content: {
|
126
|
+
text: {
|
127
|
+
text: ::String
|
128
|
+
}?
|
123
129
|
}?
|
124
130
|
},
|
125
131
|
]
|
@@ -127,7 +133,12 @@ module Aws
|
|
127
133
|
],
|
128
134
|
?system: Array[
|
129
135
|
{
|
130
|
-
text: ::String
|
136
|
+
text: ::String?,
|
137
|
+
guard_content: {
|
138
|
+
text: {
|
139
|
+
text: ::String
|
140
|
+
}?
|
141
|
+
}?
|
131
142
|
},
|
132
143
|
],
|
133
144
|
?inference_config: {
|
@@ -159,6 +170,11 @@ module Aws
|
|
159
170
|
}?
|
160
171
|
}?
|
161
172
|
},
|
173
|
+
?guardrail_config: {
|
174
|
+
guardrail_identifier: ::String,
|
175
|
+
guardrail_version: ::String,
|
176
|
+
trace: ("enabled" | "disabled")?
|
177
|
+
},
|
162
178
|
?additional_model_request_fields: {
|
163
179
|
},
|
164
180
|
?additional_model_response_field_paths: Array[::String]
|
@@ -206,6 +222,11 @@ module Aws
|
|
206
222
|
},
|
207
223
|
],
|
208
224
|
status: ("success" | "error")?
|
225
|
+
}?,
|
226
|
+
guard_content: {
|
227
|
+
text: {
|
228
|
+
text: ::String
|
229
|
+
}?
|
209
230
|
}?
|
210
231
|
},
|
211
232
|
]
|
@@ -213,7 +234,12 @@ module Aws
|
|
213
234
|
],
|
214
235
|
?system: Array[
|
215
236
|
{
|
216
|
-
text: ::String
|
237
|
+
text: ::String?,
|
238
|
+
guard_content: {
|
239
|
+
text: {
|
240
|
+
text: ::String
|
241
|
+
}?
|
242
|
+
}?
|
217
243
|
},
|
218
244
|
],
|
219
245
|
?inference_config: {
|
@@ -245,6 +271,12 @@ module Aws
|
|
245
271
|
}?
|
246
272
|
}?
|
247
273
|
},
|
274
|
+
?guardrail_config: {
|
275
|
+
guardrail_identifier: ::String,
|
276
|
+
guardrail_version: ::String,
|
277
|
+
trace: ("enabled" | "disabled")?,
|
278
|
+
stream_processing_mode: ("sync" | "async")?
|
279
|
+
},
|
248
280
|
?additional_model_request_fields: {
|
249
281
|
},
|
250
282
|
?additional_model_response_field_paths: Array[::String]
|
data/sig/types.rbs
CHANGED
@@ -24,6 +24,7 @@ module Aws::BedrockRuntime
|
|
24
24
|
attr_accessor image: Types::ImageBlock
|
25
25
|
attr_accessor tool_use: Types::ToolUseBlock
|
26
26
|
attr_accessor tool_result: Types::ToolResultBlock
|
27
|
+
attr_accessor guard_content: Types::GuardrailConverseContentBlock
|
27
28
|
attr_accessor unknown: untyped
|
28
29
|
SENSITIVE: []
|
29
30
|
|
@@ -35,6 +36,8 @@ module Aws::BedrockRuntime
|
|
35
36
|
end
|
36
37
|
class ToolResult < ContentBlock
|
37
38
|
end
|
39
|
+
class GuardContent < ContentBlock
|
40
|
+
end
|
38
41
|
class Unknown < ContentBlock
|
39
42
|
end
|
40
43
|
end
|
@@ -106,6 +109,7 @@ module Aws::BedrockRuntime
|
|
106
109
|
attr_accessor system: ::Array[Types::SystemContentBlock]
|
107
110
|
attr_accessor inference_config: Types::InferenceConfiguration
|
108
111
|
attr_accessor tool_config: Types::ToolConfiguration
|
112
|
+
attr_accessor guardrail_config: Types::GuardrailConfiguration
|
109
113
|
attr_accessor additional_model_request_fields: untyped
|
110
114
|
attr_accessor additional_model_response_field_paths: ::Array[::String]
|
111
115
|
SENSITIVE: []
|
@@ -113,16 +117,18 @@ module Aws::BedrockRuntime
|
|
113
117
|
|
114
118
|
class ConverseResponse
|
115
119
|
attr_accessor output: Types::ConverseOutput
|
116
|
-
attr_accessor stop_reason: ("end_turn" | "tool_use" | "max_tokens" | "stop_sequence" | "content_filtered")
|
120
|
+
attr_accessor stop_reason: ("end_turn" | "tool_use" | "max_tokens" | "stop_sequence" | "guardrail_intervened" | "content_filtered")
|
117
121
|
attr_accessor usage: Types::TokenUsage
|
118
122
|
attr_accessor metrics: Types::ConverseMetrics
|
119
123
|
attr_accessor additional_model_response_fields: untyped
|
124
|
+
attr_accessor trace: Types::ConverseTrace
|
120
125
|
SENSITIVE: []
|
121
126
|
end
|
122
127
|
|
123
128
|
class ConverseStreamMetadataEvent
|
124
129
|
attr_accessor usage: Types::TokenUsage
|
125
130
|
attr_accessor metrics: Types::ConverseStreamMetrics
|
131
|
+
attr_accessor trace: Types::ConverseStreamTrace
|
126
132
|
attr_accessor event_type: untyped
|
127
133
|
SENSITIVE: []
|
128
134
|
end
|
@@ -138,6 +144,7 @@ module Aws::BedrockRuntime
|
|
138
144
|
attr_accessor system: ::Array[Types::SystemContentBlock]
|
139
145
|
attr_accessor inference_config: Types::InferenceConfiguration
|
140
146
|
attr_accessor tool_config: Types::ToolConfiguration
|
147
|
+
attr_accessor guardrail_config: Types::GuardrailStreamConfiguration
|
141
148
|
attr_accessor additional_model_request_fields: untyped
|
142
149
|
attr_accessor additional_model_response_field_paths: ::Array[::String]
|
143
150
|
SENSITIVE: []
|
@@ -148,6 +155,126 @@ module Aws::BedrockRuntime
|
|
148
155
|
SENSITIVE: []
|
149
156
|
end
|
150
157
|
|
158
|
+
class ConverseStreamTrace
|
159
|
+
attr_accessor guardrail: Types::GuardrailTraceAssessment
|
160
|
+
SENSITIVE: []
|
161
|
+
end
|
162
|
+
|
163
|
+
class ConverseTrace
|
164
|
+
attr_accessor guardrail: Types::GuardrailTraceAssessment
|
165
|
+
SENSITIVE: []
|
166
|
+
end
|
167
|
+
|
168
|
+
class GuardrailAssessment
|
169
|
+
attr_accessor topic_policy: Types::GuardrailTopicPolicyAssessment
|
170
|
+
attr_accessor content_policy: Types::GuardrailContentPolicyAssessment
|
171
|
+
attr_accessor word_policy: Types::GuardrailWordPolicyAssessment
|
172
|
+
attr_accessor sensitive_information_policy: Types::GuardrailSensitiveInformationPolicyAssessment
|
173
|
+
SENSITIVE: []
|
174
|
+
end
|
175
|
+
|
176
|
+
class GuardrailConfiguration
|
177
|
+
attr_accessor guardrail_identifier: ::String
|
178
|
+
attr_accessor guardrail_version: ::String
|
179
|
+
attr_accessor trace: ("enabled" | "disabled")
|
180
|
+
SENSITIVE: []
|
181
|
+
end
|
182
|
+
|
183
|
+
class GuardrailContentFilter
|
184
|
+
attr_accessor type: ("INSULTS" | "HATE" | "SEXUAL" | "VIOLENCE" | "MISCONDUCT" | "PROMPT_ATTACK")
|
185
|
+
attr_accessor confidence: ("NONE" | "LOW" | "MEDIUM" | "HIGH")
|
186
|
+
attr_accessor action: ("BLOCKED")
|
187
|
+
SENSITIVE: []
|
188
|
+
end
|
189
|
+
|
190
|
+
class GuardrailContentPolicyAssessment
|
191
|
+
attr_accessor filters: ::Array[Types::GuardrailContentFilter]
|
192
|
+
SENSITIVE: []
|
193
|
+
end
|
194
|
+
|
195
|
+
class GuardrailConverseContentBlock
|
196
|
+
attr_accessor text: Types::GuardrailConverseTextBlock
|
197
|
+
attr_accessor unknown: untyped
|
198
|
+
SENSITIVE: []
|
199
|
+
|
200
|
+
class Text < GuardrailConverseContentBlock
|
201
|
+
end
|
202
|
+
class Unknown < GuardrailConverseContentBlock
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
class GuardrailConverseTextBlock
|
207
|
+
attr_accessor text: ::String
|
208
|
+
SENSITIVE: []
|
209
|
+
end
|
210
|
+
|
211
|
+
class GuardrailCustomWord
|
212
|
+
attr_accessor match: ::String
|
213
|
+
attr_accessor action: ("BLOCKED")
|
214
|
+
SENSITIVE: []
|
215
|
+
end
|
216
|
+
|
217
|
+
class GuardrailManagedWord
|
218
|
+
attr_accessor match: ::String
|
219
|
+
attr_accessor type: ("PROFANITY")
|
220
|
+
attr_accessor action: ("BLOCKED")
|
221
|
+
SENSITIVE: []
|
222
|
+
end
|
223
|
+
|
224
|
+
class GuardrailPiiEntityFilter
|
225
|
+
attr_accessor match: ::String
|
226
|
+
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")
|
227
|
+
attr_accessor action: ("ANONYMIZED" | "BLOCKED")
|
228
|
+
SENSITIVE: []
|
229
|
+
end
|
230
|
+
|
231
|
+
class GuardrailRegexFilter
|
232
|
+
attr_accessor name: ::String
|
233
|
+
attr_accessor match: ::String
|
234
|
+
attr_accessor regex: ::String
|
235
|
+
attr_accessor action: ("ANONYMIZED" | "BLOCKED")
|
236
|
+
SENSITIVE: []
|
237
|
+
end
|
238
|
+
|
239
|
+
class GuardrailSensitiveInformationPolicyAssessment
|
240
|
+
attr_accessor pii_entities: ::Array[Types::GuardrailPiiEntityFilter]
|
241
|
+
attr_accessor regexes: ::Array[Types::GuardrailRegexFilter]
|
242
|
+
SENSITIVE: []
|
243
|
+
end
|
244
|
+
|
245
|
+
class GuardrailStreamConfiguration
|
246
|
+
attr_accessor guardrail_identifier: ::String
|
247
|
+
attr_accessor guardrail_version: ::String
|
248
|
+
attr_accessor trace: ("enabled" | "disabled")
|
249
|
+
attr_accessor stream_processing_mode: ("sync" | "async")
|
250
|
+
SENSITIVE: []
|
251
|
+
end
|
252
|
+
|
253
|
+
class GuardrailTopic
|
254
|
+
attr_accessor name: ::String
|
255
|
+
attr_accessor type: ("DENY")
|
256
|
+
attr_accessor action: ("BLOCKED")
|
257
|
+
SENSITIVE: []
|
258
|
+
end
|
259
|
+
|
260
|
+
class GuardrailTopicPolicyAssessment
|
261
|
+
attr_accessor topics: ::Array[Types::GuardrailTopic]
|
262
|
+
SENSITIVE: []
|
263
|
+
end
|
264
|
+
|
265
|
+
class GuardrailTraceAssessment
|
266
|
+
attr_accessor model_output: ::Array[::String]
|
267
|
+
attr_accessor input_assessment: ::Hash[::String, Types::GuardrailAssessment]
|
268
|
+
attr_accessor output_assessments: ::Hash[::String, ::Array[Types::GuardrailAssessment]]
|
269
|
+
SENSITIVE: []
|
270
|
+
end
|
271
|
+
|
272
|
+
class GuardrailWordPolicyAssessment
|
273
|
+
attr_accessor custom_words: ::Array[Types::GuardrailCustomWord]
|
274
|
+
attr_accessor managed_word_lists: ::Array[Types::GuardrailManagedWord]
|
275
|
+
SENSITIVE: []
|
276
|
+
end
|
277
|
+
|
151
278
|
class ImageBlock
|
152
279
|
attr_accessor format: ("png" | "jpeg" | "gif" | "webp")
|
153
280
|
attr_accessor source: Types::ImageSource
|
@@ -226,7 +353,7 @@ module Aws::BedrockRuntime
|
|
226
353
|
end
|
227
354
|
|
228
355
|
class MessageStopEvent
|
229
|
-
attr_accessor stop_reason: ("end_turn" | "tool_use" | "max_tokens" | "stop_sequence" | "content_filtered")
|
356
|
+
attr_accessor stop_reason: ("end_turn" | "tool_use" | "max_tokens" | "stop_sequence" | "guardrail_intervened" | "content_filtered")
|
230
357
|
attr_accessor additional_model_response_fields: untyped
|
231
358
|
attr_accessor event_type: untyped
|
232
359
|
SENSITIVE: []
|
@@ -281,11 +408,14 @@ module Aws::BedrockRuntime
|
|
281
408
|
|
282
409
|
class SystemContentBlock
|
283
410
|
attr_accessor text: ::String
|
411
|
+
attr_accessor guard_content: Types::GuardrailConverseContentBlock
|
284
412
|
attr_accessor unknown: untyped
|
285
413
|
SENSITIVE: []
|
286
414
|
|
287
415
|
class Text < SystemContentBlock
|
288
416
|
end
|
417
|
+
class GuardContent < SystemContentBlock
|
418
|
+
end
|
289
419
|
class Unknown < SystemContentBlock
|
290
420
|
end
|
291
421
|
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.11.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-06-
|
11
|
+
date: 2024-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|