safetykit 0.64.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: 6008e0325c4a55331b32202f0042aa80776a3fa3f03590ccc23a79b4f7c223c6
4
- data.tar.gz: e09c4d9df7fb7efc00717e0bacac8c893267f1cb1fad96e09075475126dd07b3
3
+ metadata.gz: 4419274330cc28b0016b03bdbd108b50df08d7ca7dbfe3cfafe2eecd770b5624
4
+ data.tar.gz: 5715f236459e72f6ff6a596e5fb6d0a19345d137e1797c08eb87c19199d26bcf
5
5
  SHA512:
6
- metadata.gz: 51a30dc4f05ce0d79dcb586524f05805ed24c2f17a70537b48927126b4efa5f91baad779a9e4f141a0dd4b4047b2f215fcd3b6ec37d45ff165e6bb4fd166fd99
7
- data.tar.gz: fb0a690a1c12e3dae1fa06a5a2325d1684b918180f25848113c85a3dda558f1da0797875c1d82ebb6a45fa583d761af35d8f0f6182ec8083fd9f6e69eece4344
6
+ metadata.gz: 1577b0749103625fe6c4369f9e84a0c370a44e0249e9f1c91f41c5ff40fe3e55b310c9d581c1bcac173a3fe29eecb25add1fcf72059d1116f83bf183d840cad7
7
+ data.tar.gz: e1b606586eef715e2c0a6b747b6252fea4cd40eed909f2b29e8f482bf6a374b48206e0aebb36a9b024633531b36d0fb9591f262ae397f1baff43a429b806f02f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
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
+
11
+ ## 0.65.0 (2026-08-21)
12
+
13
+ Full Changelog: [v0.64.0...v0.65.0](https://github.com/GetSafetyKit/safetykit-ruby/compare/v0.64.0...v0.65.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** api update ([ed87348](https://github.com/GetSafetyKit/safetykit-ruby/commit/ed87348ea0ce90f0bfe8b29dbfbac8e5a2c7da7c))
18
+
3
19
  ## 0.64.0 (2026-08-20)
4
20
 
5
21
  Full Changelog: [v0.63.0...v0.64.0](https://github.com/GetSafetyKit/safetykit-ruby/compare/v0.63.0...v0.64.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.64.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,11 +41,6 @@ module SafetyKit
32
41
  # @return [Integer]
33
42
  required :timestamp, Integer
34
43
 
35
- # @!attribute frame_id
36
- #
37
- # @return [String, nil]
38
- optional :frame_id, String
39
-
40
44
  # @!attribute metadata
41
45
  # Arbitrary key-value metadata to associate with this frame, at most 8192 bytes
42
46
  # when serialized. If a violation is detected on this frame, the metadata is
@@ -45,20 +49,20 @@ module SafetyKit
45
49
  # @return [Hash{Symbol=>Object, nil}, nil]
46
50
  optional :metadata, SafetyKit::Internal::Type::HashOf[SafetyKit::Internal::Type::Unknown, nil?: true]
47
51
 
48
- # @!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: {})
49
53
  # Some parameter documentations has been truncated, see
50
54
  # {SafetyKit::Models::StreamAddFrameParams} for more details.
51
55
  #
52
56
  # @param namespace [String] The namespace to ingest stream data into
53
57
  #
58
+ # @param frame_id [String] Your unique identifier for this frame. It is the idempotency key for the request
59
+ #
54
60
  # @param image_data_uri [String] A data URI containing a base64-encoded frame image. Only image/jpeg, image/png,
55
61
  #
56
62
  # @param stream_id [String]
57
63
  #
58
64
  # @param timestamp [Integer]
59
65
  #
60
- # @param frame_id [String]
61
- #
62
66
  # @param metadata [Hash{Symbol=>Object, nil}] Arbitrary key-value metadata to associate with this frame, at most 8192 bytes wh
63
67
  #
64
68
  # @param request_options [SafetyKit::RequestOptions, Hash{Symbol=>Object}]
@@ -29,11 +29,18 @@ module SafetyKit
29
29
  required :timestamp, Integer
30
30
 
31
31
  # @!attribute transcript_id
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.
32
36
  #
33
- # @return [String, nil]
34
- optional :transcript_id, String
37
+ # @return [String]
38
+ required :transcript_id, String
35
39
 
36
- # @!method initialize(namespace:, stream_id:, text:, timestamp:, transcript_id: nil, request_options: {})
40
+ # @!method initialize(namespace:, stream_id:, text:, timestamp:, transcript_id:, request_options: {})
41
+ # Some parameter documentations has been truncated, see
42
+ # {SafetyKit::Models::StreamAddTranscriptParams} for more details.
43
+ #
37
44
  # @param namespace [String] The namespace to ingest stream data into
38
45
  #
39
46
  # @param stream_id [String]
@@ -42,7 +49,7 @@ module SafetyKit
42
49
  #
43
50
  # @param timestamp [Integer]
44
51
  #
45
- # @param transcript_id [String]
52
+ # @param transcript_id [String] Your unique identifier for this transcript segment. It is the idempotency key fo
46
53
  #
47
54
  # @param request_options [SafetyKit::RequestOptions, Hash{Symbol=>Object}]
48
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]
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]
@@ -86,6 +86,9 @@ module SafetyKit
86
86
  )
87
87
  end
88
88
 
89
+ # Some parameter documentations has been truncated, see
90
+ # {SafetyKit::Models::StreamAddTranscriptParams} for more details.
91
+ #
89
92
  # Ingest a single transcript segment for a livestream using a relative timestamp
90
93
  # in milliseconds. The stream does not need to be created beforehand. Transcript
91
94
  # timestamps are relative milliseconds from stream start and should be
@@ -96,11 +99,11 @@ module SafetyKit
96
99
  # Errors: 400 for an invalid body, with the reason in the message. 401 for a
97
100
  # missing Authorization header. 403 for an invalid API key. 429 when the rate
98
101
  # 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
+ # 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.
102
105
  #
103
- # @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: {})
104
107
  #
105
108
  # @param namespace [String] The namespace to ingest stream data into
106
109
  #
@@ -110,7 +113,7 @@ module SafetyKit
110
113
  #
111
114
  # @param timestamp [Integer]
112
115
  #
113
- # @param transcript_id [String]
116
+ # @param transcript_id [String] Your unique identifier for this transcript segment. It is the idempotency key fo
114
117
  #
115
118
  # @param request_options [SafetyKit::RequestOptions, Hash{Symbol=>Object}, nil]
116
119
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SafetyKit
4
- VERSION = "0.64.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,12 +35,6 @@ module SafetyKit
28
35
  sig { returns(Integer) }
29
36
  attr_accessor :timestamp
30
37
 
31
- sig { returns(T.nilable(String)) }
32
- attr_reader :frame_id
33
-
34
- sig { params(frame_id: String).void }
35
- attr_writer :frame_id
36
-
37
38
  # Arbitrary key-value metadata to associate with this frame, at most 8192 bytes
38
39
  # when serialized. If a violation is detected on this frame, the metadata is
39
40
  # echoed back verbatim in the live_video.violation_detected webhook.
@@ -46,10 +47,10 @@ module SafetyKit
46
47
  sig do
47
48
  params(
48
49
  namespace: String,
50
+ frame_id: String,
49
51
  image_data_uri: String,
50
52
  stream_id: String,
51
53
  timestamp: Integer,
52
- frame_id: String,
53
54
  metadata: T::Hash[Symbol, T.nilable(T.anything)],
54
55
  request_options: SafetyKit::RequestOptions::OrHash
55
56
  ).returns(T.attached_class)
@@ -57,6 +58,11 @@ module SafetyKit
57
58
  def self.new(
58
59
  # The namespace to ingest stream data into
59
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:,
60
66
  # A data URI containing a base64-encoded frame image. Only image/jpeg, image/png,
61
67
  # and image/webp are accepted. The decoded bytes must match the declared mime
62
68
  # type, decode as a valid image, stay within 5 MB, and stay within 4096x4096 /
@@ -64,7 +70,6 @@ module SafetyKit
64
70
  image_data_uri:,
65
71
  stream_id:,
66
72
  timestamp:,
67
- frame_id: nil,
68
73
  # Arbitrary key-value metadata to associate with this frame, at most 8192 bytes
69
74
  # when serialized. If a violation is detected on this frame, the metadata is
70
75
  # echoed back verbatim in the live_video.violation_detected webhook.
@@ -77,10 +82,10 @@ module SafetyKit
77
82
  override.returns(
78
83
  {
79
84
  namespace: String,
85
+ frame_id: String,
80
86
  image_data_uri: String,
81
87
  stream_id: String,
82
88
  timestamp: Integer,
83
- frame_id: String,
84
89
  metadata: T::Hash[Symbol, T.nilable(T.anything)],
85
90
  request_options: SafetyKit::RequestOptions
86
91
  }
@@ -27,11 +27,12 @@ module SafetyKit
27
27
  sig { returns(Integer) }
28
28
  attr_accessor :timestamp
29
29
 
30
- sig { returns(T.nilable(String)) }
31
- attr_reader :transcript_id
32
-
33
- sig { params(transcript_id: String).void }
34
- 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
35
36
 
36
37
  sig do
37
38
  params(
@@ -49,7 +50,11 @@ module SafetyKit
49
50
  stream_id:,
50
51
  text:,
51
52
  timestamp:,
52
- 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:,
53
58
  request_options: {}
54
59
  )
55
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,7 +70,6 @@ module SafetyKit
65
70
  image_data_uri:,
66
71
  stream_id:,
67
72
  timestamp:,
68
- frame_id: nil,
69
73
  # Arbitrary key-value metadata to associate with this frame, at most 8192 bytes
70
74
  # when serialized. If a violation is detected on this frame, the metadata is
71
75
  # echoed back verbatim in the live_video.violation_detected webhook.
@@ -84,9 +88,9 @@ module SafetyKit
84
88
  # Errors: 400 for an invalid body, with the reason in the message. 401 for a
85
89
  # missing Authorization header. 403 for an invalid API key. 429 when the rate
86
90
  # 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.
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.
90
94
  sig do
91
95
  params(
92
96
  namespace: String,
@@ -103,7 +107,11 @@ module SafetyKit
103
107
  stream_id:,
104
108
  text:,
105
109
  timestamp:,
106
- 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:,
107
115
  request_options: {}
108
116
  )
109
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.64.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-20 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