OpenAIEndpointTTS
Wisej.AI.Endpoints.OpenAIEndpointTTS
Namespace: Wisej.AI.Endpoints
Assembly: Wisej.AI (3.5.0.0)
Represents an endpoint for connecting to OpenAI's speech services.
public class OpenAIEndpointTTS : SmartHttpEndpoint
This class is designed to interact with OpenAI's text-to-speech (TTS) API, allowing for the conversion of text into speech audio files.
Constructors
OpenAIEndpointTTS()

Initializes a new instance of the OpenAIEndpointTTS class with default settings.
The default model is set to "tts-1", and the voice option is "alloy". The response format is set to "mp3".
Properties
Model

String: Gets or sets the model used for the TTS operation. (Default: "tts-1"
)
URL

String: Gets or sets the URL for the OpenAI TTS API endpoint. (Default: "https://api.openai.com/v1/audio/speech"
)
Methods
AddMessages(payload, session, messages)

Adds user messages to the payload for processing.
Throws:
ArgumentNullException Thrown when session , payload , or messages is null.
ReadAssistantMessage(response, message)

Reads the assistant's message from the response.
Throws:
ArgumentNullException Thrown when response or message is null.
ReadUsage(message, reply)

Reads the usage information from the reply.
This method does not return usage information as it is not applicable for TTS operations.
Last updated