Class: Telnyx::Models::AI::AudioTranscribeResponse::Segment

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/telnyx/models/ai/audio_transcribe_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, 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, #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(text:, duration: nil, segments: nil, words: nil) ⇒ Object

Some parameter documentations has been truncated, see Telnyx::Models::AI::AudioTranscribeResponse for more details.

Response fields vary by model. ‘distil-whisper/distil-large-v2` returns `text`, `duration`, and `segments` in `verbose_json` mode. `openai/whisper-large-v3-turbo` returns `text` only. `deepgram/nova-3` returns `text` and, depending on `model_config`, may include `words` with per-word timestamps and speaker labels.

Parameters:

  • text (String)

    The transcribed text for the audio file.

  • duration (Float) (defaults to: nil)

    The duration of the audio file in seconds. Returned by ‘distil-whisper/distil-la

  • segments (Array<Telnyx::Models::AI::AudioTranscribeResponse::Segment>) (defaults to: nil)

    Segments of the transcribed text and their corresponding details. Returned by ‘d

  • words (Array<Telnyx::Models::AI::AudioTranscribeResponse::Word>) (defaults to: nil)

    Word-level timestamps and optional speaker labels. Only returned by ‘deepgram/no



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/telnyx/models/ai/audio_transcribe_response.rb', line 56

class Segment < Telnyx::Internal::Type::BaseModel
  # @!attribute id
  #   Unique identifier of the segment.
  #
  #   @return [Float]
  required :id, Float

  # @!attribute end_
  #   End time of the segment in seconds.
  #
  #   @return [Float]
  required :end_, Float, api_name: :end

  # @!attribute start
  #   Start time of the segment in seconds.
  #
  #   @return [Float]
  required :start, Float

  # @!attribute text
  #   Text content of the segment.
  #
  #   @return [String]
  required :text, String

  # @!method initialize(id:, end_:, start:, text:)
  #   @param id [Float] Unique identifier of the segment.
  #
  #   @param end_ [Float] End time of the segment in seconds.
  #
  #   @param start [Float] Start time of the segment in seconds.
  #
  #   @param text [String] Text content of the segment.
end

Instance Attribute Details

#end_Float

End time of the segment in seconds.

Returns:

  • (Float)


67
# File 'lib/telnyx/models/ai/audio_transcribe_response.rb', line 67

required :end_, Float, api_name: :end

#idFloat

Unique identifier of the segment.

Returns:

  • (Float)


61
# File 'lib/telnyx/models/ai/audio_transcribe_response.rb', line 61

required :id, Float

#startFloat

Start time of the segment in seconds.

Returns:

  • (Float)


73
# File 'lib/telnyx/models/ai/audio_transcribe_response.rb', line 73

required :start, Float

#textString

Text content of the segment.

Returns:

  • (String)


79
# File 'lib/telnyx/models/ai/audio_transcribe_response.rb', line 79

required :text, String