From 8ad152a7a46312fe85d61d086590804d319274de Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Fri, 20 Oct 2023 09:21:51 -0700 Subject: [PATCH] test(test_proxy.py): fix azure test --- litellm/tests/api_log.json | 41 +++++++++++++++++++++++++++++++++++++ litellm/tests/test_proxy.py | 3 ++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 litellm/tests/api_log.json diff --git a/litellm/tests/api_log.json b/litellm/tests/api_log.json new file mode 100644 index 00000000000..7eeb481d532 --- /dev/null +++ b/litellm/tests/api_log.json @@ -0,0 +1,41 @@ +{ + "20231020092117501221": { + "pre_api_call": { + "model": "chatgpt-v-2", + "messages": [ + { + "role": "user", + "content": "Hey!" + } + ], + "optional_params": {}, + "litellm_params": { + "return_async": false, + "api_key": null, + "force_timeout": 600, + "logger_fn": null, + "verbose": false, + "custom_llm_provider": "azure", + "api_base": "https://openai-gpt-4-test-v-1.openai.azure.com/", + "litellm_call_id": "853a40c6-2b0a-41f0-9750-4974d079a6e7", + "model_alias_map": {}, + "completion_call_id": null, + "metadata": null, + "stream_response": {} + }, + "input": [ + { + "role": "user", + "content": "Hey!" + } + ], + "api_key": "6314c6dc63f448c9873844297f408c74", + "additional_args": { + "headers": null, + "api_version": "2023-05-15", + "api_base": "https://openai-gpt-4-test-v-1.openai.azure.com/" + }, + "log_event_type": "pre_api_call" + } + } +} \ No newline at end of file diff --git a/litellm/tests/test_proxy.py b/litellm/tests/test_proxy.py index bd20cabb824..3a2d95e77d5 100644 --- a/litellm/tests/test_proxy.py +++ b/litellm/tests/test_proxy.py @@ -20,11 +20,12 @@ def test_azure_call(): "model": "azure/chatgpt-v-2", "messages": [{"role": "user", "content": "Hey!"}] } - result = litellm_completion(data=data, user_api_base=os.getenv("AZURE_API_BASE"), type="chat_completion", user_temperature=None, user_max_tokens=None, user_model=None, user_headers=None, user_debug=False) + result = litellm_completion(data=data, user_api_base=os.getenv("AZURE_API_BASE"), type="chat_completion", user_temperature=None, user_max_tokens=None, user_model=None, user_headers=None, user_debug=False, model_router=None) return result except Exception as e: pytest.fail(f"An error occurred: {e}") +# test_azure_call() ## test debug def test_debug(): try: