openai 0.73.0 → 0.75.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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/openai/client.rb +4 -0
  5. data/lib/openai/models/beta/beta_response.rb +15 -6
  6. data/lib/openai/models/beta/beta_responses_client_event.rb +15 -6
  7. data/lib/openai/models/beta/response_compact_params.rb +32 -3
  8. data/lib/openai/models/beta/response_create_params.rb +15 -6
  9. data/lib/openai/models/chat/chat_completion.rb +15 -6
  10. data/lib/openai/models/chat/chat_completion_chunk.rb +15 -6
  11. data/lib/openai/models/chat/completion_create_params.rb +15 -6
  12. data/lib/openai/models/content_provenance_check.rb +221 -0
  13. data/lib/openai/models/content_provenance_check_create_params.rb +22 -0
  14. data/lib/openai/models/responses/response.rb +15 -6
  15. data/lib/openai/models/responses/response_compact_params.rb +32 -3
  16. data/lib/openai/models/responses/response_create_params.rb +15 -6
  17. data/lib/openai/models/responses/responses_client_event.rb +15 -6
  18. data/lib/openai/models.rb +4 -0
  19. data/lib/openai/resources/beta/responses.rb +1 -1
  20. data/lib/openai/resources/content_provenance_checks.rb +46 -0
  21. data/lib/openai/resources/responses.rb +1 -1
  22. data/lib/openai/version.rb +1 -1
  23. data/lib/openai.rb +3 -0
  24. data/rbi/openai/client.rbi +3 -0
  25. data/rbi/openai/models/beta/beta_response.rbi +23 -9
  26. data/rbi/openai/models/beta/beta_responses_client_event.rbi +26 -9
  27. data/rbi/openai/models/beta/response_compact_params.rbi +50 -3
  28. data/rbi/openai/models/beta/response_create_params.rbi +26 -9
  29. data/rbi/openai/models/chat/chat_completion.rbi +26 -9
  30. data/rbi/openai/models/chat/chat_completion_chunk.rbi +26 -9
  31. data/rbi/openai/models/chat/completion_create_params.rbi +26 -9
  32. data/rbi/openai/models/content_provenance_check.rbi +413 -0
  33. data/rbi/openai/models/content_provenance_check_create_params.rbi +46 -0
  34. data/rbi/openai/models/responses/response.rbi +23 -9
  35. data/rbi/openai/models/responses/response_compact_params.rbi +50 -3
  36. data/rbi/openai/models/responses/response_create_params.rbi +26 -9
  37. data/rbi/openai/models/responses/responses_client_event.rbi +26 -9
  38. data/rbi/openai/models.rbi +5 -0
  39. data/rbi/openai/resources/beta/responses.rbi +29 -7
  40. data/rbi/openai/resources/chat/completions.rbi +14 -6
  41. data/rbi/openai/resources/content_provenance_checks.rbi +34 -0
  42. data/rbi/openai/resources/responses.rbi +29 -7
  43. data/sig/openai/client.rbs +2 -0
  44. data/sig/openai/models/beta/beta_response.rbs +3 -1
  45. data/sig/openai/models/beta/beta_responses_client_event.rbs +3 -1
  46. data/sig/openai/models/beta/response_compact_params.rbs +2 -1
  47. data/sig/openai/models/beta/response_create_params.rbs +3 -1
  48. data/sig/openai/models/chat/chat_completion.rbs +3 -1
  49. data/sig/openai/models/chat/chat_completion_chunk.rbs +3 -1
  50. data/sig/openai/models/chat/completion_create_params.rbs +3 -1
  51. data/sig/openai/models/content_provenance_check.rbs +159 -0
  52. data/sig/openai/models/content_provenance_check_create_params.rbs +24 -0
  53. data/sig/openai/models/responses/response.rbs +3 -1
  54. data/sig/openai/models/responses/response_compact_params.rbs +2 -1
  55. data/sig/openai/models/responses/response_create_params.rbs +3 -1
  56. data/sig/openai/models/responses/responses_client_event.rbs +3 -1
  57. data/sig/openai/models.rbs +4 -0
  58. data/sig/openai/resources/content_provenance_checks.rbs +12 -0
  59. metadata +11 -2
@@ -52,9 +52,13 @@ module OpenAI
52
52
  # will use 'default'.
53
53
  # - If set to 'default', then the request will be processed with the standard
54
54
  # pricing and performance for the selected model.
55
- # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
56
- # '[priority](https://openai.com/api-priority-processing/)', then the request
57
- # will be processed with the corresponding service tier.
55
+ # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
56
+ # then the request will be processed with the Flex Processing service tier.
57
+ # - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
58
+ # include the `service_tier=fast` or `service_tier=priority` parameter for
59
+ # Responses or Chat Completions. The response will show `service_tier=priority`
60
+ # regardless of if you specify `service_tier=fast` or `priority` in your
61
+ # request.
58
62
  # - When not set, the default behavior is 'auto'.
59
63
  #
60
64
  # When the `service_tier` parameter is set, the response body will include the
@@ -122,9 +126,13 @@ module OpenAI
122
126
  # will use 'default'.
123
127
  # - If set to 'default', then the request will be processed with the standard
124
128
  # pricing and performance for the selected model.
125
- # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
126
- # '[priority](https://openai.com/api-priority-processing/)', then the request
127
- # will be processed with the corresponding service tier.
129
+ # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
130
+ # then the request will be processed with the Flex Processing service tier.
131
+ # - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
132
+ # include the `service_tier=fast` or `service_tier=priority` parameter for
133
+ # Responses or Chat Completions. The response will show `service_tier=priority`
134
+ # regardless of if you specify `service_tier=fast` or `priority` in your
135
+ # request.
128
136
  # - When not set, the default behavior is 'auto'.
129
137
  #
130
138
  # When the `service_tier` parameter is set, the response body will include the
@@ -985,9 +993,13 @@ module OpenAI
985
993
  # will use 'default'.
986
994
  # - If set to 'default', then the request will be processed with the standard
987
995
  # pricing and performance for the selected model.
988
- # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
989
- # '[priority](https://openai.com/api-priority-processing/)', then the request
990
- # will be processed with the corresponding service tier.
996
+ # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
997
+ # then the request will be processed with the Flex Processing service tier.
998
+ # - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
999
+ # include the `service_tier=fast` or `service_tier=priority` parameter for
1000
+ # Responses or Chat Completions. The response will show `service_tier=priority`
1001
+ # regardless of if you specify `service_tier=fast` or `priority` in your
1002
+ # request.
991
1003
  # - When not set, the default behavior is 'auto'.
992
1004
  #
993
1005
  # When the `service_tier` parameter is set, the response body will include the
@@ -1028,6 +1040,11 @@ module OpenAI
1028
1040
  :priority,
1029
1041
  OpenAI::Chat::ChatCompletion::ServiceTier::TaggedSymbol
1030
1042
  )
1043
+ FAST =
1044
+ T.let(
1045
+ :fast,
1046
+ OpenAI::Chat::ChatCompletion::ServiceTier::TaggedSymbol
1047
+ )
1031
1048
 
1032
1049
  sig do
1033
1050
  override.returns(
@@ -56,9 +56,13 @@ module OpenAI
56
56
  # will use 'default'.
57
57
  # - If set to 'default', then the request will be processed with the standard
58
58
  # pricing and performance for the selected model.
59
- # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
60
- # '[priority](https://openai.com/api-priority-processing/)', then the request
61
- # will be processed with the corresponding service tier.
59
+ # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
60
+ # then the request will be processed with the Flex Processing service tier.
61
+ # - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
62
+ # include the `service_tier=fast` or `service_tier=priority` parameter for
63
+ # Responses or Chat Completions. The response will show `service_tier=priority`
64
+ # regardless of if you specify `service_tier=fast` or `priority` in your
65
+ # request.
62
66
  # - When not set, the default behavior is 'auto'.
63
67
  #
64
68
  # When the `service_tier` parameter is set, the response body will include the
@@ -139,9 +143,13 @@ module OpenAI
139
143
  # will use 'default'.
140
144
  # - If set to 'default', then the request will be processed with the standard
141
145
  # pricing and performance for the selected model.
142
- # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
143
- # '[priority](https://openai.com/api-priority-processing/)', then the request
144
- # will be processed with the corresponding service tier.
146
+ # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
147
+ # then the request will be processed with the Flex Processing service tier.
148
+ # - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
149
+ # include the `service_tier=fast` or `service_tier=priority` parameter for
150
+ # Responses or Chat Completions. The response will show `service_tier=priority`
151
+ # regardless of if you specify `service_tier=fast` or `priority` in your
152
+ # request.
145
153
  # - When not set, the default behavior is 'auto'.
146
154
  #
147
155
  # When the `service_tier` parameter is set, the response body will include the
@@ -1409,9 +1417,13 @@ module OpenAI
1409
1417
  # will use 'default'.
1410
1418
  # - If set to 'default', then the request will be processed with the standard
1411
1419
  # pricing and performance for the selected model.
1412
- # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
1413
- # '[priority](https://openai.com/api-priority-processing/)', then the request
1414
- # will be processed with the corresponding service tier.
1420
+ # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
1421
+ # then the request will be processed with the Flex Processing service tier.
1422
+ # - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
1423
+ # include the `service_tier=fast` or `service_tier=priority` parameter for
1424
+ # Responses or Chat Completions. The response will show `service_tier=priority`
1425
+ # regardless of if you specify `service_tier=fast` or `priority` in your
1426
+ # request.
1415
1427
  # - When not set, the default behavior is 'auto'.
1416
1428
  #
1417
1429
  # When the `service_tier` parameter is set, the response body will include the
@@ -1452,6 +1464,11 @@ module OpenAI
1452
1464
  :priority,
1453
1465
  OpenAI::Chat::ChatCompletionChunk::ServiceTier::TaggedSymbol
1454
1466
  )
1467
+ FAST =
1468
+ T.let(
1469
+ :fast,
1470
+ OpenAI::Chat::ChatCompletionChunk::ServiceTier::TaggedSymbol
1471
+ )
1455
1472
 
1456
1473
  sig do
1457
1474
  override.returns(
@@ -358,9 +358,13 @@ module OpenAI
358
358
  # will use 'default'.
359
359
  # - If set to 'default', then the request will be processed with the standard
360
360
  # pricing and performance for the selected model.
361
- # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
362
- # '[priority](https://openai.com/api-priority-processing/)', then the request
363
- # will be processed with the corresponding service tier.
361
+ # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
362
+ # then the request will be processed with the Flex Processing service tier.
363
+ # - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
364
+ # include the `service_tier=fast` or `service_tier=priority` parameter for
365
+ # Responses or Chat Completions. The response will show `service_tier=priority`
366
+ # regardless of if you specify `service_tier=fast` or `priority` in your
367
+ # request.
364
368
  # - When not set, the default behavior is 'auto'.
365
369
  #
366
370
  # When the `service_tier` parameter is set, the response body will include the
@@ -804,9 +808,13 @@ module OpenAI
804
808
  # will use 'default'.
805
809
  # - If set to 'default', then the request will be processed with the standard
806
810
  # pricing and performance for the selected model.
807
- # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
808
- # '[priority](https://openai.com/api-priority-processing/)', then the request
809
- # will be processed with the corresponding service tier.
811
+ # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
812
+ # then the request will be processed with the Flex Processing service tier.
813
+ # - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
814
+ # include the `service_tier=fast` or `service_tier=priority` parameter for
815
+ # Responses or Chat Completions. The response will show `service_tier=priority`
816
+ # regardless of if you specify `service_tier=fast` or `priority` in your
817
+ # request.
810
818
  # - When not set, the default behavior is 'auto'.
811
819
  #
812
820
  # When the `service_tier` parameter is set, the response body will include the
@@ -1734,9 +1742,13 @@ module OpenAI
1734
1742
  # will use 'default'.
1735
1743
  # - If set to 'default', then the request will be processed with the standard
1736
1744
  # pricing and performance for the selected model.
1737
- # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
1738
- # '[priority](https://openai.com/api-priority-processing/)', then the request
1739
- # will be processed with the corresponding service tier.
1745
+ # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
1746
+ # then the request will be processed with the Flex Processing service tier.
1747
+ # - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
1748
+ # include the `service_tier=fast` or `service_tier=priority` parameter for
1749
+ # Responses or Chat Completions. The response will show `service_tier=priority`
1750
+ # regardless of if you specify `service_tier=fast` or `priority` in your
1751
+ # request.
1740
1752
  # - When not set, the default behavior is 'auto'.
1741
1753
  #
1742
1754
  # When the `service_tier` parameter is set, the response body will include the
@@ -1777,6 +1789,11 @@ module OpenAI
1777
1789
  :priority,
1778
1790
  OpenAI::Chat::CompletionCreateParams::ServiceTier::TaggedSymbol
1779
1791
  )
1792
+ FAST =
1793
+ T.let(
1794
+ :fast,
1795
+ OpenAI::Chat::CompletionCreateParams::ServiceTier::TaggedSymbol
1796
+ )
1780
1797
 
1781
1798
  sig do
1782
1799
  override.returns(
@@ -0,0 +1,413 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+ class ContentProvenanceCheck < OpenAI::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(OpenAI::ContentProvenanceCheck, OpenAI::Internal::AnyHash)
9
+ end
10
+
11
+ # The Unix timestamp, in seconds, when the provenance check was created.
12
+ sig { returns(Integer) }
13
+ attr_accessor :created_at
14
+
15
+ # The object type. Always `content_provenance_check` for this endpoint.
16
+ sig { returns(OpenAI::ContentProvenanceCheck::Object::TaggedSymbol) }
17
+ attr_accessor :object
18
+
19
+ # The provenance results that apply to the uploaded file. Image results include
20
+ # C2PA and SynthID; audio results include SynthID.
21
+ sig do
22
+ returns(T::Array[OpenAI::ContentProvenanceCheck::Result::Variants])
23
+ end
24
+ attr_accessor :results
25
+
26
+ sig do
27
+ params(
28
+ created_at: Integer,
29
+ object: OpenAI::ContentProvenanceCheck::Object::OrSymbol,
30
+ results:
31
+ T::Array[
32
+ T.any(
33
+ OpenAI::ContentProvenanceCheck::Result::C2PA::OrHash,
34
+ OpenAI::ContentProvenanceCheck::Result::SynthID::OrHash
35
+ )
36
+ ]
37
+ ).returns(T.attached_class)
38
+ end
39
+ def self.new(
40
+ # The Unix timestamp, in seconds, when the provenance check was created.
41
+ created_at:,
42
+ # The object type. Always `content_provenance_check` for this endpoint.
43
+ object:,
44
+ # The provenance results that apply to the uploaded file. Image results include
45
+ # C2PA and SynthID; audio results include SynthID.
46
+ results:
47
+ )
48
+ end
49
+
50
+ sig do
51
+ override.returns(
52
+ {
53
+ created_at: Integer,
54
+ object: OpenAI::ContentProvenanceCheck::Object::TaggedSymbol,
55
+ results: T::Array[OpenAI::ContentProvenanceCheck::Result::Variants]
56
+ }
57
+ )
58
+ end
59
+ def to_hash
60
+ end
61
+
62
+ # The object type. Always `content_provenance_check` for this endpoint.
63
+ module Object
64
+ extend OpenAI::Internal::Type::Enum
65
+
66
+ TaggedSymbol =
67
+ T.type_alias { T.all(Symbol, OpenAI::ContentProvenanceCheck::Object) }
68
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
69
+
70
+ CONTENT_PROVENANCE_CHECK =
71
+ T.let(
72
+ :content_provenance_check,
73
+ OpenAI::ContentProvenanceCheck::Object::TaggedSymbol
74
+ )
75
+
76
+ sig do
77
+ override.returns(
78
+ T::Array[OpenAI::ContentProvenanceCheck::Object::TaggedSymbol]
79
+ )
80
+ end
81
+ def self.values
82
+ end
83
+ end
84
+
85
+ module Result
86
+ extend OpenAI::Internal::Type::Union
87
+
88
+ Variants =
89
+ T.type_alias do
90
+ T.any(
91
+ OpenAI::ContentProvenanceCheck::Result::C2PA,
92
+ OpenAI::ContentProvenanceCheck::Result::SynthID
93
+ )
94
+ end
95
+
96
+ class C2PA < OpenAI::Internal::Type::BaseModel
97
+ OrHash =
98
+ T.type_alias do
99
+ T.any(
100
+ OpenAI::ContentProvenanceCheck::Result::C2PA,
101
+ OpenAI::Internal::AnyHash
102
+ )
103
+ end
104
+
105
+ # The UTC RFC 3339 timestamp recorded by the provenance signal for when the asset
106
+ # was generated, when available.
107
+ sig { returns(T.nilable(String)) }
108
+ attr_accessor :generated_at
109
+
110
+ # The C2PA manifest issuer, when available.
111
+ sig { returns(T.nilable(String)) }
112
+ attr_accessor :issuer
113
+
114
+ # The OpenAI model recorded by the provenance signal, when available.
115
+ sig { returns(T.nilable(String)) }
116
+ attr_accessor :model
117
+
118
+ # Whether a supported OpenAI C2PA provenance signal was detected. If
119
+ # `not_detected`, it means the tool did not find supported signals in the uploaded
120
+ # file. The content could still have been generated by OpenAI if the metadata was
121
+ # stripped or has evidence of tampering, the watermark was degraded, it comes from
122
+ # a legacy generation model, or it was created before provenance signals were
123
+ # available. Content could also still be AI-generated by another company's model,
124
+ # which the tool currently does not detect.
125
+ sig do
126
+ returns(
127
+ OpenAI::ContentProvenanceCheck::Result::C2PA::Outcome::TaggedSymbol
128
+ )
129
+ end
130
+ attr_accessor :outcome
131
+
132
+ # The provenance signal type. Always `c2pa`.
133
+ sig { returns(Symbol) }
134
+ attr_accessor :type
135
+
136
+ # The validation status of the C2PA manifest in the uploaded image.
137
+ sig do
138
+ returns(
139
+ OpenAI::ContentProvenanceCheck::Result::C2PA::ValidationState::TaggedSymbol
140
+ )
141
+ end
142
+ attr_accessor :validation_state
143
+
144
+ sig do
145
+ params(
146
+ generated_at: T.nilable(String),
147
+ issuer: T.nilable(String),
148
+ model: T.nilable(String),
149
+ outcome:
150
+ OpenAI::ContentProvenanceCheck::Result::C2PA::Outcome::OrSymbol,
151
+ validation_state:
152
+ OpenAI::ContentProvenanceCheck::Result::C2PA::ValidationState::OrSymbol,
153
+ type: Symbol
154
+ ).returns(T.attached_class)
155
+ end
156
+ def self.new(
157
+ # The UTC RFC 3339 timestamp recorded by the provenance signal for when the asset
158
+ # was generated, when available.
159
+ generated_at:,
160
+ # The C2PA manifest issuer, when available.
161
+ issuer:,
162
+ # The OpenAI model recorded by the provenance signal, when available.
163
+ model:,
164
+ # Whether a supported OpenAI C2PA provenance signal was detected. If
165
+ # `not_detected`, it means the tool did not find supported signals in the uploaded
166
+ # file. The content could still have been generated by OpenAI if the metadata was
167
+ # stripped or has evidence of tampering, the watermark was degraded, it comes from
168
+ # a legacy generation model, or it was created before provenance signals were
169
+ # available. Content could also still be AI-generated by another company's model,
170
+ # which the tool currently does not detect.
171
+ outcome:,
172
+ # The validation status of the C2PA manifest in the uploaded image.
173
+ validation_state:,
174
+ # The provenance signal type. Always `c2pa`.
175
+ type: :c2pa
176
+ )
177
+ end
178
+
179
+ sig do
180
+ override.returns(
181
+ {
182
+ generated_at: T.nilable(String),
183
+ issuer: T.nilable(String),
184
+ model: T.nilable(String),
185
+ outcome:
186
+ OpenAI::ContentProvenanceCheck::Result::C2PA::Outcome::TaggedSymbol,
187
+ type: Symbol,
188
+ validation_state:
189
+ OpenAI::ContentProvenanceCheck::Result::C2PA::ValidationState::TaggedSymbol
190
+ }
191
+ )
192
+ end
193
+ def to_hash
194
+ end
195
+
196
+ # Whether a supported OpenAI C2PA provenance signal was detected. If
197
+ # `not_detected`, it means the tool did not find supported signals in the uploaded
198
+ # file. The content could still have been generated by OpenAI if the metadata was
199
+ # stripped or has evidence of tampering, the watermark was degraded, it comes from
200
+ # a legacy generation model, or it was created before provenance signals were
201
+ # available. Content could also still be AI-generated by another company's model,
202
+ # which the tool currently does not detect.
203
+ module Outcome
204
+ extend OpenAI::Internal::Type::Enum
205
+
206
+ TaggedSymbol =
207
+ T.type_alias do
208
+ T.all(
209
+ Symbol,
210
+ OpenAI::ContentProvenanceCheck::Result::C2PA::Outcome
211
+ )
212
+ end
213
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
214
+
215
+ DETECTED =
216
+ T.let(
217
+ :detected,
218
+ OpenAI::ContentProvenanceCheck::Result::C2PA::Outcome::TaggedSymbol
219
+ )
220
+ NOT_DETECTED =
221
+ T.let(
222
+ :not_detected,
223
+ OpenAI::ContentProvenanceCheck::Result::C2PA::Outcome::TaggedSymbol
224
+ )
225
+
226
+ sig do
227
+ override.returns(
228
+ T::Array[
229
+ OpenAI::ContentProvenanceCheck::Result::C2PA::Outcome::TaggedSymbol
230
+ ]
231
+ )
232
+ end
233
+ def self.values
234
+ end
235
+ end
236
+
237
+ # The validation status of the C2PA manifest in the uploaded image.
238
+ module ValidationState
239
+ extend OpenAI::Internal::Type::Enum
240
+
241
+ TaggedSymbol =
242
+ T.type_alias do
243
+ T.all(
244
+ Symbol,
245
+ OpenAI::ContentProvenanceCheck::Result::C2PA::ValidationState
246
+ )
247
+ end
248
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
249
+
250
+ TRUSTED =
251
+ T.let(
252
+ :trusted,
253
+ OpenAI::ContentProvenanceCheck::Result::C2PA::ValidationState::TaggedSymbol
254
+ )
255
+ VALID =
256
+ T.let(
257
+ :valid,
258
+ OpenAI::ContentProvenanceCheck::Result::C2PA::ValidationState::TaggedSymbol
259
+ )
260
+ INVALID =
261
+ T.let(
262
+ :invalid,
263
+ OpenAI::ContentProvenanceCheck::Result::C2PA::ValidationState::TaggedSymbol
264
+ )
265
+ NOT_PRESENT =
266
+ T.let(
267
+ :not_present,
268
+ OpenAI::ContentProvenanceCheck::Result::C2PA::ValidationState::TaggedSymbol
269
+ )
270
+
271
+ sig do
272
+ override.returns(
273
+ T::Array[
274
+ OpenAI::ContentProvenanceCheck::Result::C2PA::ValidationState::TaggedSymbol
275
+ ]
276
+ )
277
+ end
278
+ def self.values
279
+ end
280
+ end
281
+ end
282
+
283
+ class SynthID < OpenAI::Internal::Type::BaseModel
284
+ OrHash =
285
+ T.type_alias do
286
+ T.any(
287
+ OpenAI::ContentProvenanceCheck::Result::SynthID,
288
+ OpenAI::Internal::AnyHash
289
+ )
290
+ end
291
+
292
+ # The UTC RFC 3339 timestamp recorded by the provenance signal for when the asset
293
+ # was generated, when available.
294
+ sig { returns(T.nilable(String)) }
295
+ attr_accessor :generated_at
296
+
297
+ # The OpenAI model recorded by the provenance signal, when available.
298
+ sig { returns(T.nilable(String)) }
299
+ attr_accessor :model
300
+
301
+ # Whether a supported OpenAI SynthID watermark was detected. If `not_detected`, it
302
+ # means the tool did not find supported signals in the uploaded file. The content
303
+ # could still have been generated by OpenAI if the metadata was stripped or has
304
+ # evidence of tampering, the watermark was degraded, it comes from a legacy
305
+ # generation model, or it was created before provenance signals were available.
306
+ # Content could also still be AI-generated by another company's model, which the
307
+ # tool currently does not detect.
308
+ sig do
309
+ returns(
310
+ OpenAI::ContentProvenanceCheck::Result::SynthID::Outcome::TaggedSymbol
311
+ )
312
+ end
313
+ attr_accessor :outcome
314
+
315
+ # The provenance signal type. Always `synthid`.
316
+ sig { returns(Symbol) }
317
+ attr_accessor :type
318
+
319
+ sig do
320
+ params(
321
+ generated_at: T.nilable(String),
322
+ model: T.nilable(String),
323
+ outcome:
324
+ OpenAI::ContentProvenanceCheck::Result::SynthID::Outcome::OrSymbol,
325
+ type: Symbol
326
+ ).returns(T.attached_class)
327
+ end
328
+ def self.new(
329
+ # The UTC RFC 3339 timestamp recorded by the provenance signal for when the asset
330
+ # was generated, when available.
331
+ generated_at:,
332
+ # The OpenAI model recorded by the provenance signal, when available.
333
+ model:,
334
+ # Whether a supported OpenAI SynthID watermark was detected. If `not_detected`, it
335
+ # means the tool did not find supported signals in the uploaded file. The content
336
+ # could still have been generated by OpenAI if the metadata was stripped or has
337
+ # evidence of tampering, the watermark was degraded, it comes from a legacy
338
+ # generation model, or it was created before provenance signals were available.
339
+ # Content could also still be AI-generated by another company's model, which the
340
+ # tool currently does not detect.
341
+ outcome:,
342
+ # The provenance signal type. Always `synthid`.
343
+ type: :synthid
344
+ )
345
+ end
346
+
347
+ sig do
348
+ override.returns(
349
+ {
350
+ generated_at: T.nilable(String),
351
+ model: T.nilable(String),
352
+ outcome:
353
+ OpenAI::ContentProvenanceCheck::Result::SynthID::Outcome::TaggedSymbol,
354
+ type: Symbol
355
+ }
356
+ )
357
+ end
358
+ def to_hash
359
+ end
360
+
361
+ # Whether a supported OpenAI SynthID watermark was detected. If `not_detected`, it
362
+ # means the tool did not find supported signals in the uploaded file. The content
363
+ # could still have been generated by OpenAI if the metadata was stripped or has
364
+ # evidence of tampering, the watermark was degraded, it comes from a legacy
365
+ # generation model, or it was created before provenance signals were available.
366
+ # Content could also still be AI-generated by another company's model, which the
367
+ # tool currently does not detect.
368
+ module Outcome
369
+ extend OpenAI::Internal::Type::Enum
370
+
371
+ TaggedSymbol =
372
+ T.type_alias do
373
+ T.all(
374
+ Symbol,
375
+ OpenAI::ContentProvenanceCheck::Result::SynthID::Outcome
376
+ )
377
+ end
378
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
379
+
380
+ DETECTED =
381
+ T.let(
382
+ :detected,
383
+ OpenAI::ContentProvenanceCheck::Result::SynthID::Outcome::TaggedSymbol
384
+ )
385
+ NOT_DETECTED =
386
+ T.let(
387
+ :not_detected,
388
+ OpenAI::ContentProvenanceCheck::Result::SynthID::Outcome::TaggedSymbol
389
+ )
390
+
391
+ sig do
392
+ override.returns(
393
+ T::Array[
394
+ OpenAI::ContentProvenanceCheck::Result::SynthID::Outcome::TaggedSymbol
395
+ ]
396
+ )
397
+ end
398
+ def self.values
399
+ end
400
+ end
401
+ end
402
+
403
+ sig do
404
+ override.returns(
405
+ T::Array[OpenAI::ContentProvenanceCheck::Result::Variants]
406
+ )
407
+ end
408
+ def self.variants
409
+ end
410
+ end
411
+ end
412
+ end
413
+ end
@@ -0,0 +1,46 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+ class ContentProvenanceCheckCreateParams < OpenAI::Internal::Type::BaseModel
6
+ extend OpenAI::Internal::Type::RequestParameters::Converter
7
+ include OpenAI::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ OpenAI::ContentProvenanceCheckCreateParams,
13
+ OpenAI::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # The image or audio file to check for supported OpenAI provenance signals.
18
+ sig { returns(OpenAI::Internal::FileInput) }
19
+ attr_accessor :file
20
+
21
+ sig do
22
+ params(
23
+ file: OpenAI::Internal::FileInput,
24
+ request_options: OpenAI::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(
28
+ # The image or audio file to check for supported OpenAI provenance signals.
29
+ file:,
30
+ request_options: {}
31
+ )
32
+ end
33
+
34
+ sig do
35
+ override.returns(
36
+ {
37
+ file: OpenAI::Internal::FileInput,
38
+ request_options: OpenAI::RequestOptions
39
+ }
40
+ )
41
+ end
42
+ def to_hash
43
+ end
44
+ end
45
+ end
46
+ end