diff --git a/cookbook/liteLLM_IBM_Watsonx.ipynb b/cookbook/liteLLM_IBM_Watsonx.ipynb index 99854b3b3..5ec6d05e0 100644 --- a/cookbook/liteLLM_IBM_Watsonx.ipynb +++ b/cookbook/liteLLM_IBM_Watsonx.ipynb @@ -27,7 +27,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Set watsonx Credentials\n", + "## Set watsonx.ai Credentials\n", "\n", "See [this documentation](https://cloud.ibm.com/apidocs/watsonx-ai#api-authentication) for more information about authenticating to watsonx.ai" ] @@ -43,9 +43,10 @@ "from litellm.llms.watsonx import IBMWatsonXAI\n", "litellm.set_verbose = False\n", "\n", - "os.environ[\"WX_URL\"] = \"\" # Your watsonx.ai base URL\n", - "os.environ[\"WX_API_KEY\"] = \"\" # Your IBM cloud API key or watsonx.ai token\n", - "os.environ[\"WX_PROJECT_ID\"] = \"\" # ID of your watsonx.ai project\n", + "os.environ[\"WATSONX_URL\"] = \"\" # Your watsonx.ai base URL\n", + "os.environ[\"WATSONX_APIKEY\"] = \"\" # Your IBM cloud API key or watsonx.ai token\n", + "os.environ[\"WATSONX_PROJECT_ID\"] = \"\" # ID of your watsonx.ai project\n", + "# these can also be passed as arguments to the function\n", "\n", "# generating an IAM token is optional, but it is recommended to generate it once and use it for all your requests during the session\n", "# if not passed to the function, it will be generated automatically for each request\n", diff --git a/litellm/llms/watsonx.py b/litellm/llms/watsonx.py index 38837ddb2..26bcf6c06 100644 --- a/litellm/llms/watsonx.py +++ b/litellm/llms/watsonx.py @@ -258,7 +258,11 @@ class IBMWatsonXAI(BaseLLM): or get_secret("WML_URL") ) if api_key is None: - api_key = get_secret("WATSONX_API_KEY") or get_secret("WX_API_KEY") + api_key = ( + get_secret("WATSONX_APIKEY") + or get_secret("WATSONX_API_KEY") + or get_secret("WX_API_KEY") + ) if token is None: token = get_secret("WATSONX_TOKEN") or get_secret("WX_TOKEN") if project_id is None: