translateAudio method

Future<(GroqAudioResponse, GroqRateLimitInformation)> translateAudio({
  1. required String audioFileUrl,
  2. required String modelId,
  3. String? customApiKey,
  4. double temperature = 0.5,
})

Translates the audio file at the given audioFileUrl to ENGLISH, max 25Mb
It uses the model with the given modelId
customApiKey is the API key to use for the translation, defaults to the Groq instance API key
temperature is the randomness of the translation, defaults to 0.5
Returns the translated audio response, the usage of the groq resources and the rate limit information
Example:

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

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

Implementation

Future<(GroqAudioResponse, GroqRateLimitInformation)> translateAudio({
  required String audioFileUrl,
  required String modelId,
  String? customApiKey,
  double temperature = 0.5,
}) async {
  final specificApiKey = customApiKey ?? apiKey;
  return await GroqApi.translateAudio(
    filePath: audioFileUrl,
    modelId: modelId,
    apiKey: specificApiKey,
    temperature: temperature,
  );
}