GroqCloudEndpointWhisper
Namespace: Wisej.AI.Endpoints
Assembly: Wisej.AI
Represents a connection to GroqCloud speech endpoints for audio transcription.
- C#
- VB.NET
public class GroqCloudEndpointWhisper : SmartHttpEndpoint
Public Class GroqCloudEndpointWhisper
Inherits SmartHttpEndpoint
This class is used to interact with the GroqCloud API for converting audio inputs into text transcriptions using the Whisper model.
Constructors
GroqCloudEndpointWhisper()
Initializes a new instance of the GroqCloudEndpointWhisper class with default settings.
Sets the default authentication method, model, response format, and API URL.
Properties
Model
String: Gets or sets the model used for audio transcription. (Default: "whisper-large-v3")
URL
String: Gets or sets the URL for the GroqCloud API endpoint. (Default: "https://api.groq.com/openai/v1/audio/transcriptions")
Methods
AddMessages(payload, session, messages)
Adds user messages to the payload for the API request.
| Parameter | Type | Description |
|---|---|---|
| payload | Object | The payload to be sent to the API. |
| session | SmartSession | The current session containing user data. |
| messages | IList<Message> | The list of messages to be processed. |
This method extracts the last user message and adds its binary and text content to the payload.
CreateContent(data)
Creates the HTTP content for the request.
| Parameter | Type | Description |
|---|---|---|
| data | Object | The data to be included in the request. |
Returns: HttpContent. A HttpContent object containing the request data.
This method constructs a multipart form data content from the provided data, supporting both binary and string content.
ReadAssistantMessage(response, message)
Reads the assistant's message from the API response.
| Parameter | Type | Description |
|---|---|---|
| response | Response | The response received from the API. |
| message | Message | The message object to populate with the response data. |
This method parses the response content and updates the message text accordingly.
ReadUsage(message, reply)
Reads the usage information from the API reply.
| Parameter | Type | Description |
|---|---|---|
| message | Message | The message object to update with usage data. |
| reply | Object | The reply data from the API. |
This functionality is not supported in the current implementation.