You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -39,7 +39,10 @@ Additionaly you are able to pass additional secrets as an environment variable.
39
39
import os
40
40
41
41
os.environ["WATSONX_URL"] ="your service instance url"
42
-
os.environ["WATSONX_TOKEN"] ="your token for accessing the service instance"
42
+
os.environ["WATSONX_TOKEN"] ="your token for accessing the CLOUD or CPD cluster"
43
+
os.environ["WATSONX_PASSWORD"] ="your password for accessing the CPD cluster"
44
+
os.environ["WATSONX_USERNAME"] ="your username for accessing the CPD cluster"
45
+
os.environ["WATSONX_INSTANCE_ID"] ="your instance_id for accessing the CPD cluster"
43
46
```
44
47
45
48
### Installation
@@ -55,13 +58,15 @@ The LangChain IBM integration lives in the `langchain-ibm` package:
55
58
Initialize the `WatsonxToolkit` class.
56
59
57
60
```python
58
-
from langchain_ibm import WatsonxToolkit
61
+
from langchain_ibm.agent_toolkits.utilityimport WatsonxToolkit
59
62
60
63
watsonx_toolkit = WatsonxToolkit(
61
64
url="https://us-south.ml.cloud.ibm.com",
62
65
)
63
66
```
64
67
68
+
Alternatively, you can use Cloud Pak for Data credentials. For details, see [watsonx.ai software setup](https://ibm.github.io/watsonx-ai-python-sdk/setup_cpd.html).
69
+
65
70
For certain requirements, there is an option to pass the IBM's [`APIClient`](https://ibm.github.io/watsonx-ai-python-sdk/base.html#apiclient) object into the `WatsonxToolkit` class.
66
71
67
72
```python
@@ -84,6 +89,10 @@ It is possible to get all available tools as a list of `WatsonxTool` objects.
84
89
watsonx_toolkit.get_tools()
85
90
```
86
91
92
+
<Note>
93
+
The list of available tools may vary depending on whether it is IBM watsonx.ai for IBM Cloud or IBM watsonx.ai software.
94
+
</Note>
95
+
87
96
```output
88
97
[WatsonxTool(name='GoogleSearch', description='Search for online trends, news, current events, real-time information, or research topics.', args_schema=<class 'langchain_ibm.toolkit.ToolArgsSchema'>, agent_description='Search for online trends, news, current events, real-time information, or research topics.', tool_config_schema={'title': 'config schema for GoogleSearch tool', 'type': 'object', 'properties': {'maxResults': {'title': 'Max number of results to return', 'type': 'integer', 'minimum': 1, 'maximum': 20}}}, watsonx_client=<ibm_watsonx_ai.client.APIClient object at 0x127e0f490>),
89
98
WatsonxTool(name='WebCrawler', description='Useful for when you need to summarize a webpage. Do not use for Web search.', args_schema=<class 'langchain_ibm.toolkit.ToolArgsSchema'>, agent_description='Useful for when you need to summarize a webpage. Do not use for Web search.', tool_input_schema={'type': 'object', 'properties': {'url': {'title': 'url', 'description': 'URL for the webpage to be scraped', 'type': 'string', 'pattern': '^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$'}}, 'required': ['url']}, watsonx_client=<ibm_watsonx_ai.client.APIClient object at 0x127e0f490>),
0 commit comments