-
Notifications
You must be signed in to change notification settings - Fork 3
🛠️ Implement Advanced Tool System with Search, Details, Compare, Ensemble, and Recipe Tools #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: jongalloway <[email protected]>
Co-authored-by: jongalloway <[email protected]>
…mble, and Recipe Tools Co-authored-by: jongalloway <[email protected]>
…t before each commit
…sults and EnhanceSearchResults methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates a new Advanced Tool System that enhances query handling by routing requests to specialized tool handlers when enabled, while preserving backward compatibility and fallback behavior.
- Introduces five new tool handlers (search, details, compare, ensemble, recipe) inheriting from
BaseToolHandler - Extends
NLWebServiceto select and execute tools before falling back to the standard pipeline - Adds DI registration via
AddAdvancedToolSystem()and comprehensive unit tests for the executor
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/NLWebNet.Tests/Services/ToolExecutorTests.cs | Added tests for available tools, execution success, and error |
| src/NLWebNet/Services/SearchToolHandler.cs | Implements enhanced search logic and result optimization |
| src/NLWebNet/Services/DetailsToolHandler.cs | Implements subject extraction and detailed information logic |
| src/NLWebNet/Services/CompareToolHandler.cs | Implements side-by-side comparison processing |
| src/NLWebNet/Services/EnsembleToolHandler.cs | Implements cohesive recommendation set creation |
| src/NLWebNet/Services/RecipeToolHandler.cs | Implements recipe-specific query handling and result formatting |
| src/NLWebNet/Services/BaseToolHandler.cs | Provides shared tooling for error/success response creation |
| src/NLWebNet/Services/IToolHandler.cs | Defines the tool handler interface |
| src/NLWebNet/Services/IToolExecutor.cs | Defines and implements tool execution routing |
| src/NLWebNet/Services/NLWebService.cs | Adds tool selection/execution logic to request processing |
| src/NLWebNet/Extensions/ToolSystemServiceCollectionExtensions.cs | Registers the tool system services in DI container |
| src/NLWebNet/Extensions/ServiceCollectionExtensions.cs | Integrates advanced tool system into core AddNLWebNet methods |
| doc/advanced-tool-system-guide.md | Documentation for configuration, usage patterns, and examples |
| .github/custom-instructions.md | Updated internal guidelines (not directly affecting functionality) |
Comments suppressed due to low confidence (1)
src/NLWebNet/Services/RecipeToolHandler.cs:113
- [nitpick] Hardcoded site identifier "Recipe" may lead to inconsistent casing compared to the ToolType property ("recipe"); consider using
ToolTypeor a consistent value for uniform site naming across handlers.
"Recipe",
Co-authored-by: Copilot <[email protected]>
…oved maintainability
This PR implements the comprehensive Advanced Tool System requested in the requirements, providing enhanced query capabilities through specialized tool handlers that route queries to appropriate processors based on intent analysis.
Implementation Overview
Core Infrastructure
IToolHandler- Base interface for all tool implementationsIToolExecutor- Service to manage tool execution pipelineBaseToolHandler- Abstract class providing common functionalityNLWebService- Seamless routing between tool execution and standard processingTool Handlers Implemented
1. SearchToolHandler - Enhanced keyword and semantic search
"search for REST API documentation"→ optimized search with better ranking2. DetailsToolHandler - Comprehensive information retrieval
"tell me about GraphQL"→ detailed information about GraphQL3. CompareToolHandler - Side-by-side comparison analysis
"compare React vs Vue"→ structured comparison results4. EnsembleToolHandler - Cohesive recommendation sets
"recommend Italian dinner menu"→ appetizer, main, dessert suggestions5. RecipeToolHandler - Specialized culinary assistance
"substitute butter in baking"→ alternative ingredient optionsIntegration Features
Backward Compatibility
ToolSelectionEnabled = false, uses standard processing pipelineConfiguration
{ "NLWebNet": { "ToolSelectionEnabled": true } }Dependency Injection
Automatic registration via
AddAdvancedToolSystem()extension method:Query Processing Flow
IToolSelectoranalyzes query for tool selectionIToolExecutorroutes to appropriate handlerSample Supported Queries
"find information about microservices""what is Docker?","describe OAuth 2.0""Node.js versus Python for backend""suggest tools for DevOps pipeline""what goes with grilled salmon?"Testing
ToolExecutorTestsDocumentation
Added comprehensive usage guide at
doc/advanced-tool-system-guide.mdwith:This implementation provides significant feature differentiation while maintaining full backward compatibility and robust error handling.
Fixes #37.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.