Skip to content

Commit ca29813

Browse files
authored
Tools, don't merge custom with existing defaults (#367)
* Tools, don't merge custom with existing defaults * Use ternary operator instead of if else block
1 parent cff4a32 commit ca29813

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

deepfabric/tools/loader.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,13 @@ def get_available_tools(
110110
111111
Args:
112112
available_tool_names: List of tool names to include (None means all)
113-
custom_registry: Custom tool registry to merge with defaults
113+
custom_registry: Custom tool registry (if provided, REPLACES defaults entirely)
114114
115115
Returns:
116116
ToolRegistry with available tools
117117
"""
118-
# Start with defaults
119-
if custom_registry is not None:
120-
# Merge custom tools with defaults (custom tools override defaults)
121-
registry = merge_tool_registries(DEFAULT_TOOL_REGISTRY, custom_registry)
122-
else:
123-
registry = DEFAULT_TOOL_REGISTRY
118+
# Use custom tools if provided (replaces defaults), otherwise use defaults
119+
registry = custom_registry if custom_registry is not None else DEFAULT_TOOL_REGISTRY
124120

125121
# Filter by available tool names if specified
126122
if available_tool_names:

0 commit comments

Comments
 (0)