@@ -9,29 +9,27 @@ applications, enabling advanced orchestration and interaction with GenAI models.
9
9
## Table of Contents
10
10
<!-- TOC -->
11
11
12
- - [ MCP Toolbox LlamaIndex SDK] ( #mcp-toolbox-llamaindex-sdk )
13
- - [ Installation] ( #installation )
14
- - [ Quickstart] ( #quickstart )
15
- - [ TODO: add link] ( #todo-add-link )
16
- - [ Usage] ( #usage )
17
- - [ Loading Tools] ( #loading-tools )
18
- - [ Load a toolset] ( #load-a-toolset )
19
- - [ Load a single tool] ( #load-a-single-tool )
20
- - [ Use with LlamaIndex] ( #use-with-llamaindex )
21
- - [ Maintain state] ( #maintain-state )
22
- - [ Manual usage] ( #manual-usage )
23
- - [ Authenticating Tools] ( #authenticating-tools )
24
- - [ Supported Authentication Mechanisms] ( #supported-authentication-mechanisms )
25
- - [ Configure Tools] ( #configure-tools )
26
- - [ Configure SDK] ( #configure-sdk )
27
- - [ Add Authentication to a Tool] ( #add-authentication-to-a-tool )
28
- - [ Add Authentication While Loading] ( #add-authentication-while-loading )
29
- - [ Complete Example] ( #complete-example )
30
- - [ Binding Parameter Values] ( #binding-parameter-values )
31
- - [ Binding Parameters to a Tool] ( #binding-parameters-to-a-tool )
32
- - [ Binding Parameters While Loading] ( #binding-parameters-while-loading )
33
- - [ Binding Dynamic Values] ( #binding-dynamic-values )
34
- - [ Asynchronous Usage] ( #asynchronous-usage )
12
+ - [ Installation] ( #installation )
13
+ - [ Quickstart] ( #quickstart )
14
+ - [ Usage] ( #usage )
15
+ - [ Loading Tools] ( #loading-tools )
16
+ - [ Load a toolset] ( #load-a-toolset )
17
+ - [ Load a single tool] ( #load-a-single-tool )
18
+ - [ Use with LlamaIndex] ( #use-with-llamaindex )
19
+ - [ Maintain state] ( #maintain-state )
20
+ - [ Manual usage] ( #manual-usage )
21
+ - [ Authenticating Tools] ( #authenticating-tools )
22
+ - [ Supported Authentication Mechanisms] ( #supported-authentication-mechanisms )
23
+ - [ Configure Tools] ( #configure-tools )
24
+ - [ Configure SDK] ( #configure-sdk )
25
+ - [ Add Authentication to a Tool] ( #add-authentication-to-a-tool )
26
+ - [ Add Authentication While Loading] ( #add-authentication-while-loading )
27
+ - [ Complete Example] ( #complete-example )
28
+ - [ Binding Parameter Values] ( #binding-parameter-values )
29
+ - [ Binding Parameters to a Tool] ( #binding-parameters-to-a-tool )
30
+ - [ Binding Parameters While Loading] ( #binding-parameters-while-loading )
31
+ - [ Binding Dynamic Values] ( #binding-dynamic-values )
32
+ - [ Asynchronous Usage] ( #asynchronous-usage )
35
33
36
34
<!-- /TOC -->
37
35
@@ -44,8 +42,7 @@ pip install toolbox-llamaindex
44
42
## Quickstart
45
43
46
44
Here's a minimal example to get you started using
47
- # TODO: add link
48
- [ LlamaIndex] ( ) :
45
+ [ LlamaIndex] ( https://docs.llamaindex.ai/en/stable/#getting-started ) :
49
46
50
47
``` py
51
48
import asyncio
@@ -111,7 +108,7 @@ available to your LLM agent.
111
108
112
109
## Use with LlamaIndex
113
110
114
- LangChain 's agents can dynamically choose and execute tools based on the user
111
+ LlamaIndex 's agents can dynamically choose and execute tools based on the user
115
112
input. Include tools loaded from the Toolbox SDK in the agent's toolkit:
116
113
117
114
``` py
@@ -165,7 +162,7 @@ print(response)
165
162
Execute a tool manually using the ` call ` method:
166
163
167
164
``` py
168
- result = tools[0 ].call({ " name" : " Alice" , " age" : 30 } )
165
+ result = tools[0 ].call(name = " Alice" , age = 30 )
169
166
```
170
167
171
168
This is useful for testing tools or when you need precise control over tool
@@ -210,21 +207,21 @@ async def get_auth_token():
210
207
toolbox = ToolboxClient(" http://127.0.0.1:5000" )
211
208
tools = toolbox.load_toolset()
212
209
213
- auth_tool = tools[0 ].add_auth_token (" my_auth" , get_auth_token) # Single token
210
+ auth_tool = tools[0 ].add_auth_token_getter (" my_auth" , get_auth_token) # Single token
214
211
215
- multi_auth_tool = tools[0 ].add_auth_tokens ({" my_auth " , get_auth_token }) # Multiple tokens
212
+ multi_auth_tool = tools[0 ].add_auth_token_getters ({" auth_1 " : get_auth_1}, { " auth_2 " : get_auth_2 }) # Multiple tokens
216
213
217
214
# OR
218
215
219
- auth_tools = [tool.add_auth_token (" my_auth" , get_auth_token) for tool in tools]
216
+ auth_tools = [tool.add_auth_token_getter (" my_auth" , get_auth_token) for tool in tools]
220
217
```
221
218
222
219
#### Add Authentication While Loading
223
220
224
221
``` py
225
- auth_tool = toolbox.load_tool(auth_tokens = {" my_auth" : get_auth_token})
222
+ auth_tool = toolbox.load_tool(auth_token_getters = {" my_auth" : get_auth_token})
226
223
227
- auth_tools = toolbox.load_toolset(auth_tokens = {" my_auth" : get_auth_token})
224
+ auth_tools = toolbox.load_toolset(auth_token_getters = {" my_auth" : get_auth_token})
228
225
```
229
226
230
227
> [ !NOTE]
@@ -245,8 +242,8 @@ async def get_auth_token():
245
242
toolbox = ToolboxClient(" http://127.0.0.1:5000" )
246
243
tool = toolbox.load_tool(" my-tool" )
247
244
248
- auth_tool = tool.add_auth_token (" my_auth" , get_auth_token)
249
- result = auth_tool.call({ " input" : " some input" } )
245
+ auth_tool = tool.add_auth_token_getter (" my_auth" , get_auth_token)
246
+ result = auth_tool.call(input = " some input" )
250
247
print (result)
251
248
```
252
249
0 commit comments