View Source ExOpenAi.Audio.Speech (ex_open_ai v2.0.1)
Represents a TTS request to the OpenAI API.
examples
Examples
iex> params = %{
...> model: "tts-1",
...> input: "There was an old man named Michael Finnigan",
...> response_format: "mp3", / default is mp3
...> voice: "alloy"
...> }
iex> ExOpenAi.Audio.Speech.create(params)
{:ok, %ExOpenAi.Audio.Speech{...}}
iex> ExOpenAi.Audio.Speech.create(%{})
{:error, %{}}
Link to this section Summary
Link to this section Types
@type t() :: %ExOpenAi.Audio.Speech{output: binary()}
Link to this section Functions
@spec create(ExOpenAi.Api.data(), list()) :: ExOpenAi.Parser.parsed_response()
@spec new() :: %ExOpenAi.Audio.Speech{output: term()}