@@ -240,6 +240,7 @@ the Toolbox service (matched by name).
240
240
241
241
```python
242
242
from toolbox_core import ToolboxClient
243
+ # from toolbox_langchain import ToolboxClient
243
244
244
245
async def get_auth_token():
245
246
# ... Logic to retrieve ID token (e.g., from local storage, OAuth flow)
@@ -248,14 +249,18 @@ async def get_auth_token():
248
249
249
250
toolbox = ToolboxClient("http://127.0.0.1:5000")
250
251
tool = await toolbox.load_tool("my-tool")
252
+ # tool = await toolbox.aload_tool("my-tool")
251
253
252
254
auth_tool = tool.add_auth_token_getters({"my_auth": get_auth_token})
255
+ # auth_tool = tool.add_auth_tokens({"my_auth": get_auth_token})
253
256
254
257
# OR
255
258
256
259
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})
257
261
258
- result = auth_tool(input="some input")
262
+ result = await auth_tool(input="some input")
263
+ # result = await auth_tool.ainvoke({"input": "some input"})
259
264
```
260
265
261
266
> [!TIP]
@@ -291,15 +296,19 @@ during the loading process.
291
296
292
297
```py
293
298
from toolbox_core import ToolboxClient
299
+ # from toolbox_langchain import ToolboxClient
294
300
295
301
toolbox = ToolboxClient("http://127.0.0.1:5000")
296
302
tool = await toolbox.load_tool("my-tool")
303
+ # tool = await toolbox.aload_tool("my-tool")
297
304
298
305
bound_tool = tool.bind_parameters({"param": "value"})
306
+ # bound_tool = tool.bind_params({"param": "value"})
299
307
300
308
# OR
301
309
302
310
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"})
303
312
```
304
313
305
314
## Usage Comparison
0 commit comments