@@ -119,7 +119,7 @@ async def close(self):
119
119
async def load_tool (
120
120
self ,
121
121
name : str ,
122
- auth_service_tokens : dict [str , Callable [[], str ]] = {},
122
+ auth_token_getters : dict [str , Callable [[], str ]] = {},
123
123
) -> ToolboxTool :
124
124
"""
125
125
Asynchronously loads a tool from the server.
@@ -130,6 +130,8 @@ async def load_tool(
130
130
131
131
Args:
132
132
name: The unique name or identifier of the tool to load.
133
+ auth_token_getters: A mapping of authentication service names to
134
+ callables that return the corresponding authentication token.
133
135
134
136
Returns:
135
137
ToolboxTool: A callable object representing the loaded tool, ready
@@ -148,7 +150,7 @@ async def load_tool(
148
150
if name not in manifest .tools :
149
151
# TODO: Better exception
150
152
raise Exception (f"Tool '{ name } ' not found!" )
151
- tool = self .__parse_tool (name , manifest .tools [name ], auth_service_tokens )
153
+ tool = self .__parse_tool (name , manifest .tools [name ], auth_token_getters )
152
154
153
155
return tool
154
156
@@ -162,6 +164,9 @@ async def load_toolset(
162
164
163
165
Args:
164
166
name: Name of the toolset to load tools.
167
+ auth_token_getters: A mapping of authentication service names to
168
+ callables that return the corresponding authentication token.
169
+
165
170
166
171
Returns:
167
172
list[ToolboxTool]: A list of callables, one for each tool defined
0 commit comments