GroqCloudEndpointWhisper

Wisej.AI.Endpoints.GroqCloudEndpointWhisper

Namespace: Wisej.AI.Endpoints

Assembly: Wisej.AI (3.5.0.0)

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.

Parameter
Type
Description

payload

The payload to be sent to the API.

session

The current session containing user data.

messages

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

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

The response received from the API.

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

The message object to update with usage data.

reply

The reply data from the API.

This functionality is not supported in the current implementation.

Last updated