test test_vertexai_embedding_embedding_latest

This commit is contained in:
Ishaan Jaff 2024-06-12 10:13:48 -07:00
parent aaa4a32d65
commit 8dffc8620c

View file

@ -816,10 +816,14 @@ def test_vertexai_embedding_embedding_latest():
litellm.set_verbose = True
response = embedding(
model="vertex_ai/text-embedding-004",
input=["hi"],
input=[
{"text": "good morning from litellm", "task_type": "RETRIEVAL_DOCUMENT"}
],
dimensions=1,
auto_truncate=True,
)
assert len(response.data[0]["embedding"]) == 1
assert response.usage.prompt_tokens > 0
print(f"response:", response)
except litellm.RateLimitError as e:
pass