Skip to content

Commit 127d0be

Browse files
authored
docs: Improve function docstrings and README (#246)
* docs: Improve function docstrings in tool classes * docs: Add singular bind param method to README
1 parent 8b61ede commit 127d0be

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

packages/toolbox-core/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,10 @@ specific tool instance.
459459
toolbox = ToolboxClient("http://127.0.0.1:5000")
460460
tool = await toolbox.load_tool("my-tool")
461461

462+
bound_tool = tool.bind_param("param", "value")
463+
464+
# OR
465+
462466
bound_tool = tool.bind_params({"param": "value"})
463467
```
464468

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ def add_auth_token_getters(
152152
153153
Raises:
154154
ValueError: If an auth source has already been registered either to
155-
the tool or to the corresponding client.
156-
"""
155+
the tool or to the corresponding client.
157156
157+
"""
158158
new_async_tool = self.__async_tool.add_auth_token_getters(auth_token_getters)
159159
return ToolboxSyncTool(new_async_tool, self.__loop, self.__thread)
160160

@@ -175,7 +175,7 @@ def add_auth_token_getter(
175175
176176
Raises:
177177
ValueError: If the auth source has already been registered either to
178-
the tool or to the corresponding client.
178+
the tool or to the corresponding client.
179179
180180
"""
181181
return self.add_auth_token_getters({auth_source: get_id_token})
@@ -187,8 +187,8 @@ def bind_params(
187187
Binds parameters to values or callables that produce values.
188188
189189
Args:
190-
bound_params: A mapping of parameter names to values or callables that
191-
produce values.
190+
bound_params: A mapping of parameter names to values or callables
191+
that produce values.
192192
193193
Returns:
194194
A new ToolboxSyncTool instance with the specified parameters bound.
@@ -198,7 +198,6 @@ def bind_params(
198198
tool's definition.
199199
200200
"""
201-
202201
new_async_tool = self.__async_tool.bind_params(bound_params)
203202
return ToolboxSyncTool(new_async_tool, self.__loop, self.__thread)
204203

0 commit comments

Comments
 (0)