Skip to content

Commit 6adb6b2

Browse files
committed
fix: Fix using correct protected member variables
1 parent 4d6ecb0 commit 6adb6b2

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

packages/toolbox-langchain/src/toolbox_langchain/client.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,27 +85,27 @@ async def aload_tool(
8585
)
8686
auth_token_getters = auth_tokens
8787

88-
coro = self.__core_sync_client._ToolboxSyncClient__async_client.load_tool(
88+
coro = self.__core_sync_client._async_client.load_tool(
8989
name=tool_name,
9090
auth_token_getters=auth_token_getters,
9191
bound_params=bound_params,
9292
)
9393

94-
if not self.__core_sync_client._ToolboxSyncClient__loop:
94+
if not self.__core_sync_client._loop:
9595
# If a loop has not been provided, attempt to run in current thread.
9696
core_tool = await coro
9797
else:
9898
# Otherwise, run in the background thread.
9999
core_tool = await asyncio.wrap_future(
100100
asyncio.run_coroutine_threadsafe(
101-
coro, self.__core_sync_client._ToolboxSyncClient__loop
101+
coro, self.__core_sync_client._loop
102102
)
103103
)
104104

105105
core_sync_tool = ToolboxSyncTool(
106106
core_tool,
107-
self.__core_sync_client._ToolboxSyncClient__loop,
108-
self.__core_sync_client._ToolboxSyncClient__thread,
107+
self.__core_sync_client._loop,
108+
self.__core_sync_client._thread,
109109
)
110110
return ToolboxTool(core_sync_tool=core_sync_tool)
111111

@@ -166,29 +166,29 @@ async def aload_toolset(
166166
)
167167
auth_token_getters = auth_tokens
168168

169-
coro = self.__core_sync_client._ToolboxSyncClient__async_client.load_toolset(
169+
coro = self.__core_sync_client._async_client.load_toolset(
170170
name=toolset_name,
171171
auth_token_getters=auth_token_getters,
172172
bound_params=bound_params,
173173
strict=strict,
174174
)
175175

176-
if not self.__core_sync_client._ToolboxSyncClient__loop:
176+
if not self.__core_sync_client._loop:
177177
# If a loop has not been provided, attempt to run in current thread.
178178
core_tools = await coro
179179
else:
180180
# Otherwise, run in the background thread.
181181
core_tools = await asyncio.wrap_future(
182182
asyncio.run_coroutine_threadsafe(
183-
coro, self.__core_sync_client._ToolboxSyncClient__loop
183+
coro, self.__core_sync_client._loop
184184
)
185185
)
186186

187187
core_sync_tools = [
188188
ToolboxSyncTool(
189189
core_tool,
190-
self.__core_sync_client._ToolboxSyncClient__loop,
191-
self.__core_sync_client._ToolboxSyncClient__thread,
190+
self.__core_sync_client._loop,
191+
self.__core_sync_client._thread,
192192
)
193193
for core_tool in core_tools
194194
]

packages/toolbox-langchain/src/toolbox_langchain/tools.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,24 @@ def __init__(
4141
super().__init__(
4242
name=core_sync_tool.__name__,
4343
description=core_sync_tool.__doc__,
44-
args_schema=core_sync_tool._ToolboxSyncTool__async_tool._ToolboxTool__pydantic_model,
44+
args_schema=core_sync_tool._async_tool._pydantic_model,
4545
)
4646
self.__core_sync_tool = core_sync_tool
4747

4848
def _run(self, **kwargs: Any) -> dict[str, Any]:
4949
return self.__core_sync_tool(**kwargs)
5050

5151
async def _arun(self, **kwargs: Any) -> dict[str, Any]:
52-
coro = self.__core_sync_tool._ToolboxSyncTool__async_tool(**kwargs)
52+
coro = self.__core_sync_tool._async_tool(**kwargs)
5353

5454
# If a loop has not been provided, attempt to run in current thread.
55-
if not self.__core_sync_tool._ToolboxSyncTool__loop:
55+
if not self.__core_sync_tool._loop:
5656
return await coro
5757

5858
# Otherwise, run in the background thread.
5959
return await asyncio.wrap_future(
6060
asyncio.run_coroutine_threadsafe(
61-
coro, self.__core_sync_tool._ToolboxSyncTool__loop
61+
coro, self.__core_sync_tool._loop
6262
)
6363
)
6464

0 commit comments

Comments
 (0)