diff --git a/packages/toolbox-core/README.md b/packages/toolbox-core/README.md index 4444ad6e..0147c45c 100644 --- a/packages/toolbox-core/README.md +++ b/packages/toolbox-core/README.md @@ -459,6 +459,10 @@ specific tool instance. toolbox = ToolboxClient("http://127.0.0.1:5000") tool = await toolbox.load_tool("my-tool") +bound_tool = tool.bind_param("param", "value") + +# OR + bound_tool = tool.bind_params({"param": "value"}) ``` diff --git a/packages/toolbox-core/src/toolbox_core/sync_tool.py b/packages/toolbox-core/src/toolbox_core/sync_tool.py index 71fde21f..5a545d9f 100644 --- a/packages/toolbox-core/src/toolbox_core/sync_tool.py +++ b/packages/toolbox-core/src/toolbox_core/sync_tool.py @@ -152,9 +152,9 @@ def add_auth_token_getters( Raises: ValueError: If an auth source has already been registered either to - the tool or to the corresponding client. - """ + the tool or to the corresponding client. + """ new_async_tool = self.__async_tool.add_auth_token_getters(auth_token_getters) return ToolboxSyncTool(new_async_tool, self.__loop, self.__thread) @@ -175,7 +175,7 @@ def add_auth_token_getter( Raises: ValueError: If the auth source has already been registered either to - the tool or to the corresponding client. + the tool or to the corresponding client. """ return self.add_auth_token_getters({auth_source: get_id_token}) @@ -187,8 +187,8 @@ def bind_params( Binds parameters to values or callables that produce values. Args: - bound_params: A mapping of parameter names to values or callables that - produce values. + bound_params: A mapping of parameter names to values or callables + that produce values. Returns: A new ToolboxSyncTool instance with the specified parameters bound. @@ -198,7 +198,6 @@ def bind_params( tool's definition. """ - new_async_tool = self.__async_tool.bind_params(bound_params) return ToolboxSyncTool(new_async_tool, self.__loop, self.__thread)