safetykit 0.56.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e4f14e3ad89b25b2fdd5f3cc9683b7397a4a71cda7d7f31a9a12bf4bdd081333
4
- data.tar.gz: eedcb639f3053397b70fddff1853c49d5313e0146d9139a44dba5129d1863b75
3
+ metadata.gz: 9283c72242f9da00698a358a99a018701a042b3de8b402a9efc5aa998b7cb145
4
+ data.tar.gz: 4f0e511b6540d3b7c05d9f2ab09cc90aedd779c0c5a39c8c3f10c6334eae4730
5
5
  SHA512:
6
- metadata.gz: 1e7d88a65263dd63d77dd2fcdc39510fec92b32fb20ace949182a02a55cfb4ed34771439fb6e62200bbfb3aafb1ea546c37ee903a18f0fd7a94531f261a1678c
7
- data.tar.gz: 710b42dff5bb08f06668078f5a73756b7dd705c4d3e9bf05d3f5d98c9ddab13e34332ae5e06e01936d8f256e7ad626b24be3a0d6276c41155b7a0dc9645881df
6
+ metadata.gz: 754d578687d2e96ae89e407fe3d5edd4bcecc658fefc899d382d4da7b52c0703e8624539ce59a66733595a17810454a150e25b6c39b69812edf350795a34d241
7
+ data.tar.gz: fd0eb6f82659e7f5b55e0a0f0380cafae7e85aef310776a9b37fa6236f354037fabf2579415f5f45356b977b193b3a71cf9d6298b3e1147454917b03216f3fa2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.58.0 (2026-08-11)
4
+
5
+ Full Changelog: [v0.57.0...v0.58.0](https://github.com/GetSafetyKit/safetykit-ruby/compare/v0.57.0...v0.58.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([6e357b2](https://github.com/GetSafetyKit/safetykit-ruby/commit/6e357b2845a8f97084b348cb2bf7dccdb97c5d43))
10
+
11
+ ## 0.57.0 (2026-08-11)
12
+
13
+ Full Changelog: [v0.56.0...v0.57.0](https://github.com/GetSafetyKit/safetykit-ruby/compare/v0.56.0...v0.57.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** api update ([85b1dd1](https://github.com/GetSafetyKit/safetykit-ruby/commit/85b1dd123b3cd30db6824146d29bffe4ef5e2f57))
18
+
3
19
  ## 0.56.0 (2026-08-07)
4
20
 
5
21
  Full Changelog: [v0.55.0...v0.56.0](https://github.com/GetSafetyKit/safetykit-ruby/compare/v0.55.0...v0.56.0)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "safetykit", "~> 0.56.0"
20
+ gem "safetykit", "~> 0.58.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -7,6 +7,13 @@ module SafetyKit
7
7
  extend SafetyKit::Internal::Type::RequestParameters::Converter
8
8
  include SafetyKit::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute content
11
+ # Content parts to classify together. At most 20 images.
12
+ #
13
+ # @return [Array<SafetyKit::Models::ContentCreateParams::Content::UnionMember0, SafetyKit::Models::ContentCreateParams::Content::UnionMember1>]
14
+ required :content,
15
+ -> { SafetyKit::Internal::Type::ArrayOf[union: SafetyKit::ContentCreateParams::Content] }
16
+
10
17
  # @!attribute user_id
11
18
  # Your stable identifier for the user this content belongs to.
12
19
  #
@@ -19,40 +26,152 @@ module SafetyKit
19
26
  # @return [String, nil]
20
27
  optional :content_id, String
21
28
 
22
- # @!attribute images
23
- # Images to classify, each as base64-encoded image bytes, raw or as a data URI. At
24
- # most 5MB each.
25
- #
26
- # @return [Array<String>, nil]
27
- optional :images, SafetyKit::Internal::Type::ArrayOf[String]
28
-
29
29
  # @!attribute metadata
30
30
  # Additional product context for this content. At most 8KB when serialized.
31
31
  #
32
32
  # @return [Hash{Symbol=>Object, nil}, nil]
33
33
  optional :metadata, SafetyKit::Internal::Type::HashOf[SafetyKit::Internal::Type::Unknown, nil?: true]
34
34
 
35
- # @!attribute text
36
- # User-authored text to classify.
35
+ # @!attribute safety_kit_version
36
+ # The API version this operation is defined against.
37
37
  #
38
- # @return [String, nil]
39
- optional :text, String
38
+ # @return [Symbol, SafetyKit::Models::ContentCreateParams::SafetyKitVersion, nil]
39
+ optional :safety_kit_version, enum: -> { SafetyKit::ContentCreateParams::SafetyKitVersion }
40
40
 
41
- # @!method initialize(user_id:, content_id: nil, images: nil, metadata: nil, text: nil, request_options: {})
42
- # Some parameter documentations has been truncated, see
43
- # {SafetyKit::Models::ContentCreateParams} for more details.
41
+ # @!method initialize(content:, user_id:, content_id: nil, metadata: nil, safety_kit_version: nil, request_options: {})
42
+ # @param content [Array<SafetyKit::Models::ContentCreateParams::Content::UnionMember0, SafetyKit::Models::ContentCreateParams::Content::UnionMember1>] Content parts to classify together. At most 20 images.
44
43
  #
45
44
  # @param user_id [String] Your stable identifier for the user this content belongs to.
46
45
  #
47
46
  # @param content_id [String] Your content identifier.
48
47
  #
49
- # @param images [Array<String>] Images to classify, each as base64-encoded image bytes, raw or as a data URI. At
50
- #
51
48
  # @param metadata [Hash{Symbol=>Object, nil}] Additional product context for this content. At most 8KB when serialized.
52
49
  #
53
- # @param text [String] User-authored text to classify.
50
+ # @param safety_kit_version [Symbol, SafetyKit::Models::ContentCreateParams::SafetyKitVersion] The API version this operation is defined against.
54
51
  #
55
52
  # @param request_options [SafetyKit::RequestOptions, Hash{Symbol=>Object}]
53
+
54
+ # One part of the submitted content.
55
+ module Content
56
+ extend SafetyKit::Internal::Type::Union
57
+
58
+ variant -> { SafetyKit::ContentCreateParams::Content::UnionMember0 }
59
+
60
+ variant -> { SafetyKit::ContentCreateParams::Content::UnionMember1 }
61
+
62
+ class UnionMember0 < SafetyKit::Internal::Type::BaseModel
63
+ # @!attribute text
64
+ # User-authored text to classify.
65
+ #
66
+ # @return [String]
67
+ required :text, String
68
+
69
+ # @!attribute type
70
+ #
71
+ # @return [Symbol, SafetyKit::Models::ContentCreateParams::Content::UnionMember0::Type]
72
+ required :type, enum: -> { SafetyKit::ContentCreateParams::Content::UnionMember0::Type }
73
+
74
+ # @!attribute key
75
+ # Your name for where this part came from.
76
+ #
77
+ # @return [String, nil]
78
+ optional :key, String
79
+
80
+ # @!method initialize(text:, type:, key: nil)
81
+ # @param text [String] User-authored text to classify.
82
+ #
83
+ # @param type [Symbol, SafetyKit::Models::ContentCreateParams::Content::UnionMember0::Type]
84
+ #
85
+ # @param key [String] Your name for where this part came from.
86
+
87
+ # @see SafetyKit::Models::ContentCreateParams::Content::UnionMember0#type
88
+ module Type
89
+ extend SafetyKit::Internal::Type::Enum
90
+
91
+ TEXT = :text
92
+
93
+ # @!method self.values
94
+ # @return [Array<Symbol>]
95
+ end
96
+ end
97
+
98
+ class UnionMember1 < SafetyKit::Internal::Type::BaseModel
99
+ # @!attribute source
100
+ #
101
+ # @return [SafetyKit::Models::ContentCreateParams::Content::UnionMember1::Source]
102
+ required :source, -> { SafetyKit::ContentCreateParams::Content::UnionMember1::Source }
103
+
104
+ # @!attribute type
105
+ #
106
+ # @return [Symbol, SafetyKit::Models::ContentCreateParams::Content::UnionMember1::Type]
107
+ required :type, enum: -> { SafetyKit::ContentCreateParams::Content::UnionMember1::Type }
108
+
109
+ # @!attribute key
110
+ # Your name for where this part came from.
111
+ #
112
+ # @return [String, nil]
113
+ optional :key, String
114
+
115
+ # @!method initialize(source:, type:, key: nil)
116
+ # @param source [SafetyKit::Models::ContentCreateParams::Content::UnionMember1::Source]
117
+ #
118
+ # @param type [Symbol, SafetyKit::Models::ContentCreateParams::Content::UnionMember1::Type]
119
+ #
120
+ # @param key [String] Your name for where this part came from.
121
+
122
+ # @see SafetyKit::Models::ContentCreateParams::Content::UnionMember1#source
123
+ class Source < SafetyKit::Internal::Type::BaseModel
124
+ # @!attribute data
125
+ # Base64-encoded image bytes, raw or as a data URI. At most 5MB.
126
+ #
127
+ # @return [String]
128
+ required :data, String
129
+
130
+ # @!attribute type
131
+ #
132
+ # @return [Symbol, SafetyKit::Models::ContentCreateParams::Content::UnionMember1::Source::Type]
133
+ required :type, enum: -> { SafetyKit::ContentCreateParams::Content::UnionMember1::Source::Type }
134
+
135
+ # @!method initialize(data:, type:)
136
+ # @param data [String] Base64-encoded image bytes, raw or as a data URI. At most 5MB.
137
+ #
138
+ # @param type [Symbol, SafetyKit::Models::ContentCreateParams::Content::UnionMember1::Source::Type]
139
+
140
+ # @see SafetyKit::Models::ContentCreateParams::Content::UnionMember1::Source#type
141
+ module Type
142
+ extend SafetyKit::Internal::Type::Enum
143
+
144
+ BASE64 = :base64
145
+
146
+ # @!method self.values
147
+ # @return [Array<Symbol>]
148
+ end
149
+ end
150
+
151
+ # @see SafetyKit::Models::ContentCreateParams::Content::UnionMember1#type
152
+ module Type
153
+ extend SafetyKit::Internal::Type::Enum
154
+
155
+ IMAGE = :image
156
+
157
+ # @!method self.values
158
+ # @return [Array<Symbol>]
159
+ end
160
+ end
161
+
162
+ # @!method self.variants
163
+ # @return [Array(SafetyKit::Models::ContentCreateParams::Content::UnionMember0, SafetyKit::Models::ContentCreateParams::Content::UnionMember1)]
164
+ end
165
+
166
+ # The API version this operation is defined against.
167
+ module SafetyKitVersion
168
+ extend SafetyKit::Internal::Type::Enum
169
+
170
+ SAFETY_KIT_VERSION_2026_08_11 = :"2026-08-11"
171
+
172
+ # @!method self.values
173
+ # @return [Array<Symbol>]
174
+ end
56
175
  end
57
176
  end
58
177
  end
@@ -10,19 +10,12 @@ module SafetyKit
10
10
  # @return [String]
11
11
  required :content_id, String
12
12
 
13
- # @!attribute policies
14
- # Per-policy results for the submitted content.
13
+ # @!attribute labels
14
+ # Per-label results for the submitted content.
15
15
  #
16
- # @return [Array<SafetyKit::Models::ContentCreateResponse::Policy>]
17
- required :policies,
18
- -> { SafetyKit::Internal::Type::ArrayOf[SafetyKit::Models::ContentCreateResponse::Policy] }
19
-
20
- # @!attribute reference_set_matches
21
- # Reference set matches found for the submitted content.
22
- #
23
- # @return [Array<SafetyKit::Models::ContentCreateResponse::ReferenceSetMatch>]
24
- required :reference_set_matches,
25
- -> { SafetyKit::Internal::Type::ArrayOf[SafetyKit::Models::ContentCreateResponse::ReferenceSetMatch] }
16
+ # @return [Array<SafetyKit::Models::ContentCreateResponse::Label::UnionMember0, SafetyKit::Models::ContentCreateResponse::Label::UnionMember1>]
17
+ required :labels,
18
+ -> { SafetyKit::Internal::Type::ArrayOf[union: SafetyKit::Models::ContentCreateResponse::Label] }
26
19
 
27
20
  # @!attribute user_id
28
21
  # The user_id from the request.
@@ -30,109 +23,217 @@ module SafetyKit
30
23
  # @return [String]
31
24
  required :user_id, String
32
25
 
33
- # @!method initialize(content_id:, policies:, reference_set_matches:, user_id:)
26
+ # @!attribute version
27
+ # The API version that served this request.
28
+ #
29
+ # @return [String]
30
+ required :version, String
31
+
32
+ # @!method initialize(content_id:, labels:, user_id:, version:)
34
33
  # Synchronous classification result for the submitted content.
35
34
  #
36
35
  # @param content_id [String] SafetyKit identifier for the classified content.
37
36
  #
38
- # @param policies [Array<SafetyKit::Models::ContentCreateResponse::Policy>] Per-policy results for the submitted content.
39
- #
40
- # @param reference_set_matches [Array<SafetyKit::Models::ContentCreateResponse::ReferenceSetMatch>] Reference set matches found for the submitted content.
37
+ # @param labels [Array<SafetyKit::Models::ContentCreateResponse::Label::UnionMember0, SafetyKit::Models::ContentCreateResponse::Label::UnionMember1>] Per-label results for the submitted content.
41
38
  #
42
39
  # @param user_id [String] The user_id from the request.
43
-
44
- class Policy < SafetyKit::Internal::Type::BaseModel
45
- # @!attribute decision
46
- # Whether the submitted content violates the policy.
47
- #
48
- # @return [Symbol, SafetyKit::Models::ContentCreateResponse::Policy::Decision]
49
- required :decision, enum: -> { SafetyKit::Models::ContentCreateResponse::Policy::Decision }
50
-
51
- # @!attribute escalation
52
- # Escalation outcome for this policy.
53
- #
54
- # @return [Symbol, SafetyKit::Models::ContentCreateResponse::Policy::Escalation]
55
- required :escalation, enum: -> { SafetyKit::Models::ContentCreateResponse::Policy::Escalation }
56
-
57
- # @!attribute policy_id
58
- # Identifier of the policy.
59
- #
60
- # @return [String]
61
- required :policy_id, String
62
-
63
- # @!attribute score
64
- # Policy score between 0 and 1. Higher means more likely violating.
65
- #
66
- # @return [Float]
67
- required :score, Float
68
-
69
- # @!attribute version
70
- # Version of the policy.
71
- #
72
- # @return [String]
73
- required :version, String
74
-
75
- # @!method initialize(decision:, escalation:, policy_id:, score:, version:)
76
- # Result for one policy evaluated against the submitted content.
77
- #
78
- # @param decision [Symbol, SafetyKit::Models::ContentCreateResponse::Policy::Decision] Whether the submitted content violates the policy.
79
- #
80
- # @param escalation [Symbol, SafetyKit::Models::ContentCreateResponse::Policy::Escalation] Escalation outcome for this policy.
81
- #
82
- # @param policy_id [String] Identifier of the policy.
83
- #
84
- # @param score [Float] Policy score between 0 and 1. Higher means more likely violating.
85
- #
86
- # @param version [String] Version of the policy.
87
-
88
- # Whether the submitted content violates the policy.
89
- #
90
- # @see SafetyKit::Models::ContentCreateResponse::Policy#decision
91
- module Decision
92
- extend SafetyKit::Internal::Type::Enum
93
-
94
- MATCH = :match
95
- NOT_MATCH = :not_match
96
- REVIEW = :review
97
-
98
- # @!method self.values
99
- # @return [Array<Symbol>]
40
+ #
41
+ # @param version [String] The API version that served this request.
42
+
43
+ # Result for one label evaluated against the submitted content.
44
+ module Label
45
+ extend SafetyKit::Internal::Type::Union
46
+
47
+ variant -> { SafetyKit::Models::ContentCreateResponse::Label::UnionMember0 }
48
+
49
+ variant -> { SafetyKit::Models::ContentCreateResponse::Label::UnionMember1 }
50
+
51
+ class UnionMember0 < SafetyKit::Internal::Type::BaseModel
52
+ # @!attribute decision
53
+ # Whether the submitted content matches the label.
54
+ #
55
+ # @return [Symbol, SafetyKit::Models::ContentCreateResponse::Label::UnionMember0::Decision]
56
+ required :decision, enum: -> { SafetyKit::Models::ContentCreateResponse::Label::UnionMember0::Decision }
57
+
58
+ # @!attribute escalation
59
+ # Escalation outcome for this label.
60
+ #
61
+ # @return [Symbol, SafetyKit::Models::ContentCreateResponse::Label::UnionMember0::Escalation]
62
+ required :escalation,
63
+ enum: -> { SafetyKit::Models::ContentCreateResponse::Label::UnionMember0::Escalation }
64
+
65
+ # @!attribute label
66
+ # Label identifier.
67
+ #
68
+ # @return [String]
69
+ required :label, String
70
+
71
+ # @!attribute score
72
+ # Classifier score between 0 and 1. Higher means more likely matching. Null when
73
+ # no classifier scored the label.
74
+ #
75
+ # @return [Float, nil]
76
+ required :score, Float, nil?: true
77
+
78
+ # @!attribute type
79
+ #
80
+ # @return [Symbol, SafetyKit::Models::ContentCreateResponse::Label::UnionMember0::Type]
81
+ required :type, enum: -> { SafetyKit::Models::ContentCreateResponse::Label::UnionMember0::Type }
82
+
83
+ # @!method initialize(decision:, escalation:, label:, score:, type:)
84
+ # Some parameter documentations has been truncated, see
85
+ # {SafetyKit::Models::ContentCreateResponse::Label::UnionMember0} for more
86
+ # details.
87
+ #
88
+ # @param decision [Symbol, SafetyKit::Models::ContentCreateResponse::Label::UnionMember0::Decision] Whether the submitted content matches the label.
89
+ #
90
+ # @param escalation [Symbol, SafetyKit::Models::ContentCreateResponse::Label::UnionMember0::Escalation] Escalation outcome for this label.
91
+ #
92
+ # @param label [String] Label identifier.
93
+ #
94
+ # @param score [Float, nil] Classifier score between 0 and 1. Higher means more likely matching. Null when n
95
+ #
96
+ # @param type [Symbol, SafetyKit::Models::ContentCreateResponse::Label::UnionMember0::Type]
97
+
98
+ # Whether the submitted content matches the label.
99
+ #
100
+ # @see SafetyKit::Models::ContentCreateResponse::Label::UnionMember0#decision
101
+ module Decision
102
+ extend SafetyKit::Internal::Type::Enum
103
+
104
+ MATCH = :match
105
+ NOT_MATCH = :not_match
106
+ REVIEW = :review
107
+
108
+ # @!method self.values
109
+ # @return [Array<Symbol>]
110
+ end
111
+
112
+ # Escalation outcome for this label.
113
+ #
114
+ # @see SafetyKit::Models::ContentCreateResponse::Label::UnionMember0#escalation
115
+ module Escalation
116
+ extend SafetyKit::Internal::Type::Enum
117
+
118
+ NONE = :none
119
+ COMPLETED = :completed
120
+ ERROR = :error
121
+
122
+ # @!method self.values
123
+ # @return [Array<Symbol>]
124
+ end
125
+
126
+ # @see SafetyKit::Models::ContentCreateResponse::Label::UnionMember0#type
127
+ module Type
128
+ extend SafetyKit::Internal::Type::Enum
129
+
130
+ CLASSIFIER = :classifier
131
+
132
+ # @!method self.values
133
+ # @return [Array<Symbol>]
134
+ end
100
135
  end
101
136
 
102
- # Escalation outcome for this policy.
103
- #
104
- # @see SafetyKit::Models::ContentCreateResponse::Policy#escalation
105
- module Escalation
106
- extend SafetyKit::Internal::Type::Enum
107
-
108
- NONE = :none
109
- COMPLETED = :completed
110
- ERROR = :error
111
-
112
- # @!method self.values
113
- # @return [Array<Symbol>]
137
+ class UnionMember1 < SafetyKit::Internal::Type::BaseModel
138
+ # @!attribute decision
139
+ # Whether the submitted content matches the label.
140
+ #
141
+ # @return [Symbol, SafetyKit::Models::ContentCreateResponse::Label::UnionMember1::Decision]
142
+ required :decision, enum: -> { SafetyKit::Models::ContentCreateResponse::Label::UnionMember1::Decision }
143
+
144
+ # @!attribute escalation
145
+ # Escalation outcome for this label.
146
+ #
147
+ # @return [Symbol, SafetyKit::Models::ContentCreateResponse::Label::UnionMember1::Escalation]
148
+ required :escalation,
149
+ enum: -> { SafetyKit::Models::ContentCreateResponse::Label::UnionMember1::Escalation }
150
+
151
+ # @!attribute label
152
+ #
153
+ # @return [Symbol, SafetyKit::Models::ContentCreateResponse::Label::UnionMember1::Label]
154
+ required :label, enum: -> { SafetyKit::Models::ContentCreateResponse::Label::UnionMember1::Label }
155
+
156
+ # @!attribute score
157
+ # Similarity between the submitted content and the matched entry.
158
+ #
159
+ # @return [Float]
160
+ required :score, Float
161
+
162
+ # @!attribute set_id
163
+ # Identifier of the matched reference set.
164
+ #
165
+ # @return [String]
166
+ required :set_id, String
167
+
168
+ # @!attribute type
169
+ #
170
+ # @return [Symbol, SafetyKit::Models::ContentCreateResponse::Label::UnionMember1::Type]
171
+ required :type, enum: -> { SafetyKit::Models::ContentCreateResponse::Label::UnionMember1::Type }
172
+
173
+ # @!method initialize(decision:, escalation:, label:, score:, set_id:, type:)
174
+ # @param decision [Symbol, SafetyKit::Models::ContentCreateResponse::Label::UnionMember1::Decision] Whether the submitted content matches the label.
175
+ #
176
+ # @param escalation [Symbol, SafetyKit::Models::ContentCreateResponse::Label::UnionMember1::Escalation] Escalation outcome for this label.
177
+ #
178
+ # @param label [Symbol, SafetyKit::Models::ContentCreateResponse::Label::UnionMember1::Label]
179
+ #
180
+ # @param score [Float] Similarity between the submitted content and the matched entry.
181
+ #
182
+ # @param set_id [String] Identifier of the matched reference set.
183
+ #
184
+ # @param type [Symbol, SafetyKit::Models::ContentCreateResponse::Label::UnionMember1::Type]
185
+
186
+ # Whether the submitted content matches the label.
187
+ #
188
+ # @see SafetyKit::Models::ContentCreateResponse::Label::UnionMember1#decision
189
+ module Decision
190
+ extend SafetyKit::Internal::Type::Enum
191
+
192
+ MATCH = :match
193
+ NOT_MATCH = :not_match
194
+ REVIEW = :review
195
+
196
+ # @!method self.values
197
+ # @return [Array<Symbol>]
198
+ end
199
+
200
+ # Escalation outcome for this label.
201
+ #
202
+ # @see SafetyKit::Models::ContentCreateResponse::Label::UnionMember1#escalation
203
+ module Escalation
204
+ extend SafetyKit::Internal::Type::Enum
205
+
206
+ NONE = :none
207
+ COMPLETED = :completed
208
+ ERROR = :error
209
+
210
+ # @!method self.values
211
+ # @return [Array<Symbol>]
212
+ end
213
+
214
+ # @see SafetyKit::Models::ContentCreateResponse::Label::UnionMember1#label
215
+ module Label
216
+ extend SafetyKit::Internal::Type::Enum
217
+
218
+ REFERENCE_SET_MATCH = :reference_set_match
219
+
220
+ # @!method self.values
221
+ # @return [Array<Symbol>]
222
+ end
223
+
224
+ # @see SafetyKit::Models::ContentCreateResponse::Label::UnionMember1#type
225
+ module Type
226
+ extend SafetyKit::Internal::Type::Enum
227
+
228
+ SIMILARITY = :similarity
229
+
230
+ # @!method self.values
231
+ # @return [Array<Symbol>]
232
+ end
114
233
  end
115
- end
116
234
 
117
- class ReferenceSetMatch < SafetyKit::Internal::Type::BaseModel
118
- # @!attribute set_id
119
- # Identifier of the matched reference set.
120
- #
121
- # @return [String]
122
- required :set_id, String
123
-
124
- # @!attribute similarity
125
- # Similarity between the submitted content and the matched reference set entry.
126
- #
127
- # @return [Float]
128
- required :similarity, Float
129
-
130
- # @!method initialize(set_id:, similarity:)
131
- # Reference set match found for the submitted content.
132
- #
133
- # @param set_id [String] Identifier of the matched reference set.
134
- #
135
- # @param similarity [Float] Similarity between the submitted content and the matched reference set entry.
235
+ # @!method self.variants
236
+ # @return [Array(SafetyKit::Models::ContentCreateResponse::Label::UnionMember0, SafetyKit::Models::ContentCreateResponse::Label::UnionMember1)]
136
237
  end
137
238
  end
138
239
  end
@@ -8,26 +8,26 @@ module SafetyKit
8
8
  # Some parameter documentations has been truncated, see
9
9
  # {SafetyKit::Models::ContentCreateParams} for more details.
10
10
  #
11
- # Classify a piece of content synchronously. Send user-authored text, images, or
12
- # both, and receive per-policy results in the response. Requests have a maximum
13
- # size of 6MB.
11
+ # Classify a piece of content synchronously. Send text and image parts and receive
12
+ # per-label results in the response. Requests have a maximum size of 6MB. API
13
+ # version 2026-08-11; see the API versioning guide for superseded versions.
14
14
  #
15
15
  # Errors: 400 for an invalid body or images, with the failing field in the
16
16
  # message. 401 for a missing or invalid API key. 413 for requests over 6MB. 503
17
17
  # when classification is temporarily unavailable, in which case the request was
18
18
  # not processed and is safe to retry.
19
19
  #
20
- # @overload create(user_id:, content_id: nil, images: nil, metadata: nil, text: nil, request_options: {})
20
+ # @overload create(content:, user_id:, content_id: nil, metadata: nil, safety_kit_version: nil, request_options: {})
21
21
  #
22
- # @param user_id [String] Your stable identifier for the user this content belongs to.
22
+ # @param content [Array<SafetyKit::Models::ContentCreateParams::Content::UnionMember0, SafetyKit::Models::ContentCreateParams::Content::UnionMember1>] Body param: Content parts to classify together. At most 20 images.
23
23
  #
24
- # @param content_id [String] Your content identifier.
24
+ # @param user_id [String] Body param: Your stable identifier for the user this content belongs to.
25
25
  #
26
- # @param images [Array<String>] Images to classify, each as base64-encoded image bytes, raw or as a data URI. At
26
+ # @param content_id [String] Body param: Your content identifier.
27
27
  #
28
- # @param metadata [Hash{Symbol=>Object, nil}] Additional product context for this content. At most 8KB when serialized.
28
+ # @param metadata [Hash{Symbol=>Object, nil}] Body param: Additional product context for this content. At most 8KB when serial
29
29
  #
30
- # @param text [String] User-authored text to classify.
30
+ # @param safety_kit_version [Symbol, SafetyKit::Models::ContentCreateParams::SafetyKitVersion] Header param: The API version this operation is defined against.
31
31
  #
32
32
  # @param request_options [SafetyKit::RequestOptions, Hash{Symbol=>Object}, nil]
33
33
  #
@@ -36,10 +36,12 @@ module SafetyKit
36
36
  # @see SafetyKit::Models::ContentCreateParams
37
37
  def create(params)
38
38
  parsed, options = SafetyKit::ContentCreateParams.dump_request(params)
39
+ header_params = {safety_kit_version: "safetykit-version"}
39
40
  @client.request(
40
41
  method: :post,
41
42
  path: "v1/content",
42
- body: parsed,
43
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
44
+ body: parsed.except(*header_params.keys),
43
45
  model: SafetyKit::Models::ContentCreateResponse,
44
46
  options: options
45
47
  )
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SafetyKit
4
- VERSION = "0.56.0"
4
+ VERSION = "0.58.0"
5
5
  end