forked from phoenix/litellm-mirror
(test) verify azure response have expected keys
This commit is contained in:
parent
4247df02c7
commit
3059f30672
1 changed files with 4 additions and 3 deletions
|
@ -39,21 +39,22 @@ def test_openai_embedding():
|
||||||
print(openai_response_keys)
|
print(openai_response_keys)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pytest.fail(f"Error occurred: {e}")
|
pytest.fail(f"Error occurred: {e}")
|
||||||
test_openai_embedding()
|
# test_openai_embedding()
|
||||||
|
|
||||||
def test_openai_azure_embedding_simple():
|
def test_openai_azure_embedding_simple():
|
||||||
try:
|
try:
|
||||||
|
|
||||||
response = embedding(
|
response = embedding(
|
||||||
model="azure/azure-embedding-model",
|
model="azure/azure-embedding-model",
|
||||||
input=["good morning from litellm"],
|
input=["good morning from litellm"],
|
||||||
)
|
)
|
||||||
print(response)
|
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 Exception as e:
|
except Exception as e:
|
||||||
pytest.fail(f"Error occurred: {e}")
|
pytest.fail(f"Error occurred: {e}")
|
||||||
|
|
||||||
# test_openai_azure_embedding_simple()
|
test_openai_azure_embedding_simple()
|
||||||
|
|
||||||
def test_openai_azure_embedding():
|
def test_openai_azure_embedding():
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue