test(test_whisper.py): add testing for load balancing whisper endpoints on router

This commit is contained in:
Krrish Dholakia 2024-03-08 14:19:37 -08:00
parent 93e9781d37
commit aca37d3bc5
2 changed files with 66 additions and 3 deletions

View file

@ -634,6 +634,28 @@ class Router:
raise e
async def atranscription(self, file: BinaryIO, model: str, **kwargs):
"""
Example Usage:
```
from litellm import Router
client = Router(model_list = [
{
"model_name": "whisper",
"litellm_params": {
"model": "whisper-1",
},
},
])
audio_file = open("speech.mp3", "rb")
transcript = await client.atranscription(
model="whisper",
file=audio_file
)
```
"""
try:
kwargs["model"] = model
kwargs["file"] = file