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

Link to this function

create(data, options \\ [])

View Source
@spec do_new(%ExOpenAi.Audio.Speech{output: term()}, attributes :: list()) ::
  %ExOpenAi.Audio.Speech{
    output: term()
  }
@spec new() :: %ExOpenAi.Audio.Speech{output: term()}
@spec new(attributes :: list()) :: %ExOpenAi.Audio.Speech{output: term()}