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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b766e29a63caac40f46433aca7cf7624c2f2f19b74e4948afab86e27bb8d6e3
4
- data.tar.gz: '070255620935603f097a6bedfe7430ba91877b4fb603b5530899b8380ef6ce35'
3
+ metadata.gz: 1829322792fdc33445abe86fe08267e3b93d183511e2e1651ef6e1cd81ecc1b8
4
+ data.tar.gz: 2b9578ceacd8423c77d35e7c3f0e3f7fb9d56bcd971403a83dedf8bb0cb9fa51
5
5
  SHA512:
6
- metadata.gz: 8d8d216165e0f85bafb298a5ea2aee7938a07a44258b2f2521f8dec6ef7319b4a6026c2aa4989ad99f3aa3b9dd712f42984103d8b78a092483d0bff175b04168
7
- data.tar.gz: aa9d16013208f0c29398f428f9af76f29da7307be8fe15389879748fbc8fc2d379a7adf4eac3a4933aa3d8de9c13c8ed6c1f99b1699b7e95d0b7ecad002879be
6
+ metadata.gz: 6a248621c5aea0ac33ad525d91dfae5e7b9934c18b8e7a172685dade248784c44b7d262ba1575472efdec948be1cc52e4d588845a13a12f2bb87854d196fd095
7
+ data.tar.gz: 1247752dd4600a775ea0d52f977d360348bf0ade61b5274bcd92a135d5a86db2acaf689feb9cd35e58f33db37d246dee6e37a9e0d2c0b4b704fe46920079312f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.55.0 (2026-03-13)
4
+
5
+ Full Changelog: [v0.54.0...v0.55.0](https://github.com/openai/openai-ruby/compare/v0.54.0...v0.55.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** custom voices ([a9f7891](https://github.com/openai/openai-ruby/commit/a9f78916b97e3a59f35dbcac05c725474e6634af))
10
+
11
+ ## 0.54.0 (2026-03-13)
12
+
13
+ Full Changelog: [v0.53.0...v0.54.0](https://github.com/openai/openai-ruby/compare/v0.53.0...v0.54.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** api update ([235124c](https://github.com/openai/openai-ruby/commit/235124c18886d02e2373c8075354cd19cf928a1d))
18
+ * **api:** manual updates ([d1ee93f](https://github.com/openai/openai-ruby/commit/d1ee93fd53b18ba7a6c38d75ecac9ab6b6eade9f))
19
+ * **api:** manual updates ([8f13ded](https://github.com/openai/openai-ruby/commit/8f13ded017186651bbfaf679e429d7436183f8c0))
20
+ * **api:** sora api improvements: character api, video extensions/edits, higher resolution exports. ([58a8c4d](https://github.com/openai/openai-ruby/commit/58a8c4d13897c6be6735e5255e4e7308c9a7cc44))
21
+ * **client:** add webhook support ([3a2425f](https://github.com/openai/openai-ruby/commit/3a2425ff3ac8cfb883e38e56c1c76585ce6a8ab5))
22
+
23
+
24
+ ### Chores
25
+
26
+ * **internal:** codegen related update ([2100fc4](https://github.com/openai/openai-ruby/commit/2100fc4105da779d09e15723c9ad22eb7a6ad307))
27
+
3
28
  ## 0.53.0 (2026-03-05)
4
29
 
5
30
  Full Changelog: [v0.52.0...v0.53.0](https://github.com/openai/openai-ruby/compare/v0.52.0...v0.53.0)
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "openai", "~> 0.53.0"
18
+ gem "openai", "~> 0.55.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -24,11 +24,12 @@ module OpenAI
24
24
  # @!attribute voice
25
25
  # The voice to use when generating the audio. Supported built-in voices are
26
26
  # `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
27
- # `shimmer`, `verse`, `marin`, and `cedar`. Previews of the voices are available
28
- # in the
27
+ # `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice
28
+ # object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
29
+ # voices are available in the
29
30
  # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
30
31
  #
31
- # @return [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice]
32
+ # @return [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice::ID, OpenAI::Models::Audio::SpeechCreateParams::Voice]
32
33
  required :voice, union: -> { OpenAI::Audio::SpeechCreateParams::Voice }
33
34
 
34
35
  # @!attribute instructions
@@ -67,7 +68,7 @@ module OpenAI
67
68
  #
68
69
  # @param model [String, Symbol, OpenAI::Models::Audio::SpeechModel] One of the available [TTS models](https://platform.openai.com/docs/models#tts):
69
70
  #
70
- # @param voice [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice] The voice to use when generating the audio. Supported built-in voices are `alloy
71
+ # @param voice [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice::ID, OpenAI::Models::Audio::SpeechCreateParams::Voice] The voice to use when generating the audio. Supported built-in voices are `alloy
71
72
  #
72
73
  # @param instructions [String] Control the voice of your generated audio with additional instructions. Does not
73
74
  #
@@ -95,8 +96,9 @@ module OpenAI
95
96
 
96
97
  # The voice to use when generating the audio. Supported built-in voices are
97
98
  # `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
98
- # `shimmer`, `verse`, `marin`, and `cedar`. Previews of the voices are available
99
- # in the
99
+ # `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice
100
+ # object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
101
+ # voices are available in the
100
102
  # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
101
103
  module Voice
102
104
  extend OpenAI::Internal::Type::Union
@@ -123,11 +125,33 @@ module OpenAI
123
125
 
124
126
  variant const: -> { OpenAI::Models::Audio::SpeechCreateParams::Voice::CEDAR }
125
127
 
128
+ # Custom voice reference.
129
+ variant -> { OpenAI::Audio::SpeechCreateParams::Voice::ID }
130
+
131
+ class ID < OpenAI::Internal::Type::BaseModel
132
+ # @!attribute id
133
+ # The custom voice ID, e.g. `voice_1234`.
134
+ #
135
+ # @return [String]
136
+ required :id, String
137
+
138
+ # @!method initialize(id:)
139
+ # Custom voice reference.
140
+ #
141
+ # @param id [String] The custom voice ID, e.g. `voice_1234`.
142
+ end
143
+
126
144
  # @!method self.variants
127
- # @return [Array(String, Symbol)]
145
+ # @return [Array(String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice::ID)]
128
146
 
129
147
  define_sorbet_constant!(:Variants) do
130
- T.type_alias { T.any(String, OpenAI::Audio::SpeechCreateParams::Voice::TaggedSymbol) }
148
+ T.type_alias do
149
+ T.any(
150
+ String,
151
+ OpenAI::Audio::SpeechCreateParams::Voice::TaggedSymbol,
152
+ OpenAI::Audio::SpeechCreateParams::Voice::ID
153
+ )
154
+ end
131
155
  end
132
156
 
133
157
  # @!group
@@ -14,9 +14,10 @@ module OpenAI
14
14
  # @!attribute voice
15
15
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
16
16
  # `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, `shimmer`,
17
- # `marin`, and `cedar`.
17
+ # `marin`, and `cedar`. You may also provide a custom voice object with an `id`,
18
+ # for example `{ "id": "voice_1234" }`.
18
19
  #
19
- # @return [String, Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice]
20
+ # @return [String, Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ID, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice]
20
21
  required :voice, union: -> { OpenAI::Chat::ChatCompletionAudioParam::Voice }
21
22
 
22
23
  # @!method initialize(format_:, voice:)
@@ -29,7 +30,7 @@ module OpenAI
29
30
  #
30
31
  # @param format_ [Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Format] Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`,
31
32
  #
32
- # @param voice [String, Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice] The voice the model uses to respond. Supported built-in voices are `alloy`, `ash
33
+ # @param voice [String, Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ID, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice] The voice the model uses to respond. Supported built-in voices are
33
34
 
34
35
  # Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`,
35
36
  # or `pcm16`.
@@ -51,7 +52,8 @@ module OpenAI
51
52
 
52
53
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
53
54
  # `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, `shimmer`,
54
- # `marin`, and `cedar`.
55
+ # `marin`, and `cedar`. You may also provide a custom voice object with an `id`,
56
+ # for example `{ "id": "voice_1234" }`.
55
57
  #
56
58
  # @see OpenAI::Models::Chat::ChatCompletionAudioParam#voice
57
59
  module Voice
@@ -79,11 +81,33 @@ module OpenAI
79
81
 
80
82
  variant const: -> { OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::CEDAR }
81
83
 
84
+ # Custom voice reference.
85
+ variant -> { OpenAI::Chat::ChatCompletionAudioParam::Voice::ID }
86
+
87
+ class ID < OpenAI::Internal::Type::BaseModel
88
+ # @!attribute id
89
+ # The custom voice ID, e.g. `voice_1234`.
90
+ #
91
+ # @return [String]
92
+ required :id, String
93
+
94
+ # @!method initialize(id:)
95
+ # Custom voice reference.
96
+ #
97
+ # @param id [String] The custom voice ID, e.g. `voice_1234`.
98
+ end
99
+
82
100
  # @!method self.variants
83
- # @return [Array(String, Symbol)]
101
+ # @return [Array(String, Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ID)]
84
102
 
85
103
  define_sorbet_constant!(:Variants) do
86
- T.type_alias { T.any(String, OpenAI::Chat::ChatCompletionAudioParam::Voice::TaggedSymbol) }
104
+ T.type_alias do
105
+ T.any(
106
+ String,
107
+ OpenAI::Chat::ChatCompletionAudioParam::Voice::TaggedSymbol,
108
+ OpenAI::Chat::ChatCompletionAudioParam::Voice::ID
109
+ )
110
+ end
87
111
  end
88
112
 
89
113
  # @!group
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ class ImageInputReferenceParam < OpenAI::Internal::Type::BaseModel
6
+ # @!attribute file_id
7
+ #
8
+ # @return [String, nil]
9
+ optional :file_id, String
10
+
11
+ # @!attribute image_url
12
+ # A fully qualified URL or base64-encoded data URL.
13
+ #
14
+ # @return [String, nil]
15
+ optional :image_url, String
16
+
17
+ # @!method initialize(file_id: nil, image_url: nil)
18
+ # @param file_id [String]
19
+ #
20
+ # @param image_url [String] A fully qualified URL or base64-encoded data URL.
21
+ end
22
+ end
23
+ end
@@ -25,10 +25,12 @@ module OpenAI
25
25
  # @!attribute voice
26
26
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
27
27
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
28
- # `cedar`. Voice cannot be changed during the session once the model has responded
29
- # with audio at least once. We recommend `marin` and `cedar` for best quality.
28
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
29
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
30
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
31
+ # for best quality.
30
32
  #
31
- # @return [String, Symbol, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice, nil]
33
+ # @return [String, Symbol, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice::ID, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice, nil]
32
34
  optional :voice, union: -> { OpenAI::Realtime::RealtimeAudioConfigOutput::Voice }
33
35
 
34
36
  # @!method initialize(format_: nil, speed: nil, voice: nil)
@@ -39,12 +41,14 @@ module OpenAI
39
41
  #
40
42
  # @param speed [Float] The speed of the model's spoken response as a multiple of the original speed.
41
43
  #
42
- # @param voice [String, Symbol, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice] The voice the model uses to respond. Supported built-in voices are `alloy`, `ash
44
+ # @param voice [String, Symbol, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice::ID, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice] The voice the model uses to respond. Supported built-in voices are
43
45
 
44
46
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
45
47
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
46
- # `cedar`. Voice cannot be changed during the session once the model has responded
47
- # with audio at least once. We recommend `marin` and `cedar` for best quality.
48
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
49
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
50
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
51
+ # for best quality.
48
52
  #
49
53
  # @see OpenAI::Models::Realtime::RealtimeAudioConfigOutput#voice
50
54
  module Voice
@@ -72,11 +76,33 @@ module OpenAI
72
76
 
73
77
  variant const: -> { OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice::CEDAR }
74
78
 
79
+ # Custom voice reference.
80
+ variant -> { OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::ID }
81
+
82
+ class ID < OpenAI::Internal::Type::BaseModel
83
+ # @!attribute id
84
+ # The custom voice ID, e.g. `voice_1234`.
85
+ #
86
+ # @return [String]
87
+ required :id, String
88
+
89
+ # @!method initialize(id:)
90
+ # Custom voice reference.
91
+ #
92
+ # @param id [String] The custom voice ID, e.g. `voice_1234`.
93
+ end
94
+
75
95
  # @!method self.variants
76
- # @return [Array(String, Symbol)]
96
+ # @return [Array(String, Symbol, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice::ID)]
77
97
 
78
98
  define_sorbet_constant!(:Variants) do
79
- T.type_alias { T.any(String, OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::TaggedSymbol) }
99
+ T.type_alias do
100
+ T.any(
101
+ String,
102
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::TaggedSymbol,
103
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::ID
104
+ )
105
+ end
80
106
  end
81
107
 
82
108
  # @!group
@@ -25,10 +25,12 @@ module OpenAI
25
25
  # @!attribute voice
26
26
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
27
27
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
28
- # `cedar`. Voice cannot be changed during the session once the model has responded
29
- # with audio at least once.
28
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
29
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
30
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
31
+ # for best quality.
30
32
  #
31
- # @return [String, Symbol, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice, nil]
33
+ # @return [String, Symbol, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice, nil]
32
34
  optional :voice, union: -> { OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice }
33
35
 
34
36
  # @!method initialize(format_: nil, voice: nil)
@@ -38,12 +40,14 @@ module OpenAI
38
40
  #
39
41
  # @param format_ [OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCM, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMU, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMA] The format of the output audio.
40
42
  #
41
- # @param voice [String, Symbol, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice] The voice the model uses to respond. Supported built-in voices are `alloy`, `ash
43
+ # @param voice [String, Symbol, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice] The voice the model uses to respond. Supported built-in voices are
42
44
 
43
45
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
44
46
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
45
- # `cedar`. Voice cannot be changed during the session once the model has responded
46
- # with audio at least once.
47
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
48
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
49
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
50
+ # for best quality.
47
51
  #
48
52
  # @see OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output#voice
49
53
  module Voice
@@ -71,11 +75,33 @@ module OpenAI
71
75
 
72
76
  variant const: -> { OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::CEDAR }
73
77
 
78
+ # Custom voice reference.
79
+ variant -> { OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID }
80
+
81
+ class ID < OpenAI::Internal::Type::BaseModel
82
+ # @!attribute id
83
+ # The custom voice ID, e.g. `voice_1234`.
84
+ #
85
+ # @return [String]
86
+ required :id, String
87
+
88
+ # @!method initialize(id:)
89
+ # Custom voice reference.
90
+ #
91
+ # @param id [String] The custom voice ID, e.g. `voice_1234`.
92
+ end
93
+
74
94
  # @!method self.variants
75
- # @return [Array(String, Symbol)]
95
+ # @return [Array(String, Symbol, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID)]
76
96
 
77
97
  define_sorbet_constant!(:Variants) do
78
- T.type_alias { T.any(String, OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::TaggedSymbol) }
98
+ T.type_alias do
99
+ T.any(
100
+ String,
101
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::TaggedSymbol,
102
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID
103
+ )
104
+ end
79
105
  end
80
106
 
81
107
  # @!group
@@ -10,13 +10,6 @@ module OpenAI
10
10
  # @return [Symbol, :input_file]
11
11
  required :type, const: :input_file
12
12
 
13
- # @!attribute detail
14
- # The detail level of the file to be sent to the model. One of `high` or `low`.
15
- # Defaults to `high`.
16
- #
17
- # @return [Symbol, OpenAI::Models::Responses::ResponseInputFile::Detail, nil]
18
- optional :detail, enum: -> { OpenAI::Responses::ResponseInputFile::Detail }
19
-
20
13
  # @!attribute file_data
21
14
  # The content of the file to be sent to the model.
22
15
  #
@@ -41,14 +34,12 @@ module OpenAI
41
34
  # @return [String, nil]
42
35
  optional :filename, String
43
36
 
44
- # @!method initialize(detail: nil, file_data: nil, file_id: nil, file_url: nil, filename: nil, type: :input_file)
37
+ # @!method initialize(file_data: nil, file_id: nil, file_url: nil, filename: nil, type: :input_file)
45
38
  # Some parameter documentations has been truncated, see
46
39
  # {OpenAI::Models::Responses::ResponseInputFile} for more details.
47
40
  #
48
41
  # A file input to the model.
49
42
  #
50
- # @param detail [Symbol, OpenAI::Models::Responses::ResponseInputFile::Detail] The detail level of the file to be sent to the model. One of `high` or `low`. De
51
- #
52
43
  # @param file_data [String] The content of the file to be sent to the model.
53
44
  #
54
45
  # @param file_id [String, nil] The ID of the file to be sent to the model.
@@ -58,20 +49,6 @@ module OpenAI
58
49
  # @param filename [String] The name of the file to be sent to the model.
59
50
  #
60
51
  # @param type [Symbol, :input_file] The type of the input item. Always `input_file`.
61
-
62
- # The detail level of the file to be sent to the model. One of `high` or `low`.
63
- # Defaults to `high`.
64
- #
65
- # @see OpenAI::Models::Responses::ResponseInputFile#detail
66
- module Detail
67
- extend OpenAI::Internal::Type::Enum
68
-
69
- LOW = :low
70
- HIGH = :high
71
-
72
- # @!method self.values
73
- # @return [Array<Symbol>]
74
- end
75
52
  end
76
53
  end
77
54
  end
@@ -10,13 +10,6 @@ module OpenAI
10
10
  # @return [Symbol, :input_file]
11
11
  required :type, const: :input_file
12
12
 
13
- # @!attribute detail
14
- # The detail level of the file to be sent to the model. One of `high` or `low`.
15
- # Defaults to `high`.
16
- #
17
- # @return [Symbol, OpenAI::Models::Responses::ResponseInputFileContent::Detail, nil]
18
- optional :detail, enum: -> { OpenAI::Responses::ResponseInputFileContent::Detail }
19
-
20
13
  # @!attribute file_data
21
14
  # The base64-encoded data of the file to be sent to the model.
22
15
  #
@@ -41,14 +34,9 @@ module OpenAI
41
34
  # @return [String, nil]
42
35
  optional :filename, String, nil?: true
43
36
 
44
- # @!method initialize(detail: nil, file_data: nil, file_id: nil, file_url: nil, filename: nil, type: :input_file)
45
- # Some parameter documentations has been truncated, see
46
- # {OpenAI::Models::Responses::ResponseInputFileContent} for more details.
47
- #
37
+ # @!method initialize(file_data: nil, file_id: nil, file_url: nil, filename: nil, type: :input_file)
48
38
  # A file input to the model.
49
39
  #
50
- # @param detail [Symbol, OpenAI::Models::Responses::ResponseInputFileContent::Detail] The detail level of the file to be sent to the model. One of `high` or `low`. De
51
- #
52
40
  # @param file_data [String, nil] The base64-encoded data of the file to be sent to the model.
53
41
  #
54
42
  # @param file_id [String, nil] The ID of the file to be sent to the model.
@@ -58,20 +46,6 @@ module OpenAI
58
46
  # @param filename [String, nil] The name of the file to be sent to the model.
59
47
  #
60
48
  # @param type [Symbol, :input_file] The type of the input item. Always `input_file`.
61
-
62
- # The detail level of the file to be sent to the model. One of `high` or `low`.
63
- # Defaults to `high`.
64
- #
65
- # @see OpenAI::Models::Responses::ResponseInputFileContent#detail
66
- module Detail
67
- extend OpenAI::Internal::Type::Enum
68
-
69
- HIGH = :high
70
- LOW = :low
71
-
72
- # @!method self.values
73
- # @return [Array<Symbol>]
74
- end
75
49
  end
76
50
  end
77
51
  end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ # @see OpenAI::Resources::Videos#create_character
6
+ class VideoCreateCharacterParams < OpenAI::Internal::Type::BaseModel
7
+ extend OpenAI::Internal::Type::RequestParameters::Converter
8
+ include OpenAI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute name
11
+ # Display name for this API character.
12
+ #
13
+ # @return [String]
14
+ required :name, String
15
+
16
+ # @!attribute video
17
+ # Video file used to create a character.
18
+ #
19
+ # @return [Pathname, StringIO, IO, String, OpenAI::FilePart]
20
+ required :video, OpenAI::Internal::Type::FileInput
21
+
22
+ # @!method initialize(name:, video:, request_options: {})
23
+ # @param name [String] Display name for this API character.
24
+ #
25
+ # @param video [Pathname, StringIO, IO, String, OpenAI::FilePart] Video file used to create a character.
26
+ #
27
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ # @see OpenAI::Resources::Videos#create_character
6
+ class VideoCreateCharacterResponse < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # Identifier for the character creation cameo.
9
+ #
10
+ # @return [String, nil]
11
+ required :id, String, nil?: true
12
+
13
+ # @!attribute created_at
14
+ # Unix timestamp (in seconds) when the character was created.
15
+ #
16
+ # @return [Integer]
17
+ required :created_at, Integer
18
+
19
+ # @!attribute name
20
+ # Display name for the character.
21
+ #
22
+ # @return [String, nil]
23
+ required :name, String, nil?: true
24
+
25
+ # @!method initialize(id:, created_at:, name:)
26
+ # @param id [String, nil] Identifier for the character creation cameo.
27
+ #
28
+ # @param created_at [Integer] Unix timestamp (in seconds) when the character was created.
29
+ #
30
+ # @param name [String, nil] Display name for the character.
31
+ end
32
+ end
33
+ end
@@ -14,10 +14,10 @@ module OpenAI
14
14
  required :prompt, String
15
15
 
16
16
  # @!attribute input_reference
17
- # Optional multipart reference asset that guides generation.
17
+ # Optional reference asset upload or reference object that guides generation.
18
18
  #
19
- # @return [Pathname, StringIO, IO, String, OpenAI::FilePart, nil]
20
- optional :input_reference, OpenAI::Internal::Type::FileInput
19
+ # @return [Pathname, StringIO, IO, String, OpenAI::FilePart, OpenAI::Models::ImageInputReferenceParam, nil]
20
+ optional :input_reference, union: -> { OpenAI::VideoCreateParams::InputReference }
21
21
 
22
22
  # @!attribute model
23
23
  # The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults
@@ -45,7 +45,7 @@ module OpenAI
45
45
  #
46
46
  # @param prompt [String] Text prompt that describes the video to generate.
47
47
  #
48
- # @param input_reference [Pathname, StringIO, IO, String, OpenAI::FilePart] Optional multipart reference asset that guides generation.
48
+ # @param input_reference [Pathname, StringIO, IO, String, OpenAI::FilePart, OpenAI::Models::ImageInputReferenceParam] Optional reference asset upload or reference object that guides generation.
49
49
  #
50
50
  # @param model [String, Symbol, OpenAI::Models::VideoModel] The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults
51
51
  #
@@ -54,6 +54,19 @@ module OpenAI
54
54
  # @param size [Symbol, OpenAI::Models::VideoSize] Output resolution formatted as width x height (allowed values: 720x1280, 1280x72
55
55
  #
56
56
  # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
57
+
58
+ # Optional reference asset upload or reference object that guides generation.
59
+ module InputReference
60
+ extend OpenAI::Internal::Type::Union
61
+
62
+ # Optional reference asset upload or reference object that guides generation.
63
+ variant OpenAI::Internal::Type::FileInput
64
+
65
+ variant -> { OpenAI::ImageInputReferenceParam }
66
+
67
+ # @!method self.variants
68
+ # @return [Array(StringIO, OpenAI::Models::ImageInputReferenceParam)]
69
+ end
57
70
  end
58
71
  end
59
72
  end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ # @see OpenAI::Resources::Videos#edit
6
+ class VideoEditParams < OpenAI::Internal::Type::BaseModel
7
+ extend OpenAI::Internal::Type::RequestParameters::Converter
8
+ include OpenAI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute prompt
11
+ # Text prompt that describes how to edit the source video.
12
+ #
13
+ # @return [String]
14
+ required :prompt, String
15
+
16
+ # @!attribute video
17
+ # Reference to the completed video to edit.
18
+ #
19
+ # @return [Pathname, StringIO, IO, String, OpenAI::FilePart, OpenAI::Models::VideoEditParams::Video::VideoReferenceInputParam]
20
+ required :video, union: -> { OpenAI::VideoEditParams::Video }
21
+
22
+ # @!method initialize(prompt:, video:, request_options: {})
23
+ # @param prompt [String] Text prompt that describes how to edit the source video.
24
+ #
25
+ # @param video [Pathname, StringIO, IO, String, OpenAI::FilePart, OpenAI::Models::VideoEditParams::Video::VideoReferenceInputParam] Reference to the completed video to edit.
26
+ #
27
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
28
+
29
+ # Reference to the completed video to edit.
30
+ module Video
31
+ extend OpenAI::Internal::Type::Union
32
+
33
+ # Reference to the completed video to edit.
34
+ variant OpenAI::Internal::Type::FileInput
35
+
36
+ # Reference to the completed video.
37
+ variant -> { OpenAI::VideoEditParams::Video::VideoReferenceInputParam }
38
+
39
+ class VideoReferenceInputParam < OpenAI::Internal::Type::BaseModel
40
+ # @!attribute id
41
+ # The identifier of the completed video.
42
+ #
43
+ # @return [String]
44
+ required :id, String
45
+
46
+ # @!method initialize(id:)
47
+ # Reference to the completed video.
48
+ #
49
+ # @param id [String] The identifier of the completed video.
50
+ end
51
+
52
+ # @!method self.variants
53
+ # @return [Array(StringIO, OpenAI::Models::VideoEditParams::Video::VideoReferenceInputParam)]
54
+ end
55
+ end
56
+ end
57
+ end