|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
14 | 14 |
|
15 |
| -from asyncio import wrap_future |
| 15 | +from asyncio import to_thread |
16 | 16 | from typing import Any, Callable, Optional, Union
|
17 | 17 | from warnings import warn
|
18 | 18 |
|
@@ -85,12 +85,11 @@ async def aload_tool(
|
85 | 85 | )
|
86 | 86 | auth_token_getters = auth_headers
|
87 | 87 |
|
88 |
| - core_tool = await wrap_future( |
89 |
| - self.__core_client._load_tool_future( |
90 |
| - name=tool_name, |
91 |
| - auth_token_getters=auth_token_getters, |
92 |
| - bound_params=bound_params, |
93 |
| - ) |
| 88 | + core_tool = await to_thread( |
| 89 | + self.__core_client.load_tool, |
| 90 | + name=tool_name, |
| 91 | + auth_token_getters=auth_token_getters, |
| 92 | + bound_params=bound_params, |
94 | 93 | )
|
95 | 94 | return ToolboxTool(core_tool=core_tool)
|
96 | 95 |
|
@@ -151,13 +150,12 @@ async def aload_toolset(
|
151 | 150 | )
|
152 | 151 | auth_token_getters = auth_headers
|
153 | 152 |
|
154 |
| - core_tools = await wrap_future( |
155 |
| - self.__core_client._load_toolset_future( |
156 |
| - name=toolset_name, |
157 |
| - auth_token_getters=auth_token_getters, |
158 |
| - bound_params=bound_params, |
159 |
| - strict=strict, |
160 |
| - ) |
| 153 | + core_tools = await to_thread( |
| 154 | + self.__core_client.load_toolset, |
| 155 | + name=toolset_name, |
| 156 | + auth_token_getters=auth_token_getters, |
| 157 | + bound_params=bound_params, |
| 158 | + strict=strict, |
161 | 159 | )
|
162 | 160 |
|
163 | 161 | tools = []
|
|
0 commit comments