Class: OpenAI::Models::Audio::TranslationVerbose

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

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

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_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, 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(duration:, language:, text:, segments: nil) ⇒ TranslationVerbose

Returns a new instance of TranslationVerbose.

Parameters:

  • duration —

    The duration of the input audio.

  • language —

    The language of the output translation (always english).

  • text —

    The translated text.

  • segments (defaults to: nil) —

    Segments of the translated text and their corresponding details.

  • duration: (Float)
  • language: (String)
  • text: (String)
  • segments: (::Array[OpenAI::Audio::TranscriptionSegment]) (defaults to: nil)


# File 'lib/openai/models/audio/translation_verbose.rb', line 31

Instance Attribute Details

#duration ⇒ Float

The duration of the input audio.

Returns:

  • (Float)


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

required :duration, Float

#language ⇒ String

The language of the output translation (always english).

Returns:

  • (String)


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

required :language, String

#segments ⇒ ::Array[OpenAI::Audio::TranscriptionSegment]?

Segments of the translated text and their corresponding details.

Returns:

  • (::Array[OpenAI::Audio::TranscriptionSegment], nil)


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

optional :segments, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Audio::TranscriptionSegment] }

#text ⇒ String

The translated text.

Returns:

  • (String)


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

required :text, String

Instance Method Details

#to_hash ⇒ { duration: Float, language: String, text: String, ?segments: ::Array[OpenAI::Audio::TranscriptionSegment] }

Returns:

  • ({ duration: Float, language: String, text: String, ?segments: ::Array[OpenAI::Audio::TranscriptionSegment] })


45
46
47
48
49
50
# File 'sig/openai/models/audio/translation_verbose.rbs', line 45

def to_hash: -> {
  duration: Float,
  language: String,
  text: String,
  ?segments: ::Array[OpenAI::Audio::TranscriptionSegment]
}