Skip to content

Commit 92eb7b7

Browse files
committed
doc: Add load and invocations for toolbox langchain as well
1 parent 8482889 commit 92eb7b7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ the Toolbox service (matched by name).
240240
241241
```python
242242
from toolbox_core import ToolboxClient
243+
# from toolbox_langchain import ToolboxClient
243244
244245
async def get_auth_token():
245246
# ... Logic to retrieve ID token (e.g., from local storage, OAuth flow)
@@ -248,14 +249,18 @@ async def get_auth_token():
248249
249250
toolbox = ToolboxClient("http://127.0.0.1:5000")
250251
tool = await toolbox.load_tool("my-tool")
252+
# tool = await toolbox.aload_tool("my-tool")
251253
252254
auth_tool = tool.add_auth_token_getters({"my_auth": get_auth_token})
255+
# auth_tool = tool.add_auth_tokens({"my_auth": get_auth_token})
253256
254257
# OR
255258
256259
auth_tool = await toolbox.load_tool("my-tool", auth_token_getters={"my_auth": get_auth_token})
260+
# auth_tool = await toolbox.aload_tool("my-tool", auth_tokens={"my_auth": get_auth_token})
257261
258-
result = auth_tool(input="some input")
262+
result = await auth_tool(input="some input")
263+
# result = await auth_tool.ainvoke({"input": "some input"})
259264
```
260265
261266
> [!TIP]
@@ -291,15 +296,19 @@ during the loading process.
291296
292297
```py
293298
from toolbox_core import ToolboxClient
299+
# from toolbox_langchain import ToolboxClient
294300
295301
toolbox = ToolboxClient("http://127.0.0.1:5000")
296302
tool = await toolbox.load_tool("my-tool")
303+
# tool = await toolbox.aload_tool("my-tool")
297304
298305
bound_tool = tool.bind_parameters({"param": "value"})
306+
# bound_tool = tool.bind_params({"param": "value"})
299307
300308
# OR
301309
302310
bound_tool = await toolbox.load_tool("my-tool", bound_params={"param": "value"})
311+
# bound_tool = await toolbox.aload_tool("my-tool", bound_params={"param": "value"})
303312
```
304313
305314
## Usage Comparison

0 commit comments

Comments
 (0)