Package-level declarations

Types

Link copied to clipboard
@Serializable
value class AudioResponseFormat(val value: String)
Link copied to clipboard
@Serializable
data class Segment(    val id: Int,     val seek: Int,     val start: Double,     val end: Double,     val text: String,     val tokens: List<Int>,     val temperature: Double,     val avgLogprob: Double,     val compressionRatio: Double,     val noSpeechProb: Double,     val transient: Boolean? = null)
Link copied to clipboard
@Serializable
data class SpeechRequest(    val model: ModelId,     val input: String,     val voice: Voice? = null,     val responseFormat: SpeechResponseFormat? = null,     val speed: Double? = null)

Generates audio from the input text.

Link copied to clipboard

A speech request builder.

Link copied to clipboard
@Serializable
value class SpeechResponseFormat(val value: String)
Link copied to clipboard
@Serializable
value class TimestampGranularity(val value: String)
Link copied to clipboard
@Serializable
data class Transcription(    val text: String,     val language: String? = null,     val duration: Double? = null,     val segments: List<Segment>? = null,     val words: List<Word>? = null)

Create transcription response.

Link copied to clipboard
class TranscriptionRequest(    val audio: FileSource,     val model: ModelId,     val prompt: String? = null,     val responseFormat: AudioResponseFormat? = null,     val temperature: Double? = null,     val language: String? = null,     val timestampGranularities: List<TimestampGranularity>? = null)

Request to transcribe audio into the input language.

Link copied to clipboard
@Serializable
data class Translation(val text: String, val language: String? = null, val duration: Double? = null, val segments: List<Segment>? = null)

Create translation response.

Link copied to clipboard
class TranslationRequest(    val audio: FileSource,     val model: ModelId,     val prompt: String? = null,     val responseFormat: String? = null,     val temperature: Double? = null)

Request to translate an audio into english.

Link copied to clipboard
Link copied to clipboard
@Serializable
value class Voice(val value: String)

The voice to use when generating the audio

Link copied to clipboard
@Serializable
data class Word(val word: String, val start: Double, val end: Double)

Functions

Link copied to clipboard

Creates a new SpeechRequest instance.

Link copied to clipboard

Creates a transcription request.

Link copied to clipboard

Creates a translation request.