test(test_embedding.py): add simple azure embedding ad token test

Addresses https://github.com/BerriAI/litellm/issues/4859#issuecomment-2248838617
This commit is contained in:
Krrish Dholakia 2024-07-24 13:38:03 -07:00
parent 636c2e2b64
commit d3953ac2ae

View file

@ -673,3 +673,17 @@ async def test_databricks_embeddings(sync_mode):
# print(response) # print(response)
# local_proxy_embeddings() # local_proxy_embeddings()
def test_embedding_azure_ad_token():
# this tests if we can pass api_key to completion, when it's not in the env.
# DO NOT REMOVE THIS TEST. No MATTER WHAT Happens!
# If you want to remove it, speak to Ishaan!
# Ishaan will be very disappointed if this test is removed -> this is a standard way to pass api_key + the router + proxy use this
response = embedding(
model="azure/azure-embedding-model",
input=["good morning from litellm"],
azure_ad_token=os.getenv("AZURE_API_KEY"),
)
print(response)