From d3953ac2aece8476cf8d6f048288afc4737a258d Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 24 Jul 2024 13:38:03 -0700 Subject: [PATCH] test(test_embedding.py): add simple azure embedding ad token test Addresses https://github.com/BerriAI/litellm/issues/4859#issuecomment-2248838617 --- litellm/tests/test_embedding.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/litellm/tests/test_embedding.py b/litellm/tests/test_embedding.py index a5a2adb757..e6dd8bbb2b 100644 --- a/litellm/tests/test_embedding.py +++ b/litellm/tests/test_embedding.py @@ -673,3 +673,17 @@ async def test_databricks_embeddings(sync_mode): # print(response) # 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)