mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 18:24:20 +00:00
(test) azure_ad_token
This commit is contained in:
parent
ed56f280d9
commit
dd50aeddbb
1 changed files with 22 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue