Skip to main content

Module speech

Module speech 

Source
Expand description

Generates audio from the input text.

Endpoint: POST /audio/speech (JSON request / binary response). The response body is the raw audio bytes in the requested format.

Streaming audio is supported through the optional stream_format parameter: when set, send the request via PostBinary::get_stream_response_bytes to receive the response as a stream of raw byte chunks (for stream_format = "sse" the server-sent-event frames are carried inside those bytes; parsing them is left to the caller).

![warn] This module is untested! No OpenAI-compatible provider accessible to this project implements this endpoint, and no OpenAI API key was available for testing. If you encounter any issues, please report them on the repository.

Structs§

SpeechRequest
Generates audio from the input text.

Enums§

SpeechFormat
The format of the generated audio.
SpeechStreamFormat
The format to stream generated audio in.
SpeechVoice
The voice to use when generating audio.