Commit f1e3a35
authored
Multi-provider search (Brave, Perplexity) (#177)
* feat(search): add multi-provider search services with BaseSearchService, Brave and Perplexity
Add BaseSearchService base class with factory pattern routing by engine config.
Add BraveSearchService (httpx, native offset) and PerplexitySearchService (httpx, over-fetch+slice).
Extend SearchConfig with engine, brave_*, perplexity_* fields. Refactor TavilySearchService to inherit BaseSearchService.
* feat(search): add standalone search tools (Tavily, Brave, Perplexity) with shared BaseSearchTool base
Add _BaseSearchTool base class with shared fields and __call__ logic
Refactor WebSearchTool to inherit from _BaseSearchTool
Add TavilySearchTool, BraveSearchTool, PerplexitySearchTool standalone tools
Fix description ClassVar inheritance in __init_subclass__
Add Tavily key guard to ExtractPageContentTool
Update exports and config examples with multi-provider settings
* test(search): add search services tests and update tool tests for multi-provider support
Add test_search_services.py with factory, conversion and missing API key tests
Update test_tools.py: patch BaseSearchService instead of TavilySearchService, add init/execution tests for BraveSearchTool, PerplexitySearchTool, TavilySearchTool
* refactor(exports): reorder and update exports to include TavilySearchService and adjust tool exports for consistency
* docs(tavily_search): add class docstring explaining usage, auth, and offset handling
* refactor(search): remove deprecated BaseSearchService and inline provider logic into tools with unified registry and tests
* refactor(search): replace _search_registry with SearchProviderRegistry for search tools to centralize and standardize search provider registration and lookup
* refactor(extract_page_content_tool): move Tavily extract logic from tavily_search_tool to improve separation of concerns and update tests accordingly
* refactor(agent_definition): reorganize SearchConfig fields by provider and add section comments for clarity
* docs(web_search_tool): expand class docstring to clarify engine selection and usage options
* refactor(search): consolidate search providers into unified web search tool
- consolidate search providers into a unified web search tool and config
- remove SearchProviderRegistry and legacy base_search_tool and provider modules
- update example configs to use generic api_key and optional api_base_url
- adjust exports and registries to reflect removed search-specific classes
* refactor(tools): add ExtractPageContentConfig and refactor extraction tool
- extract SearchConfig into ExtractPageContentConfig in tools
- update ExtractPageContentTool to use new config and validate tavily_api_key
- adjust package exports and imports to expose new config class
- update docs/comments and tests to reference ExtractPageContentConfig1 parent cead7be commit f1e3a35
14 files changed
Lines changed: 583 additions & 277 deletions
File tree
- examples
- sgr_deep_research_without_reporting
- sgr_deep_research
- sgr_agent_core
- services
- tools
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | | - | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
| 33 | + | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
| 38 | + | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| |||
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
| |||
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
53 | | - | |
54 | | - | |
55 | 57 | | |
| 58 | + | |
| 59 | + | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
61 | | - | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | 70 | | |
73 | 71 | | |
74 | 72 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | 65 | | |
75 | 66 | | |
76 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
10 | | - | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 27 | | |
32 | | - | |
33 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
34 | 33 | | |
| 34 | + | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
| 36 | + | |
| 37 | + | |
39 | 38 | | |
0 commit comments