diff --git a/litellm/main.py b/litellm/main.py index af385b3c0..af8838cd5 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -93,6 +93,7 @@ def completion( openai.organization = litellm.organization # set API KEY openai.api_key = api_key or litellm.openai_key or get_secret("OPENAI_API_KEY") + print(f"value of set openai key {openai.api_key}") ## LOGGING logging(model=model, input=messages, additional_args=args, custom_llm_provider=custom_llm_provider, logger_fn=logger_fn) diff --git a/litellm/tests/test_secrets.py b/litellm/tests/test_secrets.py index 72e1bfb08..cdb0a7764 100644 --- a/litellm/tests/test_secrets.py +++ b/litellm/tests/test_secrets.py @@ -17,13 +17,6 @@ litellm.secret_manager_client = InfisicalClient(token=infisical_token) user_message = "Hello, whats the weather in San Francisco??" messages = [{ "content": user_message,"role": "user"}] -def test_completion_azure(): - try: - response = completion(model="gpt-3.5-turbo", deployment_id="chatgpt-test", messages=messages, custom_llm_provider="azure") - # Add any assertions here to check the response - print(response) - except Exception as e: - pytest.fail(f"Error occurred: {e}") def test_completion_openai(): try: @@ -33,10 +26,5 @@ def test_completion_openai(): except Exception as e: pytest.fail(f"Error occurred: {e}") -def test_completion_openai_with_optional_params(): - try: - response = completion(model="gpt-3.5-turbo", messages=messages, temperature=0.5, top_p=0.1, user="ishaan_dev@berri.ai") - # Add any assertions here to check the response - print(response) - except Exception as e: - pytest.fail(f"Error occurred: {e}") \ No newline at end of file +test_completion_openai() + diff --git a/litellm/utils.py b/litellm/utils.py index 71c018d6a..b46b12610 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -836,6 +836,8 @@ def get_secret(secret_name): secret = litellm.secret_manager_client.get_secret(secret_name).secret_value if secret != None: return secret # if secret found in secret manager return it + else: + raise ValueError(f"Secret '{secret_name}' not found in secret manager") elif litellm.api_key != None: # if users use litellm default key return litellm.api_key else: diff --git a/pyproject.toml b/pyproject.toml index 2dd45f07c..2337456ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "litellm" -version = "0.1.415" +version = "0.1.416" description = "Library to easily interface with LLM API providers" authors = ["BerriAI"] license = "MIT License"