transcribeAudio method

Future<(GroqAudioResponse, GroqRateLimitInformation)> transcribeAudio({
  1. required String audioFileUrl,
  2. required String modelId,
  3. String? customApiKey,
  4. Map<String, String> optionalParameters = const {},
})

Transcribes the audio file at the given audioFileUrl, max 25Mb
It uses the model with the given modelId
customApiKey is the API key to use for the transcription, defaults to the Groq instance API key
Returns the transcribed audio response, the usage of the groq resources and the rate limit information
Example:

final (response, rateLimit) = await groq.transcribeAudio(
 audioFileUrl: 'YOUR_DIRECTORY/audio.mp3',
 modelId: whisper_large_v3,
 customApiKey: 'EXAMPLE_API_KEY',
);

Supported file formats: mp3, mp4, mpeg, mpga, m4a, wav, and webm. \

Implementation

Future<(GroqAudioResponse, GroqRateLimitInformation)> transcribeAudio({
  required String audioFileUrl,
  required String modelId,
  String? customApiKey,
  Map<String, String> optionalParameters = const {},
}) async {
  final specificApiKey = customApiKey ?? apiKey;
  return await GroqApi.transcribeAudio(
    filePath: audioFileUrl,
    modelId: modelId,
    apiKey: specificApiKey,
    optionalParameters: optionalParameters,
  );
}