Class: OpenAI::Models::Video

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/video.rb,
sig/openai/models/video.rbs

Overview

See Also:

  • OpenAI::Resources::Videos#create

Defined Under Namespace

Modules: Seconds, Status

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, #inspect, inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, coerce_with_error, dump, #dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id:, completed_at:, created_at:, error:, expires_at:, model:, progress:, prompt:, remixed_from_video_id:, seconds:, size:, status:, object: :video) ⇒ Object

Parameters:

  • id

    Unique identifier for the video job.

  • completed_at

    Unix timestamp (seconds) for when the job completed, if finished.

  • created_at

    Unix timestamp (seconds) for when the job was created.

  • error

    Error payload that explains why generation failed, if applicable.

  • expires_at

    Unix timestamp (seconds) for when the downloadable assets expire, if set.

  • model

    The video generation model that produced the job.

  • progress

    Approximate completion percentage for the generation task.

  • prompt

    The prompt that was used to generate the video.

  • remixed_from_video_id

    Identifier of the source video if this video is a remix.

  • seconds

    Duration of the generated clip in seconds. For extensions, this is the stitched total duration.

  • size

    The resolution of the generated video.

  • status

    Current lifecycle status of the video job.

  • object (defaults to: :video)

    The object type, which is always video.



# File 'lib/openai/models/video.rb', line 86

Instance Attribute Details

#completed_atInteger?

Unix timestamp (seconds) for when the job completed, if finished.

Returns:

  • (Integer, nil)


17
# File 'lib/openai/models/video.rb', line 17

required :completed_at, Integer, nil?: true

#created_atInteger

Unix timestamp (seconds) for when the job was created.

Returns:

  • (Integer)


23
# File 'lib/openai/models/video.rb', line 23

required :created_at, Integer

#errorOpenAI::VideoCreateError?

Error payload that explains why generation failed, if applicable.

Returns:



29
# File 'lib/openai/models/video.rb', line 29

required :error, -> { OpenAI::VideoCreateError }, nil?: true

#expires_atInteger?

Unix timestamp (seconds) for when the downloadable assets expire, if set.

Returns:

  • (Integer, nil)


35
# File 'lib/openai/models/video.rb', line 35

required :expires_at, Integer, nil?: true

#idString

Unique identifier for the video job.

Returns:

  • (String)


11
# File 'lib/openai/models/video.rb', line 11

required :id, String

#modelOpenAI::Models::video_model

The video generation model that produced the job.

Returns:

  • (OpenAI::Models::video_model)


41
# File 'lib/openai/models/video.rb', line 41

required :model, union: -> { OpenAI::VideoModel }

#object:video

The object type, which is always video.

Returns:

  • (:video)


47
# File 'lib/openai/models/video.rb', line 47

required :object, const: :video

#progressInteger

Approximate completion percentage for the generation task.

Returns:

  • (Integer)


53
# File 'lib/openai/models/video.rb', line 53

required :progress, Integer

#promptString?

The prompt that was used to generate the video.

Returns:

  • (String, nil)


59
# File 'lib/openai/models/video.rb', line 59

required :prompt, String, nil?: true

#remixed_from_video_idString?

Identifier of the source video if this video is a remix.

Returns:

  • (String, nil)


65
# File 'lib/openai/models/video.rb', line 65

required :remixed_from_video_id, String, nil?: true

#secondsOpenAI::Models::Video::seconds

Duration of the generated clip in seconds. For extensions, this is the stitched total duration.

Returns:

  • (OpenAI::Models::Video::seconds)


72
# File 'lib/openai/models/video.rb', line 72

required :seconds, union: -> { OpenAI::Video::Seconds }

#sizeOpenAI::Models::video_size

The resolution of the generated video.

Returns:

  • (OpenAI::Models::video_size)


78
# File 'lib/openai/models/video.rb', line 78

required :size, enum: -> { OpenAI::VideoSize }

#statusOpenAI::Models::Video::status

Current lifecycle status of the video job.

Returns:

  • (OpenAI::Models::Video::status)


84
# File 'lib/openai/models/video.rb', line 84

required :status, enum: -> { OpenAI::Video::Status }

Class Method Details

.variantsArray(String, Symbol, OpenAI::Models::VideoSeconds)

Returns:



# File 'lib/openai/models/video.rb', line 141

Instance Method Details

#to_hash{

Returns:

  • ({)


104
# File 'sig/openai/models/video.rbs', line 104

def to_hash: -> {