File tree Expand file tree Collapse file tree
libs/ibm/langchain_ibm/agent_toolkits/utility Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ class WatsonxToolkit(BaseToolkit):
130130 export WATSONX_APIKEY="your-api-key"
131131
132132
133- Example :
133+ Cloud example :
134134 .. code-block:: python
135135
136136 from langchain_ibm.agent_toolkits.utility import WatsonxToolkit
@@ -152,6 +152,30 @@ class WatsonxToolkit(BaseToolkit):
152152 }
153153 search_result = google_search.invoke(input)
154154
155+ Cloud Pak for Data example:
156+ .. code-block:: python
157+
158+ from langchain_ibm.agent_toolkits.utility import WatsonxToolkit
159+
160+ watsonx_toolkit = WatsonxToolkit(
161+ url="<CPD_URL>",
162+ username="*****",
163+ password="*****",
164+ instance_id="*****",
165+ version="*****" # optional
166+ )
167+
168+ rag_query = watsonx_toolkit.get_tool(tool_name="RAGQuery")
169+
170+ rag_query.set_tool_config(
171+ {
172+ "vectorIndexId": "<vector-index-id>",
173+ "projectId": "<project-id>",
174+ }
175+ )
176+
177+ res = rag_query.run("How to initialize APIClient?")
178+
155179 """
156180
157181 project_id : Optional [str ] = None
You can’t perform that action at this time.
0 commit comments