✨ feat(web-search): add web_search built-in tool#117
Conversation
- Migrate web search tool to independent awaken-ext-web-search crate - Introduce SearchProvider trait abstraction for multiple backends - Add SerpApiProvider implementation with env var fallback (SERPAPI_KEY) - Add timeout retry logic (max 2 retries) - Maintain backward compatibility in awaken-runtime - Proper feature gating: web-search in awaken-runtime, serpapi in extension - Complete test coverage for core functionality and cancellation
|
Good direction overall: extracting web_search into a separate extension crate, introducing SearchProvider, and keeping runtime compatibility wrappers all make sense. A few issues should be fixed before merging: ShutdownConfig was accidentally removed from awaken::prelude, which is an unrelated breaking change. Please restore the re-export. Once these are addressed, the overall design looks good. |
- Migrate web search tool to independent awaken-ext-web-search crate - Introduce SearchProvider trait abstraction for multiple backends - Add SerpApiProvider implementation with env var fallback (SERPAPI_KEY) - Add timeout retry logic (max 2 retries) - Maintain backward compatibility in awaken-runtime - Proper feature gating: web-search in awaken-runtime, serpapi in extension - Complete test coverage for core functionality and cancellation
311e115 to
fba1376
Compare
|
All four issues have been addressed in the latest commit: ✅ 1. ShutdownConfig restored
✅ 2. SerpAPI authentication corrected
✅ 3. num_results validation added
✅ 4. serpapi feature documented
|
|
Thanks for the PR — the overall direction looks good. Splitting web search into Before merging, I’d request changes on a few points:
Other follow-ups worth considering:
|
|
Thanks for the detailed review! I've addressed all the points you raised |
|
Nice refactor overall — extracting web_search into awaken-ext-web-search and introducing SearchProvider looks like the right direction. 👍 A few issues to fix before merge: search_merge can exceed num_results |
Summary
Moves the existing
web_searchbuilt-in tool fromawaken-runtimeto a standaloneawaken-ext-web-searchcrate, following the project extension conventionawaken-ext-*.This establishes clear dependency boundaries and enables multiple search backend support.
Changes
Implemented all PR review suggestions:
SearchProvidertrait to support multiple backends- src/tool.rs - Core SearchProvider trait, SearchResult struct, and WebSearchTool
- src/providers/serpapi.rs - Concrete SerpAPI implementation
- Proper feature gating: serpapi feature gates the default backend
// Reads from environment when api_key is empty
SerpApiProvider::new("", None) // <- gets key from SERPAPI_KEY
existing code requires no changes
Checklist
Architecture Notes
The implementation is ready for adding new search backends in the future (Google Custom
Search, Bing, etc.). To add a new backend: