Skip to content

Commit fad580a

Browse files
committed
docs fix
1 parent fe45341 commit fad580a

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

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

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@
2525

2626

2727
class ToolboxSyncClient:
28-
__session: Optional[ClientSession] = None
29-
__loop: Optional[asyncio.AbstractEventLoop] = None
30-
__thread: Optional[Thread] = None
3128
"""
3229
A synchronous client for interacting with a Toolbox service.
3330
3431
Provides methods to discover and load tools defined by a remote Toolbox
3532
service endpoint, returning synchronous tool wrappers (`SyncToolboxTool`).
3633
It manages an underlying asynchronous `ToolboxClient`.
3734
"""
35+
__session: Optional[ClientSession] = None
36+
__loop: Optional[asyncio.AbstractEventLoop] = None
37+
__thread: Optional[Thread] = None
3838

3939
def __init__(
4040
self,
@@ -56,7 +56,6 @@ def __init__(
5656
ToolboxSyncClient.__loop = loop
5757

5858
async def __start_session() -> None:
59-
6059
# Use a default session if none is provided. This leverages connection
6160
# pooling for better performance by reusing a single session throughout
6261
# the application's lifetime.
@@ -105,7 +104,7 @@ def load_tool(
105104
tool remotely.
106105
107106
Args:
108-
tool_name: The unique name or identifier of the tool to load.
107+
tool_name: Name of the tool to load.
109108
auth_token_getters: A mapping of authentication service names to
110109
callables that return the corresponding authentication token.
111110
bound_params: A mapping of parameter names to bind to specific values or
@@ -162,7 +161,7 @@ async def aload_tool(
162161
bound_params: Mapping[str, Union[Callable[[], Any], Any]] = {},
163162
) -> ToolboxSyncTool:
164163
"""
165-
Synchronously loads a tool from the server.
164+
Asynchronously loads a tool from the server.
166165
167166
Retrieves the schema for the specified tool and returns a callable,
168167
synchronous object (`SyncToolboxTool`) that can be used to invoke the
@@ -193,7 +192,7 @@ async def aload_toolset(
193192
bound_params: Mapping[str, Union[Callable[[], Any], Any]] = {},
194193
) -> list[ToolboxSyncTool]:
195194
"""
196-
Synchronously fetches a toolset and loads all tools defined within it.
195+
Asynchronously fetches a toolset and loads all tools defined within it.
197196
198197
Args:
199198
toolset_name: Name of the toolset to load tools.
@@ -221,12 +220,9 @@ async def aload_toolset(
221220

222221
def close(self):
223222
"""
224-
Synchronously closes the underlying asynchronous client session if it
225-
was created internally by the client.
223+
Synchronously closes the client session if it was created internally by the client.
226224
"""
227-
# Create the coroutine for closing the async client
228225
coro = self.__session.close()
229-
# Run it synchronously
230226
self.__run_as_sync(coro)
231227

232228
def __enter__(self):

0 commit comments

Comments
 (0)