mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
fix(main.py): read azure ad token from optional params extra body
This commit is contained in:
parent
a8ba5df90e
commit
e0aaa94f28
2 changed files with 6 additions and 6 deletions
|
@ -692,9 +692,9 @@ def completion(
|
||||||
or get_secret("AZURE_API_KEY")
|
or get_secret("AZURE_API_KEY")
|
||||||
)
|
)
|
||||||
|
|
||||||
azure_ad_token = optional_params.pop("azure_ad_token", None) or get_secret(
|
azure_ad_token = optional_params.get("extra_body", {}).pop(
|
||||||
"AZURE_AD_TOKEN"
|
"azure_ad_token", None
|
||||||
)
|
) or get_secret("AZURE_AD_TOKEN")
|
||||||
|
|
||||||
headers = headers or litellm.headers
|
headers = headers or litellm.headers
|
||||||
|
|
||||||
|
|
|
@ -268,7 +268,7 @@ def test_completion_azure_gpt4_vision():
|
||||||
pytest.fail(f"Error occurred: {e}")
|
pytest.fail(f"Error occurred: {e}")
|
||||||
|
|
||||||
|
|
||||||
test_completion_azure_gpt4_vision()
|
# test_completion_azure_gpt4_vision()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skip(reason="this test is flaky")
|
@pytest.mark.skip(reason="this test is flaky")
|
||||||
|
@ -990,9 +990,9 @@ def test_azure_openai_ad_token():
|
||||||
print("azure ad token respoonse\n")
|
print("azure ad token respoonse\n")
|
||||||
print(response)
|
print(response)
|
||||||
litellm.input_callback = []
|
litellm.input_callback = []
|
||||||
except:
|
except Exception as e:
|
||||||
litellm.input_callback = []
|
litellm.input_callback = []
|
||||||
pass
|
pytest.fail(f"An exception occurs - {str(e)}")
|
||||||
|
|
||||||
|
|
||||||
# test_azure_openai_ad_token()
|
# test_azure_openai_ad_token()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue