forked from phoenix/litellm-mirror
test(test_whisper.py): add testing for load balancing whisper endpoints on router
This commit is contained in:
parent
ae54b398d2
commit
fe125a5131
2 changed files with 66 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue