openai 0.53.0 → 0.55.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 (58) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/audio/speech_create_params.rb +32 -8
  5. data/lib/openai/models/chat/chat_completion_audio_param.rb +30 -6
  6. data/lib/openai/models/image_input_reference_param.rb +23 -0
  7. data/lib/openai/models/realtime/realtime_audio_config_output.rb +34 -8
  8. data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +34 -8
  9. data/lib/openai/models/responses/response_input_file.rb +1 -24
  10. data/lib/openai/models/responses/response_input_file_content.rb +1 -27
  11. data/lib/openai/models/video_create_character_params.rb +30 -0
  12. data/lib/openai/models/video_create_character_response.rb +33 -0
  13. data/lib/openai/models/video_create_params.rb +17 -4
  14. data/lib/openai/models/video_edit_params.rb +57 -0
  15. data/lib/openai/models/video_extend_params.rb +69 -0
  16. data/lib/openai/models/video_get_character_params.rb +20 -0
  17. data/lib/openai/models/video_get_character_response.rb +33 -0
  18. data/lib/openai/models.rb +10 -0
  19. data/lib/openai/resources/audio/speech.rb +1 -1
  20. data/lib/openai/resources/videos.rb +102 -1
  21. data/lib/openai/version.rb +1 -1
  22. data/lib/openai.rb +7 -0
  23. data/rbi/openai/client.rbi +6 -0
  24. data/rbi/openai/models/audio/speech_create_params.rbi +49 -10
  25. data/rbi/openai/models/chat/chat_completion_audio_param.rbi +40 -7
  26. data/rbi/openai/models/image_input_reference_param.rbi +39 -0
  27. data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +48 -11
  28. data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +48 -11
  29. data/rbi/openai/models/responses/response_input_file.rbi +0 -54
  30. data/rbi/openai/models/responses/response_input_file_content.rbi +0 -59
  31. data/rbi/openai/models/video_create_character_params.rbi +51 -0
  32. data/rbi/openai/models/video_create_character_response.rbi +56 -0
  33. data/rbi/openai/models/video_create_params.rbi +44 -6
  34. data/rbi/openai/models/video_edit_params.rbi +111 -0
  35. data/rbi/openai/models/video_extend_params.rbi +121 -0
  36. data/rbi/openai/models/video_get_character_params.rbi +35 -0
  37. data/rbi/openai/models/video_get_character_response.rbi +56 -0
  38. data/rbi/openai/models.rbi +10 -0
  39. data/rbi/openai/resources/audio/speech.rbi +8 -3
  40. data/rbi/openai/resources/videos.rbi +84 -2
  41. data/sig/openai/client.rbs +3 -0
  42. data/sig/openai/models/audio/speech_create_params.rbs +11 -0
  43. data/sig/openai/models/chat/chat_completion_audio_param.rbs +11 -0
  44. data/sig/openai/models/image_input_reference_param.rbs +19 -0
  45. data/sig/openai/models/realtime/realtime_audio_config_output.rbs +11 -0
  46. data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +11 -0
  47. data/sig/openai/models/responses/response_input_file.rbs +0 -20
  48. data/sig/openai/models/responses/response_input_file_content.rbs +0 -20
  49. data/sig/openai/models/video_create_character_params.rbs +28 -0
  50. data/sig/openai/models/video_create_character_response.rbs +18 -0
  51. data/sig/openai/models/video_create_params.rbs +15 -6
  52. data/sig/openai/models/video_edit_params.rbs +48 -0
  53. data/sig/openai/models/video_extend_params.rbs +56 -0
  54. data/sig/openai/models/video_get_character_params.rbs +23 -0
  55. data/sig/openai/models/video_get_character_response.rbs +18 -0
  56. data/sig/openai/models.rbs +10 -0
  57. data/sig/openai/resources/videos.rbs +25 -1
  58. metadata +23 -2
@@ -53,14 +53,17 @@ module OpenAI
53
53
 
54
54
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
55
55
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
56
- # `cedar`. Voice cannot be changed during the session once the model has responded
57
- # with audio at least once. We recommend `marin` and `cedar` for best quality.
56
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
57
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
58
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
59
+ # for best quality.
58
60
  sig do
59
61
  returns(
60
62
  T.nilable(
61
63
  T.any(
62
64
  String,
63
- OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::OrSymbol
65
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::OrSymbol,
66
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::ID
64
67
  )
65
68
  )
66
69
  )
@@ -72,7 +75,8 @@ module OpenAI
72
75
  voice:
73
76
  T.any(
74
77
  String,
75
- OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::OrSymbol
78
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::OrSymbol,
79
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::ID::OrHash
76
80
  )
77
81
  ).void
78
82
  end
@@ -90,7 +94,8 @@ module OpenAI
90
94
  voice:
91
95
  T.any(
92
96
  String,
93
- OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::OrSymbol
97
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::OrSymbol,
98
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::ID::OrHash
94
99
  )
95
100
  ).returns(T.attached_class)
96
101
  end
@@ -107,8 +112,10 @@ module OpenAI
107
112
  speed: nil,
108
113
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
109
114
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
110
- # `cedar`. Voice cannot be changed during the session once the model has responded
111
- # with audio at least once. We recommend `marin` and `cedar` for best quality.
115
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
116
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
117
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
118
+ # for best quality.
112
119
  voice: nil
113
120
  )
114
121
  end
@@ -126,7 +133,8 @@ module OpenAI
126
133
  voice:
127
134
  T.any(
128
135
  String,
129
- OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::OrSymbol
136
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::OrSymbol,
137
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::ID
130
138
  )
131
139
  }
132
140
  )
@@ -136,8 +144,10 @@ module OpenAI
136
144
 
137
145
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
138
146
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
139
- # `cedar`. Voice cannot be changed during the session once the model has responded
140
- # with audio at least once. We recommend `marin` and `cedar` for best quality.
147
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
148
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
149
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
150
+ # for best quality.
141
151
  module Voice
142
152
  extend OpenAI::Internal::Type::Union
143
153
 
@@ -145,10 +155,37 @@ module OpenAI
145
155
  T.type_alias do
146
156
  T.any(
147
157
  String,
148
- OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::TaggedSymbol
158
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::TaggedSymbol,
159
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::ID
149
160
  )
150
161
  end
151
162
 
163
+ class ID < OpenAI::Internal::Type::BaseModel
164
+ OrHash =
165
+ T.type_alias do
166
+ T.any(
167
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::ID,
168
+ OpenAI::Internal::AnyHash
169
+ )
170
+ end
171
+
172
+ # The custom voice ID, e.g. `voice_1234`.
173
+ sig { returns(String) }
174
+ attr_accessor :id
175
+
176
+ # Custom voice reference.
177
+ sig { params(id: String).returns(T.attached_class) }
178
+ def self.new(
179
+ # The custom voice ID, e.g. `voice_1234`.
180
+ id:
181
+ )
182
+ end
183
+
184
+ sig { override.returns({ id: String }) }
185
+ def to_hash
186
+ end
187
+ end
188
+
152
189
  sig do
153
190
  override.returns(
154
191
  T::Array[
@@ -87,14 +87,17 @@ module OpenAI
87
87
 
88
88
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
89
89
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
90
- # `cedar`. Voice cannot be changed during the session once the model has responded
91
- # with audio at least once.
90
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
91
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
92
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
93
+ # for best quality.
92
94
  sig do
93
95
  returns(
94
96
  T.nilable(
95
97
  T.any(
96
98
  String,
97
- OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::OrSymbol
99
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::OrSymbol,
100
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID
98
101
  )
99
102
  )
100
103
  )
@@ -106,7 +109,8 @@ module OpenAI
106
109
  voice:
107
110
  T.any(
108
111
  String,
109
- OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::OrSymbol
112
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::OrSymbol,
113
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID::OrHash
110
114
  )
111
115
  ).void
112
116
  end
@@ -123,7 +127,8 @@ module OpenAI
123
127
  voice:
124
128
  T.any(
125
129
  String,
126
- OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::OrSymbol
130
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::OrSymbol,
131
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID::OrHash
127
132
  )
128
133
  ).returns(T.attached_class)
129
134
  end
@@ -132,8 +137,10 @@ module OpenAI
132
137
  format_: nil,
133
138
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
134
139
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
135
- # `cedar`. Voice cannot be changed during the session once the model has responded
136
- # with audio at least once.
140
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
141
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
142
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
143
+ # for best quality.
137
144
  voice: nil
138
145
  )
139
146
  end
@@ -150,7 +157,8 @@ module OpenAI
150
157
  voice:
151
158
  T.any(
152
159
  String,
153
- OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::OrSymbol
160
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::OrSymbol,
161
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID
154
162
  )
155
163
  }
156
164
  )
@@ -160,8 +168,10 @@ module OpenAI
160
168
 
161
169
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
162
170
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
163
- # `cedar`. Voice cannot be changed during the session once the model has responded
164
- # with audio at least once.
171
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
172
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
173
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
174
+ # for best quality.
165
175
  module Voice
166
176
  extend OpenAI::Internal::Type::Union
167
177
 
@@ -169,10 +179,37 @@ module OpenAI
169
179
  T.type_alias do
170
180
  T.any(
171
181
  String,
172
- OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::TaggedSymbol
182
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::TaggedSymbol,
183
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID
173
184
  )
174
185
  end
175
186
 
187
+ class ID < OpenAI::Internal::Type::BaseModel
188
+ OrHash =
189
+ T.type_alias do
190
+ T.any(
191
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID,
192
+ OpenAI::Internal::AnyHash
193
+ )
194
+ end
195
+
196
+ # The custom voice ID, e.g. `voice_1234`.
197
+ sig { returns(String) }
198
+ attr_accessor :id
199
+
200
+ # Custom voice reference.
201
+ sig { params(id: String).returns(T.attached_class) }
202
+ def self.new(
203
+ # The custom voice ID, e.g. `voice_1234`.
204
+ id:
205
+ )
206
+ end
207
+
208
+ sig { override.returns({ id: String }) }
209
+ def to_hash
210
+ end
211
+ end
212
+
176
213
  sig do
177
214
  override.returns(
178
215
  T::Array[
@@ -16,22 +16,6 @@ module OpenAI
16
16
  sig { returns(Symbol) }
17
17
  attr_accessor :type
18
18
 
19
- # The detail level of the file to be sent to the model. One of `high` or `low`.
20
- # Defaults to `high`.
21
- sig do
22
- returns(
23
- T.nilable(OpenAI::Responses::ResponseInputFile::Detail::OrSymbol)
24
- )
25
- end
26
- attr_reader :detail
27
-
28
- sig do
29
- params(
30
- detail: OpenAI::Responses::ResponseInputFile::Detail::OrSymbol
31
- ).void
32
- end
33
- attr_writer :detail
34
-
35
19
  # The content of the file to be sent to the model.
36
20
  sig { returns(T.nilable(String)) }
37
21
  attr_reader :file_data
@@ -60,7 +44,6 @@ module OpenAI
60
44
  # A file input to the model.
61
45
  sig do
62
46
  params(
63
- detail: OpenAI::Responses::ResponseInputFile::Detail::OrSymbol,
64
47
  file_data: String,
65
48
  file_id: T.nilable(String),
66
49
  file_url: String,
@@ -69,9 +52,6 @@ module OpenAI
69
52
  ).returns(T.attached_class)
70
53
  end
71
54
  def self.new(
72
- # The detail level of the file to be sent to the model. One of `high` or `low`.
73
- # Defaults to `high`.
74
- detail: nil,
75
55
  # The content of the file to be sent to the model.
76
56
  file_data: nil,
77
57
  # The ID of the file to be sent to the model.
@@ -89,7 +69,6 @@ module OpenAI
89
69
  override.returns(
90
70
  {
91
71
  type: Symbol,
92
- detail: OpenAI::Responses::ResponseInputFile::Detail::OrSymbol,
93
72
  file_data: String,
94
73
  file_id: T.nilable(String),
95
74
  file_url: String,
@@ -99,39 +78,6 @@ module OpenAI
99
78
  end
100
79
  def to_hash
101
80
  end
102
-
103
- # The detail level of the file to be sent to the model. One of `high` or `low`.
104
- # Defaults to `high`.
105
- module Detail
106
- extend OpenAI::Internal::Type::Enum
107
-
108
- TaggedSymbol =
109
- T.type_alias do
110
- T.all(Symbol, OpenAI::Responses::ResponseInputFile::Detail)
111
- end
112
- OrSymbol = T.type_alias { T.any(Symbol, String) }
113
-
114
- LOW =
115
- T.let(
116
- :low,
117
- OpenAI::Responses::ResponseInputFile::Detail::TaggedSymbol
118
- )
119
- HIGH =
120
- T.let(
121
- :high,
122
- OpenAI::Responses::ResponseInputFile::Detail::TaggedSymbol
123
- )
124
-
125
- sig do
126
- override.returns(
127
- T::Array[
128
- OpenAI::Responses::ResponseInputFile::Detail::TaggedSymbol
129
- ]
130
- )
131
- end
132
- def self.values
133
- end
134
- end
135
81
  end
136
82
  end
137
83
  end
@@ -16,25 +16,6 @@ module OpenAI
16
16
  sig { returns(Symbol) }
17
17
  attr_accessor :type
18
18
 
19
- # The detail level of the file to be sent to the model. One of `high` or `low`.
20
- # Defaults to `high`.
21
- sig do
22
- returns(
23
- T.nilable(
24
- OpenAI::Responses::ResponseInputFileContent::Detail::OrSymbol
25
- )
26
- )
27
- end
28
- attr_reader :detail
29
-
30
- sig do
31
- params(
32
- detail:
33
- OpenAI::Responses::ResponseInputFileContent::Detail::OrSymbol
34
- ).void
35
- end
36
- attr_writer :detail
37
-
38
19
  # The base64-encoded data of the file to be sent to the model.
39
20
  sig { returns(T.nilable(String)) }
40
21
  attr_accessor :file_data
@@ -54,8 +35,6 @@ module OpenAI
54
35
  # A file input to the model.
55
36
  sig do
56
37
  params(
57
- detail:
58
- OpenAI::Responses::ResponseInputFileContent::Detail::OrSymbol,
59
38
  file_data: T.nilable(String),
60
39
  file_id: T.nilable(String),
61
40
  file_url: T.nilable(String),
@@ -64,9 +43,6 @@ module OpenAI
64
43
  ).returns(T.attached_class)
65
44
  end
66
45
  def self.new(
67
- # The detail level of the file to be sent to the model. One of `high` or `low`.
68
- # Defaults to `high`.
69
- detail: nil,
70
46
  # The base64-encoded data of the file to be sent to the model.
71
47
  file_data: nil,
72
48
  # The ID of the file to be sent to the model.
@@ -84,8 +60,6 @@ module OpenAI
84
60
  override.returns(
85
61
  {
86
62
  type: Symbol,
87
- detail:
88
- OpenAI::Responses::ResponseInputFileContent::Detail::OrSymbol,
89
63
  file_data: T.nilable(String),
90
64
  file_id: T.nilable(String),
91
65
  file_url: T.nilable(String),
@@ -95,39 +69,6 @@ module OpenAI
95
69
  end
96
70
  def to_hash
97
71
  end
98
-
99
- # The detail level of the file to be sent to the model. One of `high` or `low`.
100
- # Defaults to `high`.
101
- module Detail
102
- extend OpenAI::Internal::Type::Enum
103
-
104
- TaggedSymbol =
105
- T.type_alias do
106
- T.all(Symbol, OpenAI::Responses::ResponseInputFileContent::Detail)
107
- end
108
- OrSymbol = T.type_alias { T.any(Symbol, String) }
109
-
110
- HIGH =
111
- T.let(
112
- :high,
113
- OpenAI::Responses::ResponseInputFileContent::Detail::TaggedSymbol
114
- )
115
- LOW =
116
- T.let(
117
- :low,
118
- OpenAI::Responses::ResponseInputFileContent::Detail::TaggedSymbol
119
- )
120
-
121
- sig do
122
- override.returns(
123
- T::Array[
124
- OpenAI::Responses::ResponseInputFileContent::Detail::TaggedSymbol
125
- ]
126
- )
127
- end
128
- def self.values
129
- end
130
- end
131
72
  end
132
73
  end
133
74
  end
@@ -0,0 +1,51 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+ class VideoCreateCharacterParams < 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(OpenAI::VideoCreateCharacterParams, OpenAI::Internal::AnyHash)
12
+ end
13
+
14
+ # Display name for this API character.
15
+ sig { returns(String) }
16
+ attr_accessor :name
17
+
18
+ # Video file used to create a character.
19
+ sig { returns(OpenAI::Internal::FileInput) }
20
+ attr_accessor :video
21
+
22
+ sig do
23
+ params(
24
+ name: String,
25
+ video: OpenAI::Internal::FileInput,
26
+ request_options: OpenAI::RequestOptions::OrHash
27
+ ).returns(T.attached_class)
28
+ end
29
+ def self.new(
30
+ # Display name for this API character.
31
+ name:,
32
+ # Video file used to create a character.
33
+ video:,
34
+ request_options: {}
35
+ )
36
+ end
37
+
38
+ sig do
39
+ override.returns(
40
+ {
41
+ name: String,
42
+ video: OpenAI::Internal::FileInput,
43
+ request_options: OpenAI::RequestOptions
44
+ }
45
+ )
46
+ end
47
+ def to_hash
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,56 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+ class VideoCreateCharacterResponse < OpenAI::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ OpenAI::Models::VideoCreateCharacterResponse,
10
+ OpenAI::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # Identifier for the character creation cameo.
15
+ sig { returns(T.nilable(String)) }
16
+ attr_accessor :id
17
+
18
+ # Unix timestamp (in seconds) when the character was created.
19
+ sig { returns(Integer) }
20
+ attr_accessor :created_at
21
+
22
+ # Display name for the character.
23
+ sig { returns(T.nilable(String)) }
24
+ attr_accessor :name
25
+
26
+ sig do
27
+ params(
28
+ id: T.nilable(String),
29
+ created_at: Integer,
30
+ name: T.nilable(String)
31
+ ).returns(T.attached_class)
32
+ end
33
+ def self.new(
34
+ # Identifier for the character creation cameo.
35
+ id:,
36
+ # Unix timestamp (in seconds) when the character was created.
37
+ created_at:,
38
+ # Display name for the character.
39
+ name:
40
+ )
41
+ end
42
+
43
+ sig do
44
+ override.returns(
45
+ {
46
+ id: T.nilable(String),
47
+ created_at: Integer,
48
+ name: T.nilable(String)
49
+ }
50
+ )
51
+ end
52
+ def to_hash
53
+ end
54
+ end
55
+ end
56
+ end
@@ -15,11 +15,25 @@ module OpenAI
15
15
  sig { returns(String) }
16
16
  attr_accessor :prompt
17
17
 
18
- # Optional multipart reference asset that guides generation.
19
- sig { returns(T.nilable(OpenAI::Internal::FileInput)) }
18
+ # Optional reference asset upload or reference object that guides generation.
19
+ sig do
20
+ returns(
21
+ T.nilable(
22
+ T.any(OpenAI::Internal::FileInput, OpenAI::ImageInputReferenceParam)
23
+ )
24
+ )
25
+ end
20
26
  attr_reader :input_reference
21
27
 
22
- sig { params(input_reference: OpenAI::Internal::FileInput).void }
28
+ sig do
29
+ params(
30
+ input_reference:
31
+ T.any(
32
+ OpenAI::Internal::FileInput,
33
+ OpenAI::ImageInputReferenceParam::OrHash
34
+ )
35
+ ).void
36
+ end
23
37
  attr_writer :input_reference
24
38
 
25
39
  # The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults
@@ -48,7 +62,11 @@ module OpenAI
48
62
  sig do
49
63
  params(
50
64
  prompt: String,
51
- input_reference: OpenAI::Internal::FileInput,
65
+ input_reference:
66
+ T.any(
67
+ OpenAI::Internal::FileInput,
68
+ OpenAI::ImageInputReferenceParam::OrHash
69
+ ),
52
70
  model: T.any(String, OpenAI::VideoModel::OrSymbol),
53
71
  seconds: OpenAI::VideoSeconds::OrSymbol,
54
72
  size: OpenAI::VideoSize::OrSymbol,
@@ -58,7 +76,7 @@ module OpenAI
58
76
  def self.new(
59
77
  # Text prompt that describes the video to generate.
60
78
  prompt:,
61
- # Optional multipart reference asset that guides generation.
79
+ # Optional reference asset upload or reference object that guides generation.
62
80
  input_reference: nil,
63
81
  # The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults
64
82
  # to `sora-2`.
@@ -76,7 +94,11 @@ module OpenAI
76
94
  override.returns(
77
95
  {
78
96
  prompt: String,
79
- input_reference: OpenAI::Internal::FileInput,
97
+ input_reference:
98
+ T.any(
99
+ OpenAI::Internal::FileInput,
100
+ OpenAI::ImageInputReferenceParam
101
+ ),
80
102
  model: T.any(String, OpenAI::VideoModel::OrSymbol),
81
103
  seconds: OpenAI::VideoSeconds::OrSymbol,
82
104
  size: OpenAI::VideoSize::OrSymbol,
@@ -86,6 +108,22 @@ module OpenAI
86
108
  end
87
109
  def to_hash
88
110
  end
111
+
112
+ # Optional reference asset upload or reference object that guides generation.
113
+ module InputReference
114
+ extend OpenAI::Internal::Type::Union
115
+
116
+ Variants =
117
+ T.type_alias { T.any(StringIO, OpenAI::ImageInputReferenceParam) }
118
+
119
+ sig do
120
+ override.returns(
121
+ T::Array[OpenAI::VideoCreateParams::InputReference::Variants]
122
+ )
123
+ end
124
+ def self.variants
125
+ end
126
+ end
89
127
  end
90
128
  end
91
129
  end