From 82067072a7436bfadce6a133624518966a1f3995 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 4 Jul 2024 16:49:45 -0700 Subject: [PATCH] docs - groq speech to text --- docs/my-website/docs/providers/groq.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/my-website/docs/providers/groq.md b/docs/my-website/docs/providers/groq.md index 70b9f00d6..bcca20b5d 100644 --- a/docs/my-website/docs/providers/groq.md +++ b/docs/my-website/docs/providers/groq.md @@ -157,4 +157,21 @@ if tool_calls: model="groq/llama2-70b-4096", messages=messages ) # get a new response from the model where it can see the function response print("second response\n", second_response) +``` + +## Speech to Text - Whisper + +```python +os.environ["GROQ_API_KEY"] = "" +audio_file = open("/path/to/audio.mp3", "rb") + +transcript = litellm.transcription( + model="groq/whisper-large-v3", + file=audio_file, + prompt="Specify context or spelling", + temperature=0, + response_format="json" +) + +print("response=", transcript) ``` \ No newline at end of file