example_tools_resolve.py
1 """Example: Resolve tool names to callable tools.""" 2 from praisonai.templates.tool_override import ( 3 create_tool_registry_with_overrides, 4 resolve_tools, 5 ) 6 7 # Create registry with defaults 8 registry = create_tool_registry_with_overrides(include_defaults=True) 9 10 print(f"Registry contains {len(registry)} tools") 11 12 # Resolve tool names 13 tool_names = ["shell_tool", "internet_search"] 14 resolved = resolve_tools(tool_names, registry=registry) 15 16 print(f"\nResolved {len(resolved)} tools:") 17 for tool in resolved: 18 print(f" - {getattr(tool, '__name__', type(tool).__name__)}")