Skip to content

Commit e7683f4

Browse files
committed
chore: Remove unnecessary if statement
1 parent ce5ee7e commit e7683f4

File tree

1 file changed

+15
-16
lines changed
  • packages/toolbox-core/src/toolbox_core

1 file changed

+15
-16
lines changed

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

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -284,23 +284,22 @@ async def load_toolset(
284284
overall_used_auth_keys.update(used_auth_keys)
285285
overall_used_bound_params.update(used_bound_keys)
286286

287-
if not strict:
288-
unused_auth = provided_auth_keys - overall_used_auth_keys
289-
unused_bound = provided_bound_keys - overall_used_bound_params
290-
291-
if unused_auth or unused_bound:
292-
error_messages = []
293-
if unused_auth:
294-
error_messages.append(
295-
f"unused auth tokens could not be applied to any tool: {', '.join(unused_auth)}"
296-
)
297-
if unused_bound:
298-
error_messages.append(
299-
f"unused bound parameters could not be applied to any tool: {', '.join(unused_bound)}"
300-
)
301-
raise ValueError(
302-
f"Validation failed for toolset '{name or 'default'}': { '; '.join(error_messages) }."
287+
unused_auth = provided_auth_keys - overall_used_auth_keys
288+
unused_bound = provided_bound_keys - overall_used_bound_params
289+
290+
if unused_auth or unused_bound:
291+
error_messages = []
292+
if unused_auth:
293+
error_messages.append(
294+
f"unused auth tokens could not be applied to any tool: {', '.join(unused_auth)}"
295+
)
296+
if unused_bound:
297+
error_messages.append(
298+
f"unused bound parameters could not be applied to any tool: {', '.join(unused_bound)}"
303299
)
300+
raise ValueError(
301+
f"Validation failed for toolset '{name or 'default'}': { '; '.join(error_messages) }."
302+
)
304303

305304
return tools
306305

0 commit comments

Comments
 (0)