@@ -113,6 +113,7 @@ def load_toolset(
113
113
name : str ,
114
114
auth_token_getters : dict [str , Callable [[], str ]] = {},
115
115
bound_params : Mapping [str , Union [Callable [[], Any ], Any ]] = {},
116
+ strict : bool = False ,
116
117
) -> list [ToolboxSyncTool ]:
117
118
"""
118
119
Synchronously fetches a toolset and loads all tools defined within it.
@@ -123,12 +124,20 @@ def load_toolset(
123
124
callables that return the corresponding authentication token.
124
125
bound_params: A mapping of parameter names to bind to specific values or
125
126
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.
126
132
127
133
Returns:
128
134
list[ToolboxSyncTool]: A list of callables, one for each tool defined
129
135
in the toolset.
136
+
137
+ Raises:
138
+ ValueError: If validation fails based on the `strict` flag.
130
139
"""
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 )
132
141
133
142
if not self .__loop or not self .__thread :
134
143
raise ValueError ("Background loop or thread cannot be None." )
0 commit comments