mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
(test) router: test async embedding + embedding
This commit is contained in:
parent
a1ac6aad8d
commit
8b9206ae51
1 changed files with 10 additions and 4 deletions
|
@ -398,20 +398,26 @@ def test_aembedding_on_router():
|
|||
"rpm": 10000,
|
||||
},
|
||||
]
|
||||
|
||||
router = Router(model_list=model_list)
|
||||
async def embedding_call():
|
||||
router = Router(model_list=model_list)
|
||||
response = await router.aembedding(
|
||||
model="text-embedding-ada-002",
|
||||
input=["good morning from litellm", "this is another item"],
|
||||
)
|
||||
print(response)
|
||||
router.reset()
|
||||
asyncio.run(embedding_call())
|
||||
|
||||
print("\n Making sync Embedding call\n")
|
||||
response = router.embedding(
|
||||
model="text-embedding-ada-002",
|
||||
input=["good morning from litellm 2"],
|
||||
)
|
||||
print("sync embedding response: ", response)
|
||||
router.reset()
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
# test_aembedding_on_router()
|
||||
test_aembedding_on_router()
|
||||
|
||||
|
||||
def test_azure_embedding_on_router():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue