forked from phoenix/litellm-mirror
(feat) Update WatsonX credentials and variable names
This commit is contained in:
parent
7cbe9835c9
commit
e64aceea91
2 changed files with 10 additions and 5 deletions
9
cookbook/liteLLM_IBM_Watsonx.ipynb
vendored
9
cookbook/liteLLM_IBM_Watsonx.ipynb
vendored
|
@ -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",
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue