From dd50aeddbba598513e8d63e0a874ab3322661507 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Tue, 14 Nov 2023 12:12:02 -0800 Subject: [PATCH] (test) azure_ad_token --- litellm/tests/test_completion.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/litellm/tests/test_completion.py b/litellm/tests/test_completion.py index 4a4038732a4..9ce931f1ab0 100644 --- a/litellm/tests/test_completion.py +++ b/litellm/tests/test_completion.py @@ -632,6 +632,28 @@ def test_completion_azure(): except Exception as e: pytest.fail(f"Error occurred: {e}") +def test_azure_openai(): + try: + print("\n making azure ad token call\n") + # os.environ.pop("AZURE_API_KEY") + litellm.set_verbose=False + response = litellm.completion( + model="azure/chatgpt-v-2", # e.g. gpt-35-instant + messages=[ + { + "role": "user", + "content": "How do I output all files in a directory using Python?", + }, + ], + ) + print("azure ad token respoonse\n") + print(response) + except: + # this test fails, since we use AD tokens whcih last 30mins + pass +test_azure_openai() + + # test_completion_azure() def test_completion_azure2(): # test if we can pass api_base, api_version and api_key in compleition()