safetykit 0.55.0 → 0.57.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 +16 -0
- data/README.md +1 -1
- data/lib/safety_kit/models/content_create_response.rb +8 -4
- data/lib/safety_kit/resources/content.rb +5 -0
- data/lib/safety_kit/resources/streams.rb +20 -0
- data/lib/safety_kit/version.rb +1 -1
- data/rbi/safety_kit/models/content_create_response.rbi +7 -5
- data/rbi/safety_kit/resources/content.rbi +5 -0
- data/rbi/safety_kit/resources/streams.rbi +20 -0
- data/sig/safety_kit/models/content_create_response.rbs +4 -4
- 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: e4a9fe4f557160546a74ced889958cc6d4661d93568c6661b7af9c58e2fdae86
|
|
4
|
+
data.tar.gz: '039d13c3701ca7716133699eed8054fe85c58b18dadf80011ddcde34c4698fd0'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 98ec2e2670762a62dd4577d7fd3b4f1e00c2f336411690a193f201b9f072a3315d5af4156c2942601d8cbac69621fa0b22480ba996ec1155d8910892c38da4da
|
|
7
|
+
data.tar.gz: ab2f31b01990b336f95ba3c3b8664c945c15c87aef7e5cb94b22a774c67825098409a7fd4fb2786561e49af435d13ce3162d7724e3ce51017e826e2a97e8d37a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.57.0 (2026-08-11)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.56.0...v0.57.0](https://github.com/GetSafetyKit/safetykit-ruby/compare/v0.56.0...v0.57.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([85b1dd1](https://github.com/GetSafetyKit/safetykit-ruby/commit/85b1dd123b3cd30db6824146d29bffe4ef5e2f57))
|
|
10
|
+
|
|
11
|
+
## 0.56.0 (2026-08-07)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v0.55.0...v0.56.0](https://github.com/GetSafetyKit/safetykit-ruby/compare/v0.55.0...v0.56.0)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **api:** api update ([56f203f](https://github.com/GetSafetyKit/safetykit-ruby/commit/56f203f076e1ca7e68776fc18543d100462963a0))
|
|
18
|
+
|
|
3
19
|
## 0.55.0 (2026-08-06)
|
|
4
20
|
|
|
5
21
|
Full Changelog: [v0.54.0...v0.55.0](https://github.com/GetSafetyKit/safetykit-ruby/compare/v0.54.0...v0.55.0)
|
data/README.md
CHANGED
|
@@ -61,10 +61,11 @@ module SafetyKit
|
|
|
61
61
|
required :policy_id, String
|
|
62
62
|
|
|
63
63
|
# @!attribute score
|
|
64
|
-
#
|
|
64
|
+
# Classifier score between 0 and 1. Higher means more likely violating. Null when
|
|
65
|
+
# no classifier scored the policy.
|
|
65
66
|
#
|
|
66
|
-
# @return [Float]
|
|
67
|
-
required :score, Float
|
|
67
|
+
# @return [Float, nil]
|
|
68
|
+
required :score, Float, nil?: true
|
|
68
69
|
|
|
69
70
|
# @!attribute version
|
|
70
71
|
# Version of the policy.
|
|
@@ -73,6 +74,9 @@ module SafetyKit
|
|
|
73
74
|
required :version, String
|
|
74
75
|
|
|
75
76
|
# @!method initialize(decision:, escalation:, policy_id:, score:, version:)
|
|
77
|
+
# Some parameter documentations has been truncated, see
|
|
78
|
+
# {SafetyKit::Models::ContentCreateResponse::Policy} for more details.
|
|
79
|
+
#
|
|
76
80
|
# Result for one policy evaluated against the submitted content.
|
|
77
81
|
#
|
|
78
82
|
# @param decision [Symbol, SafetyKit::Models::ContentCreateResponse::Policy::Decision] Whether the submitted content violates the policy.
|
|
@@ -81,7 +85,7 @@ module SafetyKit
|
|
|
81
85
|
#
|
|
82
86
|
# @param policy_id [String] Identifier of the policy.
|
|
83
87
|
#
|
|
84
|
-
# @param score [Float]
|
|
88
|
+
# @param score [Float, nil] Classifier score between 0 and 1. Higher means more likely violating. Null when
|
|
85
89
|
#
|
|
86
90
|
# @param version [String] Version of the policy.
|
|
87
91
|
|
|
@@ -12,6 +12,11 @@ module SafetyKit
|
|
|
12
12
|
# both, and receive per-policy results in the response. Requests have a maximum
|
|
13
13
|
# size of 6MB.
|
|
14
14
|
#
|
|
15
|
+
# Errors: 400 for an invalid body or images, with the failing field in the
|
|
16
|
+
# message. 401 for a missing or invalid API key. 413 for requests over 6MB. 503
|
|
17
|
+
# when classification is temporarily unavailable, in which case the request was
|
|
18
|
+
# not processed and is safe to retry.
|
|
19
|
+
#
|
|
15
20
|
# @overload create(user_id:, content_id: nil, images: nil, metadata: nil, text: nil, request_options: {})
|
|
16
21
|
#
|
|
17
22
|
# @param user_id [String] Your stable identifier for the user this content belongs to.
|
|
@@ -6,6 +6,12 @@ module SafetyKit
|
|
|
6
6
|
class Streams
|
|
7
7
|
# Monitor the livestream at the given stream URL. This method returns immediately.
|
|
8
8
|
#
|
|
9
|
+
# Errors: 400 for an invalid body, with the reason in the message. 401 for a
|
|
10
|
+
# missing Authorization header. 403 for an invalid API key. 429 when the rate
|
|
11
|
+
# limit is exceeded. 5xx for transient internal failures. Retry 429 and 5xx with
|
|
12
|
+
# exponential backoff. Do not retry other 4xx errors, they indicate a problem with
|
|
13
|
+
# the request.
|
|
14
|
+
#
|
|
9
15
|
# @overload add(namespace, id:, stream_url:, request_options: {})
|
|
10
16
|
#
|
|
11
17
|
# @param namespace [String] The namespace to ingest stream data into
|
|
@@ -43,6 +49,13 @@ module SafetyKit
|
|
|
43
49
|
# ignored by downstream processing. This method returns immediately after the
|
|
44
50
|
# frame has been accepted for processing.
|
|
45
51
|
#
|
|
52
|
+
# Errors: 400 for an invalid body or an image that fails validation, with the
|
|
53
|
+
# reason in the message. 401 for a missing Authorization header. 403 for an
|
|
54
|
+
# invalid API key. 429 when the rate limit is exceeded. 5xx for transient internal
|
|
55
|
+
# failures. Retry 429 and 5xx with exponential backoff. Frame ingestion is
|
|
56
|
+
# idempotent, so a retried request that already succeeded is ignored. Do not retry
|
|
57
|
+
# other 4xx errors, they indicate a problem with the request.
|
|
58
|
+
#
|
|
46
59
|
# @overload add_frame(namespace, image_data_uri:, stream_id:, timestamp:, frame_id: nil, metadata: nil, request_options: {})
|
|
47
60
|
#
|
|
48
61
|
# @param namespace [String] The namespace to ingest stream data into
|
|
@@ -80,6 +93,13 @@ module SafetyKit
|
|
|
80
93
|
# correctly with later frames. This method returns immediately after the
|
|
81
94
|
# transcript has been accepted for processing.
|
|
82
95
|
#
|
|
96
|
+
# Errors: 400 for an invalid body, with the reason in the message. 401 for a
|
|
97
|
+
# missing Authorization header. 403 for an invalid API key. 429 when the rate
|
|
98
|
+
# limit is exceeded. 5xx for transient internal failures. Retry 429 and 5xx with
|
|
99
|
+
# exponential backoff. Transcript ingestion is idempotent, so a retried request
|
|
100
|
+
# that already succeeded is ignored. Do not retry other 4xx errors, they indicate
|
|
101
|
+
# a problem with the request.
|
|
102
|
+
#
|
|
83
103
|
# @overload add_transcript(namespace, stream_id:, text:, timestamp:, transcript_id: nil, request_options: {})
|
|
84
104
|
#
|
|
85
105
|
# @param namespace [String] The namespace to ingest stream data into
|
data/lib/safety_kit/version.rb
CHANGED
|
@@ -104,8 +104,9 @@ module SafetyKit
|
|
|
104
104
|
sig { returns(String) }
|
|
105
105
|
attr_accessor :policy_id
|
|
106
106
|
|
|
107
|
-
#
|
|
108
|
-
|
|
107
|
+
# Classifier score between 0 and 1. Higher means more likely violating. Null when
|
|
108
|
+
# no classifier scored the policy.
|
|
109
|
+
sig { returns(T.nilable(Float)) }
|
|
109
110
|
attr_accessor :score
|
|
110
111
|
|
|
111
112
|
# Version of the policy.
|
|
@@ -120,7 +121,7 @@ module SafetyKit
|
|
|
120
121
|
escalation:
|
|
121
122
|
SafetyKit::Models::ContentCreateResponse::Policy::Escalation::OrSymbol,
|
|
122
123
|
policy_id: String,
|
|
123
|
-
score: Float,
|
|
124
|
+
score: T.nilable(Float),
|
|
124
125
|
version: String
|
|
125
126
|
).returns(T.attached_class)
|
|
126
127
|
end
|
|
@@ -131,7 +132,8 @@ module SafetyKit
|
|
|
131
132
|
escalation:,
|
|
132
133
|
# Identifier of the policy.
|
|
133
134
|
policy_id:,
|
|
134
|
-
#
|
|
135
|
+
# Classifier score between 0 and 1. Higher means more likely violating. Null when
|
|
136
|
+
# no classifier scored the policy.
|
|
135
137
|
score:,
|
|
136
138
|
# Version of the policy.
|
|
137
139
|
version:
|
|
@@ -146,7 +148,7 @@ module SafetyKit
|
|
|
146
148
|
escalation:
|
|
147
149
|
SafetyKit::Models::ContentCreateResponse::Policy::Escalation::TaggedSymbol,
|
|
148
150
|
policy_id: String,
|
|
149
|
-
score: Float,
|
|
151
|
+
score: T.nilable(Float),
|
|
150
152
|
version: String
|
|
151
153
|
}
|
|
152
154
|
)
|
|
@@ -8,6 +8,11 @@ module SafetyKit
|
|
|
8
8
|
# Classify a piece of content synchronously. Send user-authored text, images, or
|
|
9
9
|
# both, and receive per-policy results in the response. Requests have a maximum
|
|
10
10
|
# size of 6MB.
|
|
11
|
+
#
|
|
12
|
+
# Errors: 400 for an invalid body or images, with the failing field in the
|
|
13
|
+
# message. 401 for a missing or invalid API key. 413 for requests over 6MB. 503
|
|
14
|
+
# when classification is temporarily unavailable, in which case the request was
|
|
15
|
+
# not processed and is safe to retry.
|
|
11
16
|
sig do
|
|
12
17
|
params(
|
|
13
18
|
user_id: String,
|
|
@@ -5,6 +5,12 @@ module SafetyKit
|
|
|
5
5
|
# Ingest and monitor livestream content.
|
|
6
6
|
class Streams
|
|
7
7
|
# Monitor the livestream at the given stream URL. This method returns immediately.
|
|
8
|
+
#
|
|
9
|
+
# Errors: 400 for an invalid body, with the reason in the message. 401 for a
|
|
10
|
+
# missing Authorization header. 403 for an invalid API key. 429 when the rate
|
|
11
|
+
# limit is exceeded. 5xx for transient internal failures. Retry 429 and 5xx with
|
|
12
|
+
# exponential backoff. Do not retry other 4xx errors, they indicate a problem with
|
|
13
|
+
# the request.
|
|
8
14
|
sig do
|
|
9
15
|
params(
|
|
10
16
|
namespace: String,
|
|
@@ -31,6 +37,13 @@ module SafetyKit
|
|
|
31
37
|
# Duplicate or out-of-order frame timestamps are accepted at the API boundary but
|
|
32
38
|
# ignored by downstream processing. This method returns immediately after the
|
|
33
39
|
# frame has been accepted for processing.
|
|
40
|
+
#
|
|
41
|
+
# Errors: 400 for an invalid body or an image that fails validation, with the
|
|
42
|
+
# reason in the message. 401 for a missing Authorization header. 403 for an
|
|
43
|
+
# invalid API key. 429 when the rate limit is exceeded. 5xx for transient internal
|
|
44
|
+
# failures. Retry 429 and 5xx with exponential backoff. Frame ingestion is
|
|
45
|
+
# idempotent, so a retried request that already succeeded is ignored. Do not retry
|
|
46
|
+
# other 4xx errors, they indicate a problem with the request.
|
|
34
47
|
sig do
|
|
35
48
|
params(
|
|
36
49
|
namespace: String,
|
|
@@ -67,6 +80,13 @@ module SafetyKit
|
|
|
67
80
|
# monotonically increasing within a stream so transcript context lines up
|
|
68
81
|
# correctly with later frames. This method returns immediately after the
|
|
69
82
|
# transcript has been accepted for processing.
|
|
83
|
+
#
|
|
84
|
+
# Errors: 400 for an invalid body, with the reason in the message. 401 for a
|
|
85
|
+
# missing Authorization header. 403 for an invalid API key. 429 when the rate
|
|
86
|
+
# limit is exceeded. 5xx for transient internal failures. Retry 429 and 5xx with
|
|
87
|
+
# exponential backoff. Transcript ingestion is idempotent, so a retried request
|
|
88
|
+
# that already succeeded is ignored. Do not retry other 4xx errors, they indicate
|
|
89
|
+
# a problem with the request.
|
|
70
90
|
sig do
|
|
71
91
|
params(
|
|
72
92
|
namespace: String,
|
|
@@ -36,7 +36,7 @@ module SafetyKit
|
|
|
36
36
|
decision: SafetyKit::Models::ContentCreateResponse::Policy::decision,
|
|
37
37
|
escalation: SafetyKit::Models::ContentCreateResponse::Policy::escalation,
|
|
38
38
|
policy_id: String,
|
|
39
|
-
score: Float
|
|
39
|
+
score: Float?,
|
|
40
40
|
version: String
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -47,7 +47,7 @@ module SafetyKit
|
|
|
47
47
|
|
|
48
48
|
attr_accessor policy_id: String
|
|
49
49
|
|
|
50
|
-
attr_accessor score: Float
|
|
50
|
+
attr_accessor score: Float?
|
|
51
51
|
|
|
52
52
|
attr_accessor version: String
|
|
53
53
|
|
|
@@ -55,7 +55,7 @@ module SafetyKit
|
|
|
55
55
|
decision: SafetyKit::Models::ContentCreateResponse::Policy::decision,
|
|
56
56
|
escalation: SafetyKit::Models::ContentCreateResponse::Policy::escalation,
|
|
57
57
|
policy_id: String,
|
|
58
|
-
score: Float
|
|
58
|
+
score: Float?,
|
|
59
59
|
version: String
|
|
60
60
|
) -> void
|
|
61
61
|
|
|
@@ -63,7 +63,7 @@ module SafetyKit
|
|
|
63
63
|
decision: SafetyKit::Models::ContentCreateResponse::Policy::decision,
|
|
64
64
|
escalation: SafetyKit::Models::ContentCreateResponse::Policy::escalation,
|
|
65
65
|
policy_id: String,
|
|
66
|
-
score: Float
|
|
66
|
+
score: Float?,
|
|
67
67
|
version: String
|
|
68
68
|
}
|
|
69
69
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: safetykit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.57.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Safetykit
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-08-
|
|
11
|
+
date: 2026-08-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|