safetykit 0.65.0 → 0.66.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: 7a3a1b894c949b710e2b5e61a2915834fa2b9873bb5cb535601adf799249c47d
4
- data.tar.gz: 9b7272b34376f16f382ef73f49a805bdd436127e22d185d417a97617dc62f341
3
+ metadata.gz: 4419274330cc28b0016b03bdbd108b50df08d7ca7dbfe3cfafe2eecd770b5624
4
+ data.tar.gz: 5715f236459e72f6ff6a596e5fb6d0a19345d137e1797c08eb87c19199d26bcf
5
5
  SHA512:
6
- metadata.gz: 5a5b3f912481787155ada90dc1d0c9cae11ac2067f2966b1464cdd7e0354f7b4d40480e6f2497a0acc7615580d741001e8cef3ed28c66af24280f0ba326580ea
7
- data.tar.gz: a02a32981ebb483000fc384190ba833a530482c68c0baa50986b6eed5de658c17af0b4a9e3525335ca3cbdc9a011f06ba62664bf2756dc9ddd5448452210be1b
6
+ metadata.gz: 1577b0749103625fe6c4369f9e84a0c370a44e0249e9f1c91f41c5ff40fe3e55b310c9d581c1bcac173a3fe29eecb25add1fcf72059d1116f83bf183d840cad7
7
+ data.tar.gz: e1b606586eef715e2c0a6b747b6252fea4cd40eed909f2b29e8f482bf6a374b48206e0aebb36a9b024633531b36d0fb9591f262ae397f1baff43a429b806f02f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.66.0 (2026-09-02)
4
+
5
+ Full Changelog: [v0.65.0...v0.66.0](https://github.com/GetSafetyKit/safetykit-ruby/compare/v0.65.0...v0.66.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([a5d4962](https://github.com/GetSafetyKit/safetykit-ruby/commit/a5d4962ae42054562a00d63d24248be9ee86755c))
10
+
3
11
  ## 0.65.0 (2026-08-21)
4
12
 
5
13
  Full Changelog: [v0.64.0...v0.65.0](https://github.com/GetSafetyKit/safetykit-ruby/compare/v0.64.0...v0.65.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.65.0"
20
+ gem "safetykit", "~> 0.66.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -13,6 +13,15 @@ module SafetyKit
13
13
  # @return [String]
14
14
  required :namespace, String
15
15
 
16
+ # @!attribute frame_id
17
+ # Your unique identifier for this frame. It is the idempotency key for the
18
+ # request, and if a violation is detected it is echoed back in the
19
+ # live_video.violation_detected webhook's frame_id and per-policy frame_ids
20
+ # fields.
21
+ #
22
+ # @return [String]
23
+ required :frame_id, String
24
+
16
25
  # @!attribute image_data_uri
17
26
  # A data URI containing a base64-encoded frame image. Only image/jpeg, image/png,
18
27
  # and image/webp are accepted. The decoded bytes must match the declared mime
@@ -32,14 +41,6 @@ module SafetyKit
32
41
  # @return [Integer]
33
42
  required :timestamp, Integer
34
43
 
35
- # @!attribute frame_id
36
- # Your identifier for this frame. If a violation is detected, it is echoed back in
37
- # the live_video.violation_detected webhook's frame_id and per-policy frame_ids
38
- # fields.
39
- #
40
- # @return [String, nil]
41
- optional :frame_id, String
42
-
43
44
  # @!attribute metadata
44
45
  # Arbitrary key-value metadata to associate with this frame, at most 8192 bytes
45
46
  # when serialized. If a violation is detected on this frame, the metadata is
@@ -48,20 +49,20 @@ module SafetyKit
48
49
  # @return [Hash{Symbol=>Object, nil}, nil]
49
50
  optional :metadata, SafetyKit::Internal::Type::HashOf[SafetyKit::Internal::Type::Unknown, nil?: true]
50
51
 
51
- # @!method initialize(namespace:, image_data_uri:, stream_id:, timestamp:, frame_id: nil, metadata: nil, request_options: {})
52
+ # @!method initialize(namespace:, frame_id:, image_data_uri:, stream_id:, timestamp:, metadata: nil, request_options: {})
52
53
  # Some parameter documentations has been truncated, see
53
54
  # {SafetyKit::Models::StreamAddFrameParams} for more details.
54
55
  #
55
56
  # @param namespace [String] The namespace to ingest stream data into
56
57
  #
58
+ # @param frame_id [String] Your unique identifier for this frame. It is the idempotency key for the request
59
+ #
57
60
  # @param image_data_uri [String] A data URI containing a base64-encoded frame image. Only image/jpeg, image/png,
58
61
  #
59
62
  # @param stream_id [String]
60
63
  #
61
64
  # @param timestamp [Integer]
62
65
  #
63
- # @param frame_id [String] Your identifier for this frame. If a violation is detected, it is echoed back in
64
- #
65
66
  # @param metadata [Hash{Symbol=>Object, nil}] Arbitrary key-value metadata to associate with this frame, at most 8192 bytes wh
66
67
  #
67
68
  # @param request_options [SafetyKit::RequestOptions, Hash{Symbol=>Object}]
@@ -29,14 +29,15 @@ module SafetyKit
29
29
  required :timestamp, Integer
30
30
 
31
31
  # @!attribute transcript_id
32
- # Your identifier for this transcript segment. If the segment is reviewed
33
- # alongside a detected violation, it is echoed back in the
34
- # live_video.violation_detected webhook's per-policy transcript_ids field.
32
+ # Your unique identifier for this transcript segment. It is the idempotency key
33
+ # for the request, and if the segment is reviewed alongside a detected violation
34
+ # it is echoed back in the live_video.violation_detected webhook's per-policy
35
+ # transcript_ids field.
35
36
  #
36
- # @return [String, nil]
37
- optional :transcript_id, String
37
+ # @return [String]
38
+ required :transcript_id, String
38
39
 
39
- # @!method initialize(namespace:, stream_id:, text:, timestamp:, transcript_id: nil, request_options: {})
40
+ # @!method initialize(namespace:, stream_id:, text:, timestamp:, transcript_id:, request_options: {})
40
41
  # Some parameter documentations has been truncated, see
41
42
  # {SafetyKit::Models::StreamAddTranscriptParams} for more details.
42
43
  #
@@ -48,7 +49,7 @@ module SafetyKit
48
49
  #
49
50
  # @param timestamp [Integer]
50
51
  #
51
- # @param transcript_id [String] Your identifier for this transcript segment. If the segment is reviewed alongsid
52
+ # @param transcript_id [String] Your unique identifier for this transcript segment. It is the idempotency key fo
52
53
  #
53
54
  # @param request_options [SafetyKit::RequestOptions, Hash{Symbol=>Object}]
54
55
  end
@@ -53,21 +53,21 @@ module SafetyKit
53
53
  # reason in the message. 401 for a missing Authorization header. 403 for an
54
54
  # invalid API key. 429 when the rate limit is exceeded. 5xx for transient internal
55
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.
56
+ # idempotent on frame_id, so a retried request that already succeeded is ignored.
57
+ # Do not retry other 4xx errors, they indicate a problem with the request.
58
58
  #
59
- # @overload add_frame(namespace, image_data_uri:, stream_id:, timestamp:, frame_id: nil, metadata: nil, request_options: {})
59
+ # @overload add_frame(namespace, frame_id:, image_data_uri:, stream_id:, timestamp:, metadata: nil, request_options: {})
60
60
  #
61
61
  # @param namespace [String] The namespace to ingest stream data into
62
62
  #
63
+ # @param frame_id [String] Your unique identifier for this frame. It is the idempotency key for the request
64
+ #
63
65
  # @param image_data_uri [String] A data URI containing a base64-encoded frame image. Only image/jpeg, image/png,
64
66
  #
65
67
  # @param stream_id [String]
66
68
  #
67
69
  # @param timestamp [Integer]
68
70
  #
69
- # @param frame_id [String] Your identifier for this frame. If a violation is detected, it is echoed back in
70
- #
71
71
  # @param metadata [Hash{Symbol=>Object, nil}] Arbitrary key-value metadata to associate with this frame, at most 8192 bytes wh
72
72
  #
73
73
  # @param request_options [SafetyKit::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -99,11 +99,11 @@ module SafetyKit
99
99
  # Errors: 400 for an invalid body, with the reason in the message. 401 for a
100
100
  # missing Authorization header. 403 for an invalid API key. 429 when the rate
101
101
  # limit is exceeded. 5xx for transient internal failures. Retry 429 and 5xx with
102
- # exponential backoff. Transcript ingestion is idempotent, so a retried request
103
- # that already succeeded is ignored. Do not retry other 4xx errors, they indicate
104
- # a problem with the request.
102
+ # exponential backoff. Transcript ingestion is idempotent on transcript_id, so a
103
+ # retried request that already succeeded is ignored. Do not retry other 4xx
104
+ # errors, they indicate a problem with the request.
105
105
  #
106
- # @overload add_transcript(namespace, stream_id:, text:, timestamp:, transcript_id: nil, request_options: {})
106
+ # @overload add_transcript(namespace, stream_id:, text:, timestamp:, transcript_id:, request_options: {})
107
107
  #
108
108
  # @param namespace [String] The namespace to ingest stream data into
109
109
  #
@@ -113,7 +113,7 @@ module SafetyKit
113
113
  #
114
114
  # @param timestamp [Integer]
115
115
  #
116
- # @param transcript_id [String] Your identifier for this transcript segment. If the segment is reviewed alongsid
116
+ # @param transcript_id [String] Your unique identifier for this transcript segment. It is the idempotency key fo
117
117
  #
118
118
  # @param request_options [SafetyKit::RequestOptions, Hash{Symbol=>Object}, nil]
119
119
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SafetyKit
4
- VERSION = "0.65.0"
4
+ VERSION = "0.66.0"
5
5
  end
@@ -15,6 +15,13 @@ module SafetyKit
15
15
  sig { returns(String) }
16
16
  attr_accessor :namespace
17
17
 
18
+ # Your unique identifier for this frame. It is the idempotency key for the
19
+ # request, and if a violation is detected it is echoed back in the
20
+ # live_video.violation_detected webhook's frame_id and per-policy frame_ids
21
+ # fields.
22
+ sig { returns(String) }
23
+ attr_accessor :frame_id
24
+
18
25
  # A data URI containing a base64-encoded frame image. Only image/jpeg, image/png,
19
26
  # and image/webp are accepted. The decoded bytes must match the declared mime
20
27
  # type, decode as a valid image, stay within 5 MB, and stay within 4096x4096 /
@@ -28,15 +35,6 @@ module SafetyKit
28
35
  sig { returns(Integer) }
29
36
  attr_accessor :timestamp
30
37
 
31
- # Your identifier for this frame. If a violation is detected, it is echoed back in
32
- # the live_video.violation_detected webhook's frame_id and per-policy frame_ids
33
- # fields.
34
- sig { returns(T.nilable(String)) }
35
- attr_reader :frame_id
36
-
37
- sig { params(frame_id: String).void }
38
- attr_writer :frame_id
39
-
40
38
  # Arbitrary key-value metadata to associate with this frame, at most 8192 bytes
41
39
  # when serialized. If a violation is detected on this frame, the metadata is
42
40
  # echoed back verbatim in the live_video.violation_detected webhook.
@@ -49,10 +47,10 @@ module SafetyKit
49
47
  sig do
50
48
  params(
51
49
  namespace: String,
50
+ frame_id: String,
52
51
  image_data_uri: String,
53
52
  stream_id: String,
54
53
  timestamp: Integer,
55
- frame_id: String,
56
54
  metadata: T::Hash[Symbol, T.nilable(T.anything)],
57
55
  request_options: SafetyKit::RequestOptions::OrHash
58
56
  ).returns(T.attached_class)
@@ -60,6 +58,11 @@ module SafetyKit
60
58
  def self.new(
61
59
  # The namespace to ingest stream data into
62
60
  namespace:,
61
+ # Your unique identifier for this frame. It is the idempotency key for the
62
+ # request, and if a violation is detected it is echoed back in the
63
+ # live_video.violation_detected webhook's frame_id and per-policy frame_ids
64
+ # fields.
65
+ frame_id:,
63
66
  # A data URI containing a base64-encoded frame image. Only image/jpeg, image/png,
64
67
  # and image/webp are accepted. The decoded bytes must match the declared mime
65
68
  # type, decode as a valid image, stay within 5 MB, and stay within 4096x4096 /
@@ -67,10 +70,6 @@ module SafetyKit
67
70
  image_data_uri:,
68
71
  stream_id:,
69
72
  timestamp:,
70
- # Your identifier for this frame. If a violation is detected, it is echoed back in
71
- # the live_video.violation_detected webhook's frame_id and per-policy frame_ids
72
- # fields.
73
- frame_id: nil,
74
73
  # Arbitrary key-value metadata to associate with this frame, at most 8192 bytes
75
74
  # when serialized. If a violation is detected on this frame, the metadata is
76
75
  # echoed back verbatim in the live_video.violation_detected webhook.
@@ -83,10 +82,10 @@ module SafetyKit
83
82
  override.returns(
84
83
  {
85
84
  namespace: String,
85
+ frame_id: String,
86
86
  image_data_uri: String,
87
87
  stream_id: String,
88
88
  timestamp: Integer,
89
- frame_id: String,
90
89
  metadata: T::Hash[Symbol, T.nilable(T.anything)],
91
90
  request_options: SafetyKit::RequestOptions
92
91
  }
@@ -27,14 +27,12 @@ module SafetyKit
27
27
  sig { returns(Integer) }
28
28
  attr_accessor :timestamp
29
29
 
30
- # Your identifier for this transcript segment. If the segment is reviewed
31
- # alongside a detected violation, it is echoed back in the
32
- # live_video.violation_detected webhook's per-policy transcript_ids field.
33
- sig { returns(T.nilable(String)) }
34
- attr_reader :transcript_id
35
-
36
- sig { params(transcript_id: String).void }
37
- attr_writer :transcript_id
30
+ # Your unique identifier for this transcript segment. It is the idempotency key
31
+ # for the request, and if the segment is reviewed alongside a detected violation
32
+ # it is echoed back in the live_video.violation_detected webhook's per-policy
33
+ # transcript_ids field.
34
+ sig { returns(String) }
35
+ attr_accessor :transcript_id
38
36
 
39
37
  sig do
40
38
  params(
@@ -52,10 +50,11 @@ module SafetyKit
52
50
  stream_id:,
53
51
  text:,
54
52
  timestamp:,
55
- # Your identifier for this transcript segment. If the segment is reviewed
56
- # alongside a detected violation, it is echoed back in the
57
- # live_video.violation_detected webhook's per-policy transcript_ids field.
58
- transcript_id: nil,
53
+ # Your unique identifier for this transcript segment. It is the idempotency key
54
+ # for the request, and if the segment is reviewed alongside a detected violation
55
+ # it is echoed back in the live_video.violation_detected webhook's per-policy
56
+ # transcript_ids field.
57
+ transcript_id:,
59
58
  request_options: {}
60
59
  )
61
60
  end
@@ -42,15 +42,15 @@ module SafetyKit
42
42
  # reason in the message. 401 for a missing Authorization header. 403 for an
43
43
  # invalid API key. 429 when the rate limit is exceeded. 5xx for transient internal
44
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.
45
+ # idempotent on frame_id, so a retried request that already succeeded is ignored.
46
+ # Do not retry other 4xx errors, they indicate a problem with the request.
47
47
  sig do
48
48
  params(
49
49
  namespace: String,
50
+ frame_id: String,
50
51
  image_data_uri: String,
51
52
  stream_id: String,
52
53
  timestamp: Integer,
53
- frame_id: String,
54
54
  metadata: T::Hash[Symbol, T.nilable(T.anything)],
55
55
  request_options: SafetyKit::RequestOptions::OrHash
56
56
  ).returns(SafetyKit::Models::StreamAddFrameResponse)
@@ -58,6 +58,11 @@ module SafetyKit
58
58
  def add_frame(
59
59
  # The namespace to ingest stream data into
60
60
  namespace,
61
+ # Your unique identifier for this frame. It is the idempotency key for the
62
+ # request, and if a violation is detected it is echoed back in the
63
+ # live_video.violation_detected webhook's frame_id and per-policy frame_ids
64
+ # fields.
65
+ frame_id:,
61
66
  # A data URI containing a base64-encoded frame image. Only image/jpeg, image/png,
62
67
  # and image/webp are accepted. The decoded bytes must match the declared mime
63
68
  # type, decode as a valid image, stay within 5 MB, and stay within 4096x4096 /
@@ -65,10 +70,6 @@ module SafetyKit
65
70
  image_data_uri:,
66
71
  stream_id:,
67
72
  timestamp:,
68
- # Your identifier for this frame. If a violation is detected, it is echoed back in
69
- # the live_video.violation_detected webhook's frame_id and per-policy frame_ids
70
- # fields.
71
- frame_id: nil,
72
73
  # Arbitrary key-value metadata to associate with this frame, at most 8192 bytes
73
74
  # when serialized. If a violation is detected on this frame, the metadata is
74
75
  # echoed back verbatim in the live_video.violation_detected webhook.
@@ -87,9 +88,9 @@ module SafetyKit
87
88
  # Errors: 400 for an invalid body, with the reason in the message. 401 for a
88
89
  # missing Authorization header. 403 for an invalid API key. 429 when the rate
89
90
  # limit is exceeded. 5xx for transient internal failures. Retry 429 and 5xx with
90
- # exponential backoff. Transcript ingestion is idempotent, so a retried request
91
- # that already succeeded is ignored. Do not retry other 4xx errors, they indicate
92
- # a problem with the request.
91
+ # exponential backoff. Transcript ingestion is idempotent on transcript_id, so a
92
+ # retried request that already succeeded is ignored. Do not retry other 4xx
93
+ # errors, they indicate a problem with the request.
93
94
  sig do
94
95
  params(
95
96
  namespace: String,
@@ -106,10 +107,11 @@ module SafetyKit
106
107
  stream_id:,
107
108
  text:,
108
109
  timestamp:,
109
- # Your identifier for this transcript segment. If the segment is reviewed
110
- # alongside a detected violation, it is echoed back in the
111
- # live_video.violation_detected webhook's per-policy transcript_ids field.
112
- transcript_id: nil,
110
+ # Your unique identifier for this transcript segment. It is the idempotency key
111
+ # for the request, and if the segment is reviewed alongside a detected violation
112
+ # it is echoed back in the live_video.violation_detected webhook's per-policy
113
+ # transcript_ids field.
114
+ transcript_id:,
113
115
  request_options: {}
114
116
  )
115
117
  end
@@ -3,10 +3,10 @@ module SafetyKit
3
3
  type stream_add_frame_params =
4
4
  {
5
5
  namespace: String,
6
+ frame_id: String,
6
7
  image_data_uri: String,
7
8
  stream_id: String,
8
9
  timestamp: Integer,
9
- frame_id: String,
10
10
  metadata: ::Hash[Symbol, top?]
11
11
  }
12
12
  & SafetyKit::Internal::Type::request_parameters
@@ -17,36 +17,34 @@ module SafetyKit
17
17
 
18
18
  attr_accessor namespace: String
19
19
 
20
+ attr_accessor frame_id: String
21
+
20
22
  attr_accessor image_data_uri: String
21
23
 
22
24
  attr_accessor stream_id: String
23
25
 
24
26
  attr_accessor timestamp: Integer
25
27
 
26
- attr_reader frame_id: String?
27
-
28
- def frame_id=: (String) -> String
29
-
30
28
  attr_reader metadata: ::Hash[Symbol, top?]?
31
29
 
32
30
  def metadata=: (::Hash[Symbol, top?]) -> ::Hash[Symbol, top?]
33
31
 
34
32
  def initialize: (
35
33
  namespace: String,
34
+ frame_id: String,
36
35
  image_data_uri: String,
37
36
  stream_id: String,
38
37
  timestamp: Integer,
39
- ?frame_id: String,
40
38
  ?metadata: ::Hash[Symbol, top?],
41
39
  ?request_options: SafetyKit::request_opts
42
40
  ) -> void
43
41
 
44
42
  def to_hash: -> {
45
43
  namespace: String,
44
+ frame_id: String,
46
45
  image_data_uri: String,
47
46
  stream_id: String,
48
47
  timestamp: Integer,
49
- frame_id: String,
50
48
  metadata: ::Hash[Symbol, top?],
51
49
  request_options: SafetyKit::RequestOptions
52
50
  }
@@ -22,16 +22,14 @@ module SafetyKit
22
22
 
23
23
  attr_accessor timestamp: Integer
24
24
 
25
- attr_reader transcript_id: String?
26
-
27
- def transcript_id=: (String) -> String
25
+ attr_accessor transcript_id: String
28
26
 
29
27
  def initialize: (
30
28
  namespace: String,
31
29
  stream_id: String,
32
30
  text: String,
33
31
  timestamp: Integer,
34
- ?transcript_id: String,
32
+ transcript_id: String,
35
33
  ?request_options: SafetyKit::request_opts
36
34
  ) -> void
37
35
 
@@ -10,10 +10,10 @@ module SafetyKit
10
10
 
11
11
  def add_frame: (
12
12
  String namespace,
13
+ frame_id: String,
13
14
  image_data_uri: String,
14
15
  stream_id: String,
15
16
  timestamp: Integer,
16
- ?frame_id: String,
17
17
  ?metadata: ::Hash[Symbol, top?],
18
18
  ?request_options: SafetyKit::request_opts
19
19
  ) -> SafetyKit::Models::StreamAddFrameResponse
@@ -23,7 +23,7 @@ module SafetyKit
23
23
  stream_id: String,
24
24
  text: String,
25
25
  timestamp: Integer,
26
- ?transcript_id: String,
26
+ transcript_id: String,
27
27
  ?request_options: SafetyKit::request_opts
28
28
  ) -> SafetyKit::Models::StreamAddTranscriptResponse
29
29
 
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.65.0
4
+ version: 0.66.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-21 00:00:00.000000000 Z
11
+ date: 2026-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi