View Source ExOpenAi.Audio.Transcription (ex_open_ai v2.0.1)

Represents a transcription request to the OpenAI API.

notes

Notes

The file must be a local file path, as URLs are not currently supported. If you need to transcribe audio from a URL, you will need to implement that functionality yourself.

On large bodies of text it can really take a while to process. Its recommended to stream to a process to save or play the file.

examples

Examples

iex> params = %{
...>   model: "whisper-1",
...>   file: "path/to/some_file.mp3"
...> }
iex> ExOpenAi.Audio.Transcription.create(params)
{:ok, %ExOpenAi.Audio.Transcription{...}}

iex> ExOpenAi.Audio.Transcription.create(%{})
{:error, %{}}

Link to this section Summary

Link to this section Types

@type t() :: %ExOpenAi.Audio.Transcription{
  duration: float(),
  language: String.t(),
  segments: list(),
  text: String.t(),
  words: list()
}

Link to this section Functions

Link to this function

create_with_file(data, file_key, options \\ [])

View Source
@spec create_with_file(ExOpenAi.Api.data(), atom(), list()) ::
  ExOpenAi.Parser.parsed_response()
@spec do_new(
  %ExOpenAi.Audio.Transcription{
    duration: term(),
    language: term(),
    segments: term(),
    text: term(),
    words: term()
  },
  attributes :: list()
) :: %ExOpenAi.Audio.Transcription{
  duration: term(),
  language: term(),
  segments: term(),
  text: term(),
  words: term()
}
Link to this function

keep_it_simple(response, _)

View Source
@spec new() :: %ExOpenAi.Audio.Transcription{
  duration: term(),
  language: term(),
  segments: term(),
  text: term(),
  words: term()
}
@spec new(attributes :: list()) :: %ExOpenAi.Audio.Transcription{
  duration: term(),
  language: term(),
  segments: term(),
  text: term(),
  words: term()
}