docs - groq speech to text

This commit is contained in:
Ishaan Jaff 2024-07-04 16:49:45 -07:00
parent 8ffa690f33
commit 82067072a7

View file

@ -157,4 +157,21 @@ if tool_calls:
model="groq/llama2-70b-4096", messages=messages model="groq/llama2-70b-4096", messages=messages
) # get a new response from the model where it can see the function response ) # get a new response from the model where it can see the function response
print("second response\n", second_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)
``` ```