Skip to main content

GroqCloudEndpointWhisper

Namespace: Wisej.AI.Endpoints

Assembly: Wisej.AI

Represents a connection to GroqCloud speech endpoints for audio transcription.

public class GroqCloudEndpointWhisper : 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.

ParameterTypeDescription
payloadObjectThe payload to be sent to the API.
sessionSmartSessionThe current session containing user data.
messagesIList<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.

ParameterTypeDescription
dataObjectThe 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.

ParameterTypeDescription
responseResponseThe response received from the API.
messageMessageThe 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.

ParameterTypeDescription
messageMessageThe message object to update with usage data.
replyObjectThe reply data from the API.

This functionality is not supported in the current implementation.