Skip to content

Commit 10dfe8c

Browse files
committed
chore: Remove unused strict flag + fix default values + fix docstring
1 parent 24d87e7 commit 10dfe8c

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def __init__(
5656
async def create_client():
5757
return ToolboxClient(url, client_headers=client_headers)
5858

59-
# Ignoring type since we're already checking the existence of a loop above.
6059
self.__async_client = asyncio.run_coroutine_threadsafe(
6160
create_client(), self.__class__.__loop
6261
).result()

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ async def aload_toolset(
103103
auth_tokens: Optional[dict[str, Callable[[], str]]] = None,
104104
auth_headers: Optional[dict[str, Callable[[], str]]] = None,
105105
bound_params: dict[str, Union[Any, Callable[[], Any]]] = {},
106-
strict: bool = True,
106+
strict: bool = False,
107107
) -> list[AsyncToolboxTool]:
108108
"""
109109
Loads tools from the Toolbox service, optionally filtered by toolset
@@ -118,9 +118,11 @@ async def aload_toolset(
118118
auth_headers: Deprecated. Use `auth_token_getters` instead.
119119
bound_params: An optional mapping of parameter names to their
120120
bound values.
121-
strict: If True, raises a ValueError if any of the given bound
122-
parameters are missing from the schema or require
123-
authentication. If False, only issues a warning.
121+
strict: If True, raises an error if *any* loaded tool instance fails
122+
to utilize at least one provided parameter or auth token (if any
123+
provided). If False (default), raises an error only if a
124+
user-provided parameter or auth token cannot be applied to *any*
125+
loaded tool across the set.
124126
125127
Returns:
126128
A list of all tools loaded from the Toolbox.
@@ -170,7 +172,6 @@ def load_tool(
170172
auth_tokens: Optional[dict[str, Callable[[], str]]] = None,
171173
auth_headers: Optional[dict[str, Callable[[], str]]] = None,
172174
bound_params: dict[str, Union[Any, Callable[[], Any]]] = {},
173-
strict: bool = True,
174175
) -> AsyncToolboxTool:
175176
raise NotImplementedError("Synchronous methods not supported by async client.")
176177

@@ -181,6 +182,6 @@ def load_toolset(
181182
auth_tokens: Optional[dict[str, Callable[[], str]]] = None,
182183
auth_headers: Optional[dict[str, Callable[[], str]]] = None,
183184
bound_params: dict[str, Union[Any, Callable[[], Any]]] = {},
184-
strict: bool = True,
185+
strict: bool = False,
185186
) -> list[AsyncToolboxTool]:
186187
raise NotImplementedError("Synchronous methods not supported by async client.")

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async def _arun(self, **kwargs: Any) -> dict[str, Any]:
6363

6464

6565
def add_auth_token_getters(
66-
self, auth_token_getters: dict[str, Callable[[], str]], strict: bool = True
66+
self, auth_token_getters: dict[str, Callable[[], str]]
6767
) -> "ToolboxTool":
6868
"""
6969
Registers functions to retrieve ID tokens for the corresponding
@@ -131,7 +131,6 @@ def bind_param(
131131
self,
132132
param_name: str,
133133
param_value: Union[Any, Callable[[], Any]],
134-
strict: bool = True,
135134
) -> "ToolboxTool":
136135
"""
137136
Registers a value or a function to retrieve the value for a given bound

0 commit comments

Comments
 (0)