mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 18:24:20 +00:00
(test)timeout error on openai embedding
This commit is contained in:
parent
40e88eec4b
commit
c38782521c
1 changed files with 16 additions and 3 deletions
|
@ -55,7 +55,7 @@ def test_openai_azure_embedding_simple():
|
|||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
|
||||
test_openai_azure_embedding_simple()
|
||||
# test_openai_azure_embedding_simple()
|
||||
|
||||
|
||||
def test_openai_azure_embedding_timeouts():
|
||||
|
@ -66,8 +66,6 @@ def test_openai_azure_embedding_timeouts():
|
|||
timeout=0.00001
|
||||
)
|
||||
print(response)
|
||||
response_keys = dict(response).keys()
|
||||
assert set(["usage", "model", "object", "data"]) == set(response_keys) #assert litellm response has expected keys from OpenAI embedding response
|
||||
except openai.APITimeoutError:
|
||||
print("Good job got timeout error!")
|
||||
pass
|
||||
|
@ -76,6 +74,21 @@ def test_openai_azure_embedding_timeouts():
|
|||
|
||||
# test_openai_azure_embedding_timeouts()
|
||||
|
||||
def test_openai_embedding_timeouts():
|
||||
try:
|
||||
response = embedding(
|
||||
model="text-embedding-ada-002",
|
||||
input=["good morning from litellm"],
|
||||
timeout=0.00001
|
||||
)
|
||||
print(response)
|
||||
except openai.APITimeoutError:
|
||||
print("Good job got OpenAI timeout error!")
|
||||
pass
|
||||
except Exception as e:
|
||||
pytest.fail(f"Expected timeout error, did not get the correct error. Instead got {e}")
|
||||
test_openai_embedding_timeouts()
|
||||
|
||||
def test_openai_azure_embedding():
|
||||
try:
|
||||
api_key = os.environ['AZURE_API_KEY']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue