struct AI::OpenAI::OpenAITranscriptionResponse

Overview

Response from OpenAI transcription API.

Included Modules

Defined in:

ai/openai/transcription/openai_transcription_api.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(text : String, language : String | Nil = nil, duration : Float64 | Nil = nil, words : Array(OpenAITranscriptionWord) | Nil = nil, segments : Array(OpenAITranscriptionSegment) | Nil = nil) #

[View source]
def self.new(*, __pull_for_json_serializable pull : JSON::PullParser) #

[View source]

Instance Method Detail

def duration : Float64 | Nil #

The duration of the audio in seconds.


[View source]
def language : String | Nil #

The detected language of the audio (full name, e.g., "english").


[View source]
def segments : Array(OpenAITranscriptionSegment) | Nil #

Segment-level timing information (when timestamp_granularities includes "segment").


[View source]
def text : String #

The transcribed text.


[View source]
def words : Array(OpenAITranscriptionWord) | Nil #

Word-level timing information (when timestamp_granularities includes "word").


[View source]