LocalAIEndpointTTS
Namespace: Wisej.AI.Endpoints
Assembly: Wisej.AI
Represents an endpoint for connecting to LocalAI's speech services.
- C#
- VB.NET
public class LocalAIEndpointTTS : SmartHttpEndpoint
Public Class LocalAIEndpointTTS
Inherits SmartHttpEndpoint
This class is designed to interact with LocalAI's text-to-speech (TTS) API, allowing for the conversion of text into speech audio files.
Constructors
LocalAIEndpointTTS()
Initializes a new instance of the LocalAIEndpointTTS 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 LocalAI TTS API endpoint. (Default: "http://localhost:8080/v1/audio/speech")
Methods
AddMessages(payload, session, messages)
Adds user messages to the payload for processing.
| Parameter | Type | Description |
|---|---|---|
| payload | Object | The dynamic payload object to be sent to the API. |
| session | SmartSession | The current session containing user context. |
| messages | IList<Message> | A list of messages to be processed. |
Throws:
- ArgumentNullException Thrown when session , payload , or messages is null.
ReadAssistantMessage(response, message)
Reads the assistant's message from the response.
| Parameter | Type | Description |
|---|---|---|
| response | Response | The response received from the API. |
| message | Message | The message object to populate with the response data. |
Throws:
- ArgumentNullException Thrown when response or message is null.
ReadUsage(message, reply)
Reads the usage information from the reply.
| Parameter | Type | Description |
|---|---|---|
| message | Message | The message object to populate with usage data. |
| reply | Object | The dynamic reply object containing usage information. |
This method does not return usage information as it is not applicable for TTS operations.