Skip to content

Commit 7cf951f

Browse files
committed
fix(toolbox-core): Add strict flag validation to sync client.
1 parent e08caae commit 7cf951f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def load_toolset(
113113
name: str,
114114
auth_token_getters: dict[str, Callable[[], str]] = {},
115115
bound_params: Mapping[str, Union[Callable[[], Any], Any]] = {},
116+
strict: bool = False,
116117
) -> list[ToolboxSyncTool]:
117118
"""
118119
Synchronously fetches a toolset and loads all tools defined within it.
@@ -123,12 +124,20 @@ def load_toolset(
123124
callables that return the corresponding authentication token.
124125
bound_params: A mapping of parameter names to bind to specific values or
125126
callables that are called to produce values as needed.
127+
strict: If True, raises an error if *any* loaded tool instance fails
128+
to utilize at least one provided parameter or auth token (if any
129+
provided). If False (default), raises an error only if a
130+
user-provided parameter or auth token cannot be applied to *any*
131+
loaded tool across the set.
126132
127133
Returns:
128134
list[ToolboxSyncTool]: A list of callables, one for each tool defined
129135
in the toolset.
136+
137+
Raises:
138+
ValueError: If validation fails based on the `strict` flag.
130139
"""
131-
coro = self.__async_client.load_toolset(name, auth_token_getters, bound_params)
140+
coro = self.__async_client.load_toolset(name, auth_token_getters, bound_params, strict)
132141

133142
if not self.__loop or not self.__thread:
134143
raise ValueError("Background loop or thread cannot be None.")

0 commit comments

Comments
 (0)