openai 0.53.0 → 0.54.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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/image_input_reference_param.rb +23 -0
  5. data/lib/openai/models/responses/response_input_file.rb +1 -24
  6. data/lib/openai/models/responses/response_input_file_content.rb +1 -27
  7. data/lib/openai/models/video_create_character_params.rb +30 -0
  8. data/lib/openai/models/video_create_character_response.rb +33 -0
  9. data/lib/openai/models/video_create_params.rb +17 -4
  10. data/lib/openai/models/video_edit_params.rb +57 -0
  11. data/lib/openai/models/video_extend_params.rb +69 -0
  12. data/lib/openai/models/video_get_character_params.rb +20 -0
  13. data/lib/openai/models/video_get_character_response.rb +33 -0
  14. data/lib/openai/models.rb +10 -0
  15. data/lib/openai/resources/videos.rb +102 -1
  16. data/lib/openai/version.rb +1 -1
  17. data/lib/openai.rb +7 -0
  18. data/rbi/openai/client.rbi +6 -0
  19. data/rbi/openai/models/image_input_reference_param.rbi +39 -0
  20. data/rbi/openai/models/responses/response_input_file.rbi +0 -54
  21. data/rbi/openai/models/responses/response_input_file_content.rbi +0 -59
  22. data/rbi/openai/models/video_create_character_params.rbi +51 -0
  23. data/rbi/openai/models/video_create_character_response.rbi +56 -0
  24. data/rbi/openai/models/video_create_params.rbi +44 -6
  25. data/rbi/openai/models/video_edit_params.rbi +111 -0
  26. data/rbi/openai/models/video_extend_params.rbi +121 -0
  27. data/rbi/openai/models/video_get_character_params.rbi +35 -0
  28. data/rbi/openai/models/video_get_character_response.rbi +56 -0
  29. data/rbi/openai/models.rbi +10 -0
  30. data/rbi/openai/resources/videos.rbi +84 -2
  31. data/sig/openai/client.rbs +3 -0
  32. data/sig/openai/models/image_input_reference_param.rbs +19 -0
  33. data/sig/openai/models/responses/response_input_file.rbs +0 -20
  34. data/sig/openai/models/responses/response_input_file_content.rbs +0 -20
  35. data/sig/openai/models/video_create_character_params.rbs +28 -0
  36. data/sig/openai/models/video_create_character_response.rbs +18 -0
  37. data/sig/openai/models/video_create_params.rbs +15 -6
  38. data/sig/openai/models/video_edit_params.rbs +48 -0
  39. data/sig/openai/models/video_extend_params.rbs +56 -0
  40. data/sig/openai/models/video_get_character_params.rbs +23 -0
  41. data/sig/openai/models/video_get_character_response.rbs +18 -0
  42. data/sig/openai/models.rbs +10 -0
  43. data/sig/openai/resources/videos.rbs +25 -1
  44. 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: 83d02aadc8a7e6f7b37049c3d9f4aeaea7431550be5d59b39125caac69dc0b8d
4
+ data.tar.gz: 65952c4730694ec1d6d8e94975574830caaa4b00af59102004c22193eeddd084
5
5
  SHA512:
6
- metadata.gz: 8d8d216165e0f85bafb298a5ea2aee7938a07a44258b2f2521f8dec6ef7319b4a6026c2aa4989ad99f3aa3b9dd712f42984103d8b78a092483d0bff175b04168
7
- data.tar.gz: aa9d16013208f0c29398f428f9af76f29da7307be8fe15389879748fbc8fc2d379a7adf4eac3a4933aa3d8de9c13c8ed6c1f99b1699b7e95d0b7ecad002879be
6
+ metadata.gz: 0cdf744110926dcc10a24efcb6d945f23da0390a72827434ab6b0cd9308e1e5a9f64e6d7f8d304c206c146caf10fc8d06c242c3f6447ed7d052bb60f302f905a
7
+ data.tar.gz: 5cc663414eead8566eaefb21714a5fad8e1bbaa5ed5f8b297d4af45909b4cc0ea34d96fa273cc85e587f4fa41cc263b0c5b88db67e4c22e24a10cbb48822165b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.54.0 (2026-03-13)
4
+
5
+ Full Changelog: [v0.53.0...v0.54.0](https://github.com/openai/openai-ruby/compare/v0.53.0...v0.54.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([235124c](https://github.com/openai/openai-ruby/commit/235124c18886d02e2373c8075354cd19cf928a1d))
10
+ * **api:** manual updates ([d1ee93f](https://github.com/openai/openai-ruby/commit/d1ee93fd53b18ba7a6c38d75ecac9ab6b6eade9f))
11
+ * **api:** manual updates ([8f13ded](https://github.com/openai/openai-ruby/commit/8f13ded017186651bbfaf679e429d7436183f8c0))
12
+ * **api:** sora api improvements: character api, video extensions/edits, higher resolution exports. ([58a8c4d](https://github.com/openai/openai-ruby/commit/58a8c4d13897c6be6735e5255e4e7308c9a7cc44))
13
+ * **client:** add webhook support ([3a2425f](https://github.com/openai/openai-ruby/commit/3a2425ff3ac8cfb883e38e56c1c76585ce6a8ab5))
14
+
15
+
16
+ ### Chores
17
+
18
+ * **internal:** codegen related update ([2100fc4](https://github.com/openai/openai-ruby/commit/2100fc4105da779d09e15723c9ad22eb7a6ad307))
19
+
3
20
  ## 0.53.0 (2026-03-05)
4
21
 
5
22
  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.54.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -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
@@ -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
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ # @see OpenAI::Resources::Videos#extend_
6
+ class VideoExtendParams < OpenAI::Internal::Type::BaseModel
7
+ extend OpenAI::Internal::Type::RequestParameters::Converter
8
+ include OpenAI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute prompt
11
+ # Updated text prompt that directs the extension generation.
12
+ #
13
+ # @return [String]
14
+ required :prompt, String
15
+
16
+ # @!attribute seconds
17
+ # Length of the newly generated extension segment in seconds (allowed values: 4,
18
+ # 8, 12, 16, 20).
19
+ #
20
+ # @return [Symbol, OpenAI::Models::VideoSeconds]
21
+ required :seconds, enum: -> { OpenAI::VideoSeconds }
22
+
23
+ # @!attribute video
24
+ # Reference to the completed video to extend.
25
+ #
26
+ # @return [Pathname, StringIO, IO, String, OpenAI::FilePart, OpenAI::Models::VideoExtendParams::Video::VideoReferenceInputParam]
27
+ required :video, union: -> { OpenAI::VideoExtendParams::Video }
28
+
29
+ # @!method initialize(prompt:, seconds:, video:, request_options: {})
30
+ # Some parameter documentations has been truncated, see
31
+ # {OpenAI::Models::VideoExtendParams} for more details.
32
+ #
33
+ # @param prompt [String] Updated text prompt that directs the extension generation.
34
+ #
35
+ # @param seconds [Symbol, OpenAI::Models::VideoSeconds] Length of the newly generated extension segment in seconds (allowed values: 4, 8
36
+ #
37
+ # @param video [Pathname, StringIO, IO, String, OpenAI::FilePart, OpenAI::Models::VideoExtendParams::Video::VideoReferenceInputParam] Reference to the completed video to extend.
38
+ #
39
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
40
+
41
+ # Reference to the completed video to extend.
42
+ module Video
43
+ extend OpenAI::Internal::Type::Union
44
+
45
+ # Reference to the completed video to extend.
46
+ variant OpenAI::Internal::Type::FileInput
47
+
48
+ # Reference to the completed video.
49
+ variant -> { OpenAI::VideoExtendParams::Video::VideoReferenceInputParam }
50
+
51
+ class VideoReferenceInputParam < OpenAI::Internal::Type::BaseModel
52
+ # @!attribute id
53
+ # The identifier of the completed video.
54
+ #
55
+ # @return [String]
56
+ required :id, String
57
+
58
+ # @!method initialize(id:)
59
+ # Reference to the completed video.
60
+ #
61
+ # @param id [String] The identifier of the completed video.
62
+ end
63
+
64
+ # @!method self.variants
65
+ # @return [Array(StringIO, OpenAI::Models::VideoExtendParams::Video::VideoReferenceInputParam)]
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ # @see OpenAI::Resources::Videos#get_character
6
+ class VideoGetCharacterParams < OpenAI::Internal::Type::BaseModel
7
+ extend OpenAI::Internal::Type::RequestParameters::Converter
8
+ include OpenAI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute character_id
11
+ #
12
+ # @return [String]
13
+ required :character_id, String
14
+
15
+ # @!method initialize(character_id:, request_options: {})
16
+ # @param character_id [String]
17
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ # @see OpenAI::Resources::Videos#get_character
6
+ class VideoGetCharacterResponse < 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
data/lib/openai/models.rb CHANGED
@@ -176,6 +176,8 @@ module OpenAI
176
176
 
177
177
  ImageGenStreamEvent = OpenAI::Models::ImageGenStreamEvent
178
178
 
179
+ ImageInputReferenceParam = OpenAI::Models::ImageInputReferenceParam
180
+
179
181
  ImageModel = OpenAI::Models::ImageModel
180
182
 
181
183
  ImagesResponse = OpenAI::Models::ImagesResponse
@@ -279,6 +281,8 @@ module OpenAI
279
281
 
280
282
  Video = OpenAI::Models::Video
281
283
 
284
+ VideoCreateCharacterParams = OpenAI::Models::VideoCreateCharacterParams
285
+
282
286
  VideoCreateError = OpenAI::Models::VideoCreateError
283
287
 
284
288
  VideoCreateParams = OpenAI::Models::VideoCreateParams
@@ -287,6 +291,12 @@ module OpenAI
287
291
 
288
292
  VideoDownloadContentParams = OpenAI::Models::VideoDownloadContentParams
289
293
 
294
+ VideoEditParams = OpenAI::Models::VideoEditParams
295
+
296
+ VideoExtendParams = OpenAI::Models::VideoExtendParams
297
+
298
+ VideoGetCharacterParams = OpenAI::Models::VideoGetCharacterParams
299
+
290
300
  VideoListParams = OpenAI::Models::VideoListParams
291
301
 
292
302
  VideoModel = OpenAI::Models::VideoModel
@@ -12,7 +12,7 @@ module OpenAI
12
12
  #
13
13
  # @param prompt [String] Text prompt that describes the video to generate.
14
14
  #
15
- # @param input_reference [Pathname, StringIO, IO, String, OpenAI::FilePart] Optional multipart reference asset that guides generation.
15
+ # @param input_reference [Pathname, StringIO, IO, String, OpenAI::FilePart, OpenAI::Models::ImageInputReferenceParam] Optional reference asset upload or reference object that guides generation.
16
16
  #
17
17
  # @param model [String, Symbol, OpenAI::Models::VideoModel] The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults
18
18
  #
@@ -108,6 +108,31 @@ module OpenAI
108
108
  )
109
109
  end
110
110
 
111
+ # Create a character from an uploaded video.
112
+ #
113
+ # @overload create_character(name:, video:, request_options: {})
114
+ #
115
+ # @param name [String] Display name for this API character.
116
+ #
117
+ # @param video [Pathname, StringIO, IO, String, OpenAI::FilePart] Video file used to create a character.
118
+ #
119
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
120
+ #
121
+ # @return [OpenAI::Models::VideoCreateCharacterResponse]
122
+ #
123
+ # @see OpenAI::Models::VideoCreateCharacterParams
124
+ def create_character(params)
125
+ parsed, options = OpenAI::VideoCreateCharacterParams.dump_request(params)
126
+ @client.request(
127
+ method: :post,
128
+ path: "videos/characters",
129
+ headers: {"content-type" => "multipart/form-data"},
130
+ body: parsed,
131
+ model: OpenAI::Models::VideoCreateCharacterResponse,
132
+ options: options
133
+ )
134
+ end
135
+
111
136
  # Download the generated video bytes or a derived preview asset.
112
137
  #
113
138
  # Streams the rendered video content for the specified video job.
@@ -136,6 +161,82 @@ module OpenAI
136
161
  )
137
162
  end
138
163
 
164
+ # Create a new video generation job by editing a source video or existing
165
+ # generated video.
166
+ #
167
+ # @overload edit(prompt:, video:, request_options: {})
168
+ #
169
+ # @param prompt [String] Text prompt that describes how to edit the source video.
170
+ #
171
+ # @param video [Pathname, StringIO, IO, String, OpenAI::FilePart, OpenAI::Models::VideoEditParams::Video::VideoReferenceInputParam] Reference to the completed video to edit.
172
+ #
173
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
174
+ #
175
+ # @return [OpenAI::Models::Video]
176
+ #
177
+ # @see OpenAI::Models::VideoEditParams
178
+ def edit(params)
179
+ parsed, options = OpenAI::VideoEditParams.dump_request(params)
180
+ @client.request(
181
+ method: :post,
182
+ path: "videos/edits",
183
+ headers: {"content-type" => "multipart/form-data"},
184
+ body: parsed,
185
+ model: OpenAI::Video,
186
+ options: options
187
+ )
188
+ end
189
+
190
+ # Some parameter documentations has been truncated, see
191
+ # {OpenAI::Models::VideoExtendParams} for more details.
192
+ #
193
+ # Create an extension of a completed video.
194
+ #
195
+ # @overload extend_(prompt:, seconds:, video:, request_options: {})
196
+ #
197
+ # @param prompt [String] Updated text prompt that directs the extension generation.
198
+ #
199
+ # @param seconds [Symbol, OpenAI::Models::VideoSeconds] Length of the newly generated extension segment in seconds (allowed values: 4, 8
200
+ #
201
+ # @param video [Pathname, StringIO, IO, String, OpenAI::FilePart, OpenAI::Models::VideoExtendParams::Video::VideoReferenceInputParam] Reference to the completed video to extend.
202
+ #
203
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
204
+ #
205
+ # @return [OpenAI::Models::Video]
206
+ #
207
+ # @see OpenAI::Models::VideoExtendParams
208
+ def extend_(params)
209
+ parsed, options = OpenAI::VideoExtendParams.dump_request(params)
210
+ @client.request(
211
+ method: :post,
212
+ path: "videos/extensions",
213
+ headers: {"content-type" => "multipart/form-data"},
214
+ body: parsed,
215
+ model: OpenAI::Video,
216
+ options: options
217
+ )
218
+ end
219
+
220
+ # Fetch a character.
221
+ #
222
+ # @overload get_character(character_id, request_options: {})
223
+ #
224
+ # @param character_id [String] The identifier of the character to retrieve.
225
+ #
226
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
227
+ #
228
+ # @return [OpenAI::Models::VideoGetCharacterResponse]
229
+ #
230
+ # @see OpenAI::Models::VideoGetCharacterParams
231
+ def get_character(character_id, params = {})
232
+ @client.request(
233
+ method: :get,
234
+ path: ["videos/characters/%1$s", character_id],
235
+ model: OpenAI::Models::VideoGetCharacterResponse,
236
+ options: params[:request_options]
237
+ )
238
+ end
239
+
139
240
  # Create a remix of a completed video using a refreshed prompt.
140
241
  #
141
242
  # @overload remix(video_id, prompt:, request_options: {})
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenAI
4
- VERSION = "0.53.0"
4
+ VERSION = "0.54.0"
5
5
  end
data/lib/openai.rb CHANGED
@@ -403,6 +403,7 @@ require_relative "openai/models/image_gen_completed_event"
403
403
  require_relative "openai/models/image_generate_params"
404
404
  require_relative "openai/models/image_gen_partial_image_event"
405
405
  require_relative "openai/models/image_gen_stream_event"
406
+ require_relative "openai/models/image_input_reference_param"
406
407
  require_relative "openai/models/image_model"
407
408
  require_relative "openai/models/images_response"
408
409
  require_relative "openai/models/metadata"
@@ -733,11 +734,17 @@ require_relative "openai/models/vector_store_search_params"
733
734
  require_relative "openai/models/vector_store_search_response"
734
735
  require_relative "openai/models/vector_store_update_params"
735
736
  require_relative "openai/models/video"
737
+ require_relative "openai/models/video_create_character_params"
738
+ require_relative "openai/models/video_create_character_response"
736
739
  require_relative "openai/models/video_create_error"
737
740
  require_relative "openai/models/video_create_params"
738
741
  require_relative "openai/models/video_delete_params"
739
742
  require_relative "openai/models/video_delete_response"
740
743
  require_relative "openai/models/video_download_content_params"
744
+ require_relative "openai/models/video_edit_params"
745
+ require_relative "openai/models/video_extend_params"
746
+ require_relative "openai/models/video_get_character_params"
747
+ require_relative "openai/models/video_get_character_response"
741
748
  require_relative "openai/models/video_list_params"
742
749
  require_relative "openai/models/video_model"
743
750
  require_relative "openai/models/video_remix_params"