forked from phoenix/litellm-mirror
docs - groq speech to text
This commit is contained in:
parent
8ffa690f33
commit
82067072a7
1 changed files with 17 additions and 0 deletions
|
@ -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)
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue