Skip to content

Commit 0e370f3

Browse files
committed
Merge remote-tracking branch 'origin/twisha-sync-wrapper' into twisha-sync-wrapper
2 parents 239143f + 954d7d2 commit 0e370f3

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

packages/toolbox-core/src/toolbox_core/sync_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ async def __start_session() -> None:
6464

6565
coro = __start_session()
6666

67-
asyncio.run_coroutine_threadsafe(coro, ToolboxSyncClient.__loop).result()
67+
asyncio.run_coroutine_threadsafe(__start_session(), ToolboxSyncClient.__loop).result()
6868

6969
if not ToolboxSyncClient.__session:
7070
raise ValueError("Session cannot be None.")
@@ -127,6 +127,7 @@ def load_tool(
127127
for execution. The specific arguments and behavior of the callable
128128
depend on the tool itself.
129129
"""
130+
130131
async_tool = self.__run_as_sync(
131132
self.__async_client.load_tool(name, auth_token_getters, bound_params)
132133
)
@@ -155,6 +156,7 @@ def load_toolset(
155156
list[ToolboxSyncTool]: A list of callables, one for each tool defined
156157
in the toolset.
157158
"""
159+
158160
async_tools = self.__run_as_sync(
159161
self.__async_client.load_toolset(
160162
name, auth_token_getters, bound_params

packages/toolbox-core/src/toolbox_core/sync_tool.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def __init__(
4747
loop: The event loop used to run asynchronous tasks.
4848
thread: The thread to run blocking operations in.
4949
"""
50+
5051
if not isinstance(async_tool, ToolboxTool):
5152
raise TypeError("async_tool must be an instance of ToolboxTool")
5253

@@ -113,6 +114,7 @@ def add_auth_token_getters(
113114
A new ToolboxSyncTool instance with the specified authentication token
114115
getters registered.
115116
"""
117+
116118
new_async_tool = self.__async_tool.add_auth_token_getters(auth_token_getters)
117119
return ToolboxSyncTool(new_async_tool, self.__loop, self.__thread)
118120

@@ -129,5 +131,6 @@ def bind_parameters(
129131
Returns:
130132
A new ToolboxSyncTool instance with the specified parameters bound.
131133
"""
134+
132135
new_async_tool = self.__async_tool.bind_parameters(bound_params)
133136
return ToolboxSyncTool(new_async_tool, self.__loop, self.__thread)

packages/toolbox-core/tests/test_sync_e2e.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
1415
import pytest
1516

1617
from toolbox_core.sync_client import ToolboxSyncClient

0 commit comments

Comments
 (0)