safetykit 0.51.0 → 0.52.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 +7 -9
- data/lib/safety_kit/models/content_create_response.rb +5 -9
- data/lib/safety_kit/resources/content.rb +3 -4
- data/lib/safety_kit/version.rb +1 -1
- data/rbi/safety_kit/models/content_create_params.rbi +10 -14
- data/rbi/safety_kit/models/content_create_response.rbi +6 -12
- data/rbi/safety_kit/resources/content.rbi +6 -9
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fb740cd06fd2147d66523afd833977860625eba2fa2b3b85dba5933a46f68a74
|
|
4
|
+
data.tar.gz: 49974de3af4a1b8188a16cd72999a6eb822338e4f2cb5b5ee80739885f550aad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bd4c8bf187f42c1ddbff83a393afd6c3e177414a1c37f62b6d1847c8457cc2de4d570d5941c6a81f13701006cd77c80f62b7919bcc26459418b6f9ca5b572fe8
|
|
7
|
+
data.tar.gz: 9bd4562815b061c8d5995cf75aa02752726f66e55cb2d8ecd5bd8893f434bd0470e403cef886e004214f20c04b35565096d731b539b27285444364e36d042989
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.52.0 (2026-08-05)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.51.0...v0.52.0](https://github.com/GetSafetyKit/safetykit-ruby/compare/v0.51.0...v0.52.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([9d34342](https://github.com/GetSafetyKit/safetykit-ruby/commit/9d343420a3716e47e99f484881f25944a3468e43))
|
|
10
|
+
|
|
3
11
|
## 0.51.0 (2026-08-05)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v0.50.0...v0.51.0](https://github.com/GetSafetyKit/safetykit-ruby/compare/v0.50.0...v0.51.0)
|
data/README.md
CHANGED
|
@@ -15,18 +15,15 @@ module SafetyKit
|
|
|
15
15
|
required :entity_id, String
|
|
16
16
|
|
|
17
17
|
# @!attribute content_id
|
|
18
|
-
# Your identifier for this
|
|
19
|
-
#
|
|
20
|
-
# same upload posted through the events API, so sending both never double-counts
|
|
21
|
-
# the content.
|
|
18
|
+
# Your identifier for this content, matching the content_id sent on /v1/events.
|
|
19
|
+
# Prevents double-counting content submitted to both endpoints.
|
|
22
20
|
#
|
|
23
21
|
# @return [String, nil]
|
|
24
22
|
optional :content_id, String
|
|
25
23
|
|
|
26
24
|
# @!attribute images
|
|
27
25
|
# Images to classify, each as base64-encoded image bytes, raw or as a data URI. At
|
|
28
|
-
# most 4 images
|
|
29
|
-
# 4.4MB of raw image bytes after base64 inflation.
|
|
26
|
+
# most 4 images, 5MB each.
|
|
30
27
|
#
|
|
31
28
|
# @return [Array<String>, nil]
|
|
32
29
|
optional :images, SafetyKit::Internal::Type::ArrayOf[String]
|
|
@@ -38,7 +35,8 @@ module SafetyKit
|
|
|
38
35
|
optional :metadata, SafetyKit::Internal::Type::HashOf[SafetyKit::Internal::Type::Unknown, nil?: true]
|
|
39
36
|
|
|
40
37
|
# @!attribute text
|
|
41
|
-
# User-authored text to classify. At most 20000 characters.
|
|
38
|
+
# User-authored text to classify. At most 20000 characters. Classification is
|
|
39
|
+
# based on the first 16,000 characters.
|
|
42
40
|
#
|
|
43
41
|
# @return [String, nil]
|
|
44
42
|
optional :text, String
|
|
@@ -49,13 +47,13 @@ module SafetyKit
|
|
|
49
47
|
#
|
|
50
48
|
# @param entity_id [String] Your stable identifier for the entity this content belongs to, such as a user, l
|
|
51
49
|
#
|
|
52
|
-
# @param content_id [String] Your identifier for this
|
|
50
|
+
# @param content_id [String] Your identifier for this content, matching the content_id sent on /v1/events. Pr
|
|
53
51
|
#
|
|
54
52
|
# @param images [Array<String>] Images to classify, each as base64-encoded image bytes, raw or as a data URI. At
|
|
55
53
|
#
|
|
56
54
|
# @param metadata [Hash{Symbol=>Object, nil}] Additional product context for this content. At most 8KB when serialized.
|
|
57
55
|
#
|
|
58
|
-
# @param text [String] User-authored text to classify. At most 20000 characters.
|
|
56
|
+
# @param text [String] User-authored text to classify. At most 20000 characters. Classification is base
|
|
59
57
|
#
|
|
60
58
|
# @param request_options [SafetyKit::RequestOptions, Hash{Symbol=>Object}]
|
|
61
59
|
end
|
|
@@ -24,10 +24,8 @@ module SafetyKit
|
|
|
24
24
|
required :entity_id, String
|
|
25
25
|
|
|
26
26
|
# @!attribute escalation
|
|
27
|
-
# Escalation outcome
|
|
28
|
-
#
|
|
29
|
-
# timed_out (escalation did not finish in budget, so decision is a provisional
|
|
30
|
-
# review).
|
|
27
|
+
# Escalation outcome: none (no escalation ran), completed (verdict reflected in
|
|
28
|
+
# decision), or timed_out (decision is a provisional review).
|
|
31
29
|
#
|
|
32
30
|
# @return [Symbol, SafetyKit::Models::ContentCreateResponse::Escalation]
|
|
33
31
|
required :escalation, enum: -> { SafetyKit::Models::ContentCreateResponse::Escalation }
|
|
@@ -64,7 +62,7 @@ module SafetyKit
|
|
|
64
62
|
#
|
|
65
63
|
# @param entity_id [String] The entity_id from the request.
|
|
66
64
|
#
|
|
67
|
-
# @param escalation [Symbol, SafetyKit::Models::ContentCreateResponse::Escalation] Escalation outcome
|
|
65
|
+
# @param escalation [Symbol, SafetyKit::Models::ContentCreateResponse::Escalation] Escalation outcome: none (no escalation ran), completed (verdict reflected in de
|
|
68
66
|
#
|
|
69
67
|
# @param mirrored [Boolean] Whether SafetyKit mirrored the submitted content for later review.
|
|
70
68
|
#
|
|
@@ -87,10 +85,8 @@ module SafetyKit
|
|
|
87
85
|
# @return [Array<Symbol>]
|
|
88
86
|
end
|
|
89
87
|
|
|
90
|
-
# Escalation outcome
|
|
91
|
-
#
|
|
92
|
-
# timed_out (escalation did not finish in budget, so decision is a provisional
|
|
93
|
-
# review).
|
|
88
|
+
# Escalation outcome: none (no escalation ran), completed (verdict reflected in
|
|
89
|
+
# decision), or timed_out (decision is a provisional review).
|
|
94
90
|
#
|
|
95
91
|
# @see SafetyKit::Models::ContentCreateResponse#escalation
|
|
96
92
|
module Escalation
|
|
@@ -10,20 +10,19 @@ module SafetyKit
|
|
|
10
10
|
#
|
|
11
11
|
# Classify a piece of content synchronously. Send user-authored text, images, or
|
|
12
12
|
# both, and receive a decision (approve, reject, or review) with classifier scores
|
|
13
|
-
# and reference set matches in the response.
|
|
14
|
-
# 6MB, which allows roughly 4.4MB of raw image bytes after base64 inflation.
|
|
13
|
+
# and reference set matches in the response. Requests have a maximum size of 6MB.
|
|
15
14
|
#
|
|
16
15
|
# @overload create(entity_id:, content_id: nil, images: nil, metadata: nil, text: nil, request_options: {})
|
|
17
16
|
#
|
|
18
17
|
# @param entity_id [String] Your stable identifier for the entity this content belongs to, such as a user, l
|
|
19
18
|
#
|
|
20
|
-
# @param content_id [String] Your identifier for this
|
|
19
|
+
# @param content_id [String] Your identifier for this content, matching the content_id sent on /v1/events. Pr
|
|
21
20
|
#
|
|
22
21
|
# @param images [Array<String>] Images to classify, each as base64-encoded image bytes, raw or as a data URI. At
|
|
23
22
|
#
|
|
24
23
|
# @param metadata [Hash{Symbol=>Object, nil}] Additional product context for this content. At most 8KB when serialized.
|
|
25
24
|
#
|
|
26
|
-
# @param text [String] User-authored text to classify. At most 20000 characters.
|
|
25
|
+
# @param text [String] User-authored text to classify. At most 20000 characters. Classification is base
|
|
27
26
|
#
|
|
28
27
|
# @param request_options [SafetyKit::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
29
28
|
#
|
data/lib/safety_kit/version.rb
CHANGED
|
@@ -16,10 +16,8 @@ module SafetyKit
|
|
|
16
16
|
sig { returns(String) }
|
|
17
17
|
attr_accessor :entity_id
|
|
18
18
|
|
|
19
|
-
# Your identifier for this
|
|
20
|
-
#
|
|
21
|
-
# same upload posted through the events API, so sending both never double-counts
|
|
22
|
-
# the content.
|
|
19
|
+
# Your identifier for this content, matching the content_id sent on /v1/events.
|
|
20
|
+
# Prevents double-counting content submitted to both endpoints.
|
|
23
21
|
sig { returns(T.nilable(String)) }
|
|
24
22
|
attr_reader :content_id
|
|
25
23
|
|
|
@@ -27,8 +25,7 @@ module SafetyKit
|
|
|
27
25
|
attr_writer :content_id
|
|
28
26
|
|
|
29
27
|
# Images to classify, each as base64-encoded image bytes, raw or as a data URI. At
|
|
30
|
-
# most 4 images
|
|
31
|
-
# 4.4MB of raw image bytes after base64 inflation.
|
|
28
|
+
# most 4 images, 5MB each.
|
|
32
29
|
sig { returns(T.nilable(T::Array[String])) }
|
|
33
30
|
attr_reader :images
|
|
34
31
|
|
|
@@ -42,7 +39,8 @@ module SafetyKit
|
|
|
42
39
|
sig { params(metadata: T::Hash[Symbol, T.nilable(T.anything)]).void }
|
|
43
40
|
attr_writer :metadata
|
|
44
41
|
|
|
45
|
-
# User-authored text to classify. At most 20000 characters.
|
|
42
|
+
# User-authored text to classify. At most 20000 characters. Classification is
|
|
43
|
+
# based on the first 16,000 characters.
|
|
46
44
|
sig { returns(T.nilable(String)) }
|
|
47
45
|
attr_reader :text
|
|
48
46
|
|
|
@@ -63,18 +61,16 @@ module SafetyKit
|
|
|
63
61
|
# Your stable identifier for the entity this content belongs to, such as a user,
|
|
64
62
|
# listing, or message thread.
|
|
65
63
|
entity_id:,
|
|
66
|
-
# Your identifier for this
|
|
67
|
-
#
|
|
68
|
-
# same upload posted through the events API, so sending both never double-counts
|
|
69
|
-
# the content.
|
|
64
|
+
# Your identifier for this content, matching the content_id sent on /v1/events.
|
|
65
|
+
# Prevents double-counting content submitted to both endpoints.
|
|
70
66
|
content_id: nil,
|
|
71
67
|
# Images to classify, each as base64-encoded image bytes, raw or as a data URI. At
|
|
72
|
-
# most 4 images
|
|
73
|
-
# 4.4MB of raw image bytes after base64 inflation.
|
|
68
|
+
# most 4 images, 5MB each.
|
|
74
69
|
images: nil,
|
|
75
70
|
# Additional product context for this content. At most 8KB when serialized.
|
|
76
71
|
metadata: nil,
|
|
77
|
-
# User-authored text to classify. At most 20000 characters.
|
|
72
|
+
# User-authored text to classify. At most 20000 characters. Classification is
|
|
73
|
+
# based on the first 16,000 characters.
|
|
78
74
|
text: nil,
|
|
79
75
|
request_options: {}
|
|
80
76
|
)
|
|
@@ -28,10 +28,8 @@ module SafetyKit
|
|
|
28
28
|
sig { returns(String) }
|
|
29
29
|
attr_accessor :entity_id
|
|
30
30
|
|
|
31
|
-
# Escalation outcome
|
|
32
|
-
#
|
|
33
|
-
# timed_out (escalation did not finish in budget, so decision is a provisional
|
|
34
|
-
# review).
|
|
31
|
+
# Escalation outcome: none (no escalation ran), completed (verdict reflected in
|
|
32
|
+
# decision), or timed_out (decision is a provisional review).
|
|
35
33
|
sig do
|
|
36
34
|
returns(
|
|
37
35
|
SafetyKit::Models::ContentCreateResponse::Escalation::TaggedSymbol
|
|
@@ -81,10 +79,8 @@ module SafetyKit
|
|
|
81
79
|
decision:,
|
|
82
80
|
# The entity_id from the request.
|
|
83
81
|
entity_id:,
|
|
84
|
-
# Escalation outcome
|
|
85
|
-
#
|
|
86
|
-
# timed_out (escalation did not finish in budget, so decision is a provisional
|
|
87
|
-
# review).
|
|
82
|
+
# Escalation outcome: none (no escalation ran), completed (verdict reflected in
|
|
83
|
+
# decision), or timed_out (decision is a provisional review).
|
|
88
84
|
escalation:,
|
|
89
85
|
# Whether SafetyKit mirrored the submitted content for later review.
|
|
90
86
|
mirrored:,
|
|
@@ -154,10 +150,8 @@ module SafetyKit
|
|
|
154
150
|
end
|
|
155
151
|
end
|
|
156
152
|
|
|
157
|
-
# Escalation outcome
|
|
158
|
-
#
|
|
159
|
-
# timed_out (escalation did not finish in budget, so decision is a provisional
|
|
160
|
-
# review).
|
|
153
|
+
# Escalation outcome: none (no escalation ran), completed (verdict reflected in
|
|
154
|
+
# decision), or timed_out (decision is a provisional review).
|
|
161
155
|
module Escalation
|
|
162
156
|
extend SafetyKit::Internal::Type::Enum
|
|
163
157
|
|
|
@@ -7,8 +7,7 @@ module SafetyKit
|
|
|
7
7
|
class Content
|
|
8
8
|
# Classify a piece of content synchronously. Send user-authored text, images, or
|
|
9
9
|
# both, and receive a decision (approve, reject, or review) with classifier scores
|
|
10
|
-
# and reference set matches in the response.
|
|
11
|
-
# 6MB, which allows roughly 4.4MB of raw image bytes after base64 inflation.
|
|
10
|
+
# and reference set matches in the response. Requests have a maximum size of 6MB.
|
|
12
11
|
sig do
|
|
13
12
|
params(
|
|
14
13
|
entity_id: String,
|
|
@@ -23,18 +22,16 @@ module SafetyKit
|
|
|
23
22
|
# Your stable identifier for the entity this content belongs to, such as a user,
|
|
24
23
|
# listing, or message thread.
|
|
25
24
|
entity_id:,
|
|
26
|
-
# Your identifier for this
|
|
27
|
-
#
|
|
28
|
-
# same upload posted through the events API, so sending both never double-counts
|
|
29
|
-
# the content.
|
|
25
|
+
# Your identifier for this content, matching the content_id sent on /v1/events.
|
|
26
|
+
# Prevents double-counting content submitted to both endpoints.
|
|
30
27
|
content_id: nil,
|
|
31
28
|
# Images to classify, each as base64-encoded image bytes, raw or as a data URI. At
|
|
32
|
-
# most 4 images
|
|
33
|
-
# 4.4MB of raw image bytes after base64 inflation.
|
|
29
|
+
# most 4 images, 5MB each.
|
|
34
30
|
images: nil,
|
|
35
31
|
# Additional product context for this content. At most 8KB when serialized.
|
|
36
32
|
metadata: nil,
|
|
37
|
-
# User-authored text to classify. At most 20000 characters.
|
|
33
|
+
# User-authored text to classify. At most 20000 characters. Classification is
|
|
34
|
+
# based on the first 16,000 characters.
|
|
38
35
|
text: nil,
|
|
39
36
|
request_options: {}
|
|
40
37
|
)
|