safetykit 0.57.0 → 0.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/lib/safety_kit/models/content_create_params.rb +136 -17
- data/lib/safety_kit/models/content_create_response.rb +206 -109
- data/lib/safety_kit/resources/content.rb +12 -10
- data/lib/safety_kit/version.rb +1 -1
- data/rbi/safety_kit/models/content_create_params.rbi +359 -22
- data/rbi/safety_kit/models/content_create_response.rbi +423 -172
- data/rbi/safety_kit/resources/content.rbi +20 -13
- data/sig/safety_kit/models/content_create_params.rbs +142 -12
- data/sig/safety_kit/models/content_create_response.rbs +156 -62
- data/sig/safety_kit/resources/content.rbs +2 -2
- metadata +1 -1
|
@@ -11,6 +11,19 @@ module SafetyKit
|
|
|
11
11
|
T.any(SafetyKit::ContentCreateParams, SafetyKit::Internal::AnyHash)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
+
# Content parts to classify together. At most 20 images.
|
|
15
|
+
sig do
|
|
16
|
+
returns(
|
|
17
|
+
T::Array[
|
|
18
|
+
T.any(
|
|
19
|
+
SafetyKit::ContentCreateParams::Content::UnionMember0,
|
|
20
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1
|
|
21
|
+
)
|
|
22
|
+
]
|
|
23
|
+
)
|
|
24
|
+
end
|
|
25
|
+
attr_accessor :content
|
|
26
|
+
|
|
14
27
|
# Your stable identifier for the user this content belongs to.
|
|
15
28
|
sig { returns(String) }
|
|
16
29
|
attr_accessor :user_id
|
|
@@ -22,14 +35,6 @@ module SafetyKit
|
|
|
22
35
|
sig { params(content_id: String).void }
|
|
23
36
|
attr_writer :content_id
|
|
24
37
|
|
|
25
|
-
# Images to classify, each as base64-encoded image bytes, raw or as a data URI. At
|
|
26
|
-
# most 5MB each.
|
|
27
|
-
sig { returns(T.nilable(T::Array[String])) }
|
|
28
|
-
attr_reader :images
|
|
29
|
-
|
|
30
|
-
sig { params(images: T::Array[String]).void }
|
|
31
|
-
attr_writer :images
|
|
32
|
-
|
|
33
38
|
# Additional product context for this content. At most 8KB when serialized.
|
|
34
39
|
sig { returns(T.nilable(T::Hash[Symbol, T.nilable(T.anything)])) }
|
|
35
40
|
attr_reader :metadata
|
|
@@ -37,35 +42,50 @@ module SafetyKit
|
|
|
37
42
|
sig { params(metadata: T::Hash[Symbol, T.nilable(T.anything)]).void }
|
|
38
43
|
attr_writer :metadata
|
|
39
44
|
|
|
40
|
-
#
|
|
41
|
-
sig
|
|
42
|
-
|
|
45
|
+
# The API version this operation is defined against.
|
|
46
|
+
sig do
|
|
47
|
+
returns(
|
|
48
|
+
T.nilable(SafetyKit::ContentCreateParams::SafetyKitVersion::OrSymbol)
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
attr_reader :safety_kit_version
|
|
43
52
|
|
|
44
|
-
sig
|
|
45
|
-
|
|
53
|
+
sig do
|
|
54
|
+
params(
|
|
55
|
+
safety_kit_version:
|
|
56
|
+
SafetyKit::ContentCreateParams::SafetyKitVersion::OrSymbol
|
|
57
|
+
).void
|
|
58
|
+
end
|
|
59
|
+
attr_writer :safety_kit_version
|
|
46
60
|
|
|
47
61
|
sig do
|
|
48
62
|
params(
|
|
63
|
+
content:
|
|
64
|
+
T::Array[
|
|
65
|
+
T.any(
|
|
66
|
+
SafetyKit::ContentCreateParams::Content::UnionMember0::OrHash,
|
|
67
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1::OrHash
|
|
68
|
+
)
|
|
69
|
+
],
|
|
49
70
|
user_id: String,
|
|
50
71
|
content_id: String,
|
|
51
|
-
images: T::Array[String],
|
|
52
72
|
metadata: T::Hash[Symbol, T.nilable(T.anything)],
|
|
53
|
-
|
|
73
|
+
safety_kit_version:
|
|
74
|
+
SafetyKit::ContentCreateParams::SafetyKitVersion::OrSymbol,
|
|
54
75
|
request_options: SafetyKit::RequestOptions::OrHash
|
|
55
76
|
).returns(T.attached_class)
|
|
56
77
|
end
|
|
57
78
|
def self.new(
|
|
79
|
+
# Content parts to classify together. At most 20 images.
|
|
80
|
+
content:,
|
|
58
81
|
# Your stable identifier for the user this content belongs to.
|
|
59
82
|
user_id:,
|
|
60
83
|
# Your content identifier.
|
|
61
84
|
content_id: nil,
|
|
62
|
-
# Images to classify, each as base64-encoded image bytes, raw or as a data URI. At
|
|
63
|
-
# most 5MB each.
|
|
64
|
-
images: nil,
|
|
65
85
|
# Additional product context for this content. At most 8KB when serialized.
|
|
66
86
|
metadata: nil,
|
|
67
|
-
#
|
|
68
|
-
|
|
87
|
+
# The API version this operation is defined against.
|
|
88
|
+
safety_kit_version: nil,
|
|
69
89
|
request_options: {}
|
|
70
90
|
)
|
|
71
91
|
end
|
|
@@ -73,17 +93,334 @@ module SafetyKit
|
|
|
73
93
|
sig do
|
|
74
94
|
override.returns(
|
|
75
95
|
{
|
|
96
|
+
content:
|
|
97
|
+
T::Array[
|
|
98
|
+
T.any(
|
|
99
|
+
SafetyKit::ContentCreateParams::Content::UnionMember0,
|
|
100
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1
|
|
101
|
+
)
|
|
102
|
+
],
|
|
76
103
|
user_id: String,
|
|
77
104
|
content_id: String,
|
|
78
|
-
images: T::Array[String],
|
|
79
105
|
metadata: T::Hash[Symbol, T.nilable(T.anything)],
|
|
80
|
-
|
|
106
|
+
safety_kit_version:
|
|
107
|
+
SafetyKit::ContentCreateParams::SafetyKitVersion::OrSymbol,
|
|
81
108
|
request_options: SafetyKit::RequestOptions
|
|
82
109
|
}
|
|
83
110
|
)
|
|
84
111
|
end
|
|
85
112
|
def to_hash
|
|
86
113
|
end
|
|
114
|
+
|
|
115
|
+
# One part of the submitted content.
|
|
116
|
+
module Content
|
|
117
|
+
extend SafetyKit::Internal::Type::Union
|
|
118
|
+
|
|
119
|
+
Variants =
|
|
120
|
+
T.type_alias do
|
|
121
|
+
T.any(
|
|
122
|
+
SafetyKit::ContentCreateParams::Content::UnionMember0,
|
|
123
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1
|
|
124
|
+
)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
class UnionMember0 < SafetyKit::Internal::Type::BaseModel
|
|
128
|
+
OrHash =
|
|
129
|
+
T.type_alias do
|
|
130
|
+
T.any(
|
|
131
|
+
SafetyKit::ContentCreateParams::Content::UnionMember0,
|
|
132
|
+
SafetyKit::Internal::AnyHash
|
|
133
|
+
)
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# User-authored text to classify.
|
|
137
|
+
sig { returns(String) }
|
|
138
|
+
attr_accessor :text
|
|
139
|
+
|
|
140
|
+
sig do
|
|
141
|
+
returns(
|
|
142
|
+
SafetyKit::ContentCreateParams::Content::UnionMember0::Type::OrSymbol
|
|
143
|
+
)
|
|
144
|
+
end
|
|
145
|
+
attr_accessor :type
|
|
146
|
+
|
|
147
|
+
# Your name for where this part came from.
|
|
148
|
+
sig { returns(T.nilable(String)) }
|
|
149
|
+
attr_reader :key
|
|
150
|
+
|
|
151
|
+
sig { params(key: String).void }
|
|
152
|
+
attr_writer :key
|
|
153
|
+
|
|
154
|
+
sig do
|
|
155
|
+
params(
|
|
156
|
+
text: String,
|
|
157
|
+
type:
|
|
158
|
+
SafetyKit::ContentCreateParams::Content::UnionMember0::Type::OrSymbol,
|
|
159
|
+
key: String
|
|
160
|
+
).returns(T.attached_class)
|
|
161
|
+
end
|
|
162
|
+
def self.new(
|
|
163
|
+
# User-authored text to classify.
|
|
164
|
+
text:,
|
|
165
|
+
type:,
|
|
166
|
+
# Your name for where this part came from.
|
|
167
|
+
key: nil
|
|
168
|
+
)
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
sig do
|
|
172
|
+
override.returns(
|
|
173
|
+
{
|
|
174
|
+
text: String,
|
|
175
|
+
type:
|
|
176
|
+
SafetyKit::ContentCreateParams::Content::UnionMember0::Type::OrSymbol,
|
|
177
|
+
key: String
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
end
|
|
181
|
+
def to_hash
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
module Type
|
|
185
|
+
extend SafetyKit::Internal::Type::Enum
|
|
186
|
+
|
|
187
|
+
TaggedSymbol =
|
|
188
|
+
T.type_alias do
|
|
189
|
+
T.all(
|
|
190
|
+
Symbol,
|
|
191
|
+
SafetyKit::ContentCreateParams::Content::UnionMember0::Type
|
|
192
|
+
)
|
|
193
|
+
end
|
|
194
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
195
|
+
|
|
196
|
+
TEXT =
|
|
197
|
+
T.let(
|
|
198
|
+
:text,
|
|
199
|
+
SafetyKit::ContentCreateParams::Content::UnionMember0::Type::TaggedSymbol
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
sig do
|
|
203
|
+
override.returns(
|
|
204
|
+
T::Array[
|
|
205
|
+
SafetyKit::ContentCreateParams::Content::UnionMember0::Type::TaggedSymbol
|
|
206
|
+
]
|
|
207
|
+
)
|
|
208
|
+
end
|
|
209
|
+
def self.values
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
class UnionMember1 < SafetyKit::Internal::Type::BaseModel
|
|
215
|
+
OrHash =
|
|
216
|
+
T.type_alias do
|
|
217
|
+
T.any(
|
|
218
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1,
|
|
219
|
+
SafetyKit::Internal::AnyHash
|
|
220
|
+
)
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
sig do
|
|
224
|
+
returns(
|
|
225
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1::Source
|
|
226
|
+
)
|
|
227
|
+
end
|
|
228
|
+
attr_reader :source
|
|
229
|
+
|
|
230
|
+
sig do
|
|
231
|
+
params(
|
|
232
|
+
source:
|
|
233
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1::Source::OrHash
|
|
234
|
+
).void
|
|
235
|
+
end
|
|
236
|
+
attr_writer :source
|
|
237
|
+
|
|
238
|
+
sig do
|
|
239
|
+
returns(
|
|
240
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1::Type::OrSymbol
|
|
241
|
+
)
|
|
242
|
+
end
|
|
243
|
+
attr_accessor :type
|
|
244
|
+
|
|
245
|
+
# Your name for where this part came from.
|
|
246
|
+
sig { returns(T.nilable(String)) }
|
|
247
|
+
attr_reader :key
|
|
248
|
+
|
|
249
|
+
sig { params(key: String).void }
|
|
250
|
+
attr_writer :key
|
|
251
|
+
|
|
252
|
+
sig do
|
|
253
|
+
params(
|
|
254
|
+
source:
|
|
255
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1::Source::OrHash,
|
|
256
|
+
type:
|
|
257
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1::Type::OrSymbol,
|
|
258
|
+
key: String
|
|
259
|
+
).returns(T.attached_class)
|
|
260
|
+
end
|
|
261
|
+
def self.new(
|
|
262
|
+
source:,
|
|
263
|
+
type:,
|
|
264
|
+
# Your name for where this part came from.
|
|
265
|
+
key: nil
|
|
266
|
+
)
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
sig do
|
|
270
|
+
override.returns(
|
|
271
|
+
{
|
|
272
|
+
source:
|
|
273
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1::Source,
|
|
274
|
+
type:
|
|
275
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1::Type::OrSymbol,
|
|
276
|
+
key: String
|
|
277
|
+
}
|
|
278
|
+
)
|
|
279
|
+
end
|
|
280
|
+
def to_hash
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
class Source < SafetyKit::Internal::Type::BaseModel
|
|
284
|
+
OrHash =
|
|
285
|
+
T.type_alias do
|
|
286
|
+
T.any(
|
|
287
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1::Source,
|
|
288
|
+
SafetyKit::Internal::AnyHash
|
|
289
|
+
)
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
# Base64-encoded image bytes, raw or as a data URI. At most 5MB.
|
|
293
|
+
sig { returns(String) }
|
|
294
|
+
attr_accessor :data
|
|
295
|
+
|
|
296
|
+
sig do
|
|
297
|
+
returns(
|
|
298
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1::Source::Type::OrSymbol
|
|
299
|
+
)
|
|
300
|
+
end
|
|
301
|
+
attr_accessor :type
|
|
302
|
+
|
|
303
|
+
sig do
|
|
304
|
+
params(
|
|
305
|
+
data: String,
|
|
306
|
+
type:
|
|
307
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1::Source::Type::OrSymbol
|
|
308
|
+
).returns(T.attached_class)
|
|
309
|
+
end
|
|
310
|
+
def self.new(
|
|
311
|
+
# Base64-encoded image bytes, raw or as a data URI. At most 5MB.
|
|
312
|
+
data:,
|
|
313
|
+
type:
|
|
314
|
+
)
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
sig do
|
|
318
|
+
override.returns(
|
|
319
|
+
{
|
|
320
|
+
data: String,
|
|
321
|
+
type:
|
|
322
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1::Source::Type::OrSymbol
|
|
323
|
+
}
|
|
324
|
+
)
|
|
325
|
+
end
|
|
326
|
+
def to_hash
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
module Type
|
|
330
|
+
extend SafetyKit::Internal::Type::Enum
|
|
331
|
+
|
|
332
|
+
TaggedSymbol =
|
|
333
|
+
T.type_alias do
|
|
334
|
+
T.all(
|
|
335
|
+
Symbol,
|
|
336
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1::Source::Type
|
|
337
|
+
)
|
|
338
|
+
end
|
|
339
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
340
|
+
|
|
341
|
+
BASE64 =
|
|
342
|
+
T.let(
|
|
343
|
+
:base64,
|
|
344
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1::Source::Type::TaggedSymbol
|
|
345
|
+
)
|
|
346
|
+
|
|
347
|
+
sig do
|
|
348
|
+
override.returns(
|
|
349
|
+
T::Array[
|
|
350
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1::Source::Type::TaggedSymbol
|
|
351
|
+
]
|
|
352
|
+
)
|
|
353
|
+
end
|
|
354
|
+
def self.values
|
|
355
|
+
end
|
|
356
|
+
end
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
module Type
|
|
360
|
+
extend SafetyKit::Internal::Type::Enum
|
|
361
|
+
|
|
362
|
+
TaggedSymbol =
|
|
363
|
+
T.type_alias do
|
|
364
|
+
T.all(
|
|
365
|
+
Symbol,
|
|
366
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1::Type
|
|
367
|
+
)
|
|
368
|
+
end
|
|
369
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
370
|
+
|
|
371
|
+
IMAGE =
|
|
372
|
+
T.let(
|
|
373
|
+
:image,
|
|
374
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1::Type::TaggedSymbol
|
|
375
|
+
)
|
|
376
|
+
|
|
377
|
+
sig do
|
|
378
|
+
override.returns(
|
|
379
|
+
T::Array[
|
|
380
|
+
SafetyKit::ContentCreateParams::Content::UnionMember1::Type::TaggedSymbol
|
|
381
|
+
]
|
|
382
|
+
)
|
|
383
|
+
end
|
|
384
|
+
def self.values
|
|
385
|
+
end
|
|
386
|
+
end
|
|
387
|
+
end
|
|
388
|
+
|
|
389
|
+
sig do
|
|
390
|
+
override.returns(
|
|
391
|
+
T::Array[SafetyKit::ContentCreateParams::Content::Variants]
|
|
392
|
+
)
|
|
393
|
+
end
|
|
394
|
+
def self.variants
|
|
395
|
+
end
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
# The API version this operation is defined against.
|
|
399
|
+
module SafetyKitVersion
|
|
400
|
+
extend SafetyKit::Internal::Type::Enum
|
|
401
|
+
|
|
402
|
+
TaggedSymbol =
|
|
403
|
+
T.type_alias do
|
|
404
|
+
T.all(Symbol, SafetyKit::ContentCreateParams::SafetyKitVersion)
|
|
405
|
+
end
|
|
406
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
407
|
+
|
|
408
|
+
SAFETY_KIT_VERSION_2026_08_11 =
|
|
409
|
+
T.let(
|
|
410
|
+
:"2026-08-11",
|
|
411
|
+
SafetyKit::ContentCreateParams::SafetyKitVersion::TaggedSymbol
|
|
412
|
+
)
|
|
413
|
+
|
|
414
|
+
sig do
|
|
415
|
+
override.returns(
|
|
416
|
+
T::Array[
|
|
417
|
+
SafetyKit::ContentCreateParams::SafetyKitVersion::TaggedSymbol
|
|
418
|
+
]
|
|
419
|
+
)
|
|
420
|
+
end
|
|
421
|
+
def self.values
|
|
422
|
+
end
|
|
423
|
+
end
|
|
87
424
|
end
|
|
88
425
|
end
|
|
89
426
|
end
|