@@ -155,70 +155,6 @@ def load_toolset(
155
155
tools .append (ToolboxSyncTool (async_tool , self .__loop , self .__thread ))
156
156
return tools
157
157
158
- async def aload_tool (
159
- self ,
160
- tool_name : str ,
161
- auth_token_getters : dict [str , Callable [[], str ]] = {},
162
- bound_params : Mapping [str , Union [Callable [[], Any ], Any ]] = {},
163
- ) -> ToolboxSyncTool :
164
- """
165
- Asynchronously loads a tool from the server.
166
-
167
- Retrieves the schema for the specified tool and returns a callable,
168
- synchronous object (`SyncToolboxTool`) that can be used to invoke the
169
- tool remotely.
170
-
171
- Args:
172
- tool_name: The unique name or identifier of the tool to load.
173
- auth_token_getters: A mapping of authentication service names to
174
- callables that return the corresponding authentication token.
175
- bound_params: A mapping of parameter names to bind to specific values or
176
- callables that are called to produce values as needed.
177
-
178
- Returns:
179
- ToolboxSyncTool: A synchronous callable object representing the loaded tool.
180
- """
181
- async_tool = await self .__run_as_async (
182
- self .__async_client .load_tool (tool_name , auth_token_getters , bound_params )
183
- )
184
-
185
- if not self .__loop or not self .__thread :
186
- raise ValueError ("Background loop or thread cannot be None." )
187
- return ToolboxSyncTool (async_tool , self .__loop , self .__thread )
188
-
189
- async def aload_toolset (
190
- self ,
191
- toolset_name : str ,
192
- auth_token_getters : dict [str , Callable [[], str ]] = {},
193
- bound_params : Mapping [str , Union [Callable [[], Any ], Any ]] = {},
194
- ) -> list [ToolboxSyncTool ]:
195
- """
196
- Asynchronously fetches a toolset and loads all tools defined within it.
197
-
198
- Args:
199
- toolset_name: Name of the toolset to load tools.
200
- auth_token_getters: A mapping of authentication service names to
201
- callables that return the corresponding authentication token.
202
- bound_params: A mapping of parameter names to bind to specific values or
203
- callables that are called to produce values as needed.
204
-
205
- Returns:
206
- list[ToolboxSyncTool]: A list of synchronous callables, one for each
207
- tool defined in the toolset.
208
- """
209
- async_tools = await self .__run_as_async (
210
- self .__async_client .load_toolset (
211
- toolset_name , auth_token_getters , bound_params
212
- )
213
- )
214
-
215
- if not self .__loop or not self .__thread :
216
- raise ValueError ("Background loop or thread cannot be None." )
217
- tools : list [ToolboxSyncTool ] = []
218
- for async_tool in async_tools :
219
- tools .append (ToolboxSyncTool (async_tool , self .__loop , self .__thread ))
220
- return tools
221
-
222
158
def close (self ):
223
159
"""
224
160
Synchronously closes the client session if it was created internally by the client.
0 commit comments