forked from phoenix/litellm-mirror
(test) aembedding
This commit is contained in:
parent
10e21ae978
commit
53554bae85
1 changed files with 14 additions and 12 deletions
|
@ -177,18 +177,20 @@ def test_hf_embedding():
|
||||||
|
|
||||||
# test async embeddings
|
# test async embeddings
|
||||||
def test_aembedding():
|
def test_aembedding():
|
||||||
import asyncio
|
try:
|
||||||
async def embedding_call():
|
import asyncio
|
||||||
try:
|
async def embedding_call():
|
||||||
response = await litellm.aembedding(
|
try:
|
||||||
model="text-embedding-ada-002",
|
response = await litellm.aembedding(
|
||||||
input=["good morning from litellm", "this is another item"]
|
model="text-embedding-ada-002",
|
||||||
)
|
input=["good morning from litellm", "this is another item"]
|
||||||
print(response)
|
)
|
||||||
except:
|
print(response)
|
||||||
print(f"error occurred: {traceback.format_exc()}")
|
except Exception as e:
|
||||||
pass
|
pytest.fail(f"Error occurred: {e}")
|
||||||
asyncio.run(embedding_call())
|
asyncio.run(embedding_call())
|
||||||
|
except Exception as e:
|
||||||
|
pytest.fail(f"Error occurred: {e}")
|
||||||
|
|
||||||
test_aembedding()
|
test_aembedding()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue