feat: add Exa AI-powered search tool#5
Open
tgonzalezc5 wants to merge 1 commit into
Open
Conversation
Adds ExaProvider implementing the SearchProvider ABC alongside DuckDuckGo and Tavily. Exa returns neural/semantic results with rich content (text, highlights, summary) in a single call, so the provider issues search_and_contents and cascades through the available content fields when populating SearchResult.snippet. - New ExaProvider with circuit breaker, rate-limit mapping, and support for search type, category, domain/text/date filters - SEARCH_PROVIDER=exa selects it; EXA_API_KEY, EXA_SEARCH_TYPE, EXA_CATEGORY configure it - Tests for parsing, kwargs, snippet fallback, error mapping, and provider registration Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ExaProviderimplementing the existingSearchProviderABC, alongsideDuckDuckGoProviderandTavilyProvider.search_and_contentscall, so the provider can populateSearchResult.snippetwithout a separate content-extraction round-trip.SEARCH_PROVIDER=exa, withEXA_API_KEY,EXA_SEARCH_TYPE, andEXA_CATEGORYfor tuning. Everything else (domain/text filters, date ranges, content sizes) is exposed viaExaProviderconstructor kwargs for programmatic use.Usage
Implementation notes
TavilyProviderpattern for circuit breaker, rate-limit detection, and error mapping (RateLimitError/SearchError).exa-py's default client is synchronous, so the call is offloaded withasyncio.to_thread(same approach asDuckDuckGoProvider._execute_search).summary→ joinedhighlights→ trimmedtext→ empty string, so any combination of returned content fields works.Files changed
src/utils/web_utils.py— newExaProviderclasssrc/utils/tools.py— register Exa in_build_search_providerssrc/config.py—EXA_API_KEY,EXA_SEARCH_TYPE,EXA_CATEGORYfieldsrequirements.txt,pyproject.toml— addexa-py>=2.0.0tests/test_exa_provider.py— 12 unit tests (parsing, request kwargs, snippet fallback, error mapping, provider registration); no live API callsTest plan
pytest tests/test_exa_provider.py— 12/12 passing locallyruff checkintroduces no new warnings on touched filesEXA_API_KEYin the running agent