feat: add Tavily search provider alongside Google Custom Search#4
Open
tavily-integrations wants to merge 1 commit into
Open
Conversation
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
SearchServicesearch.providerproperty (googleortavily, defaults togoogle) controls which provider is usedraw_contentfrom the API response is used directly, bypassing Jsoup scrapingtavily.api.keyis configured, Tavily is tried automaticallyFiles changed
src/main/java/org/example/aisearchapp/service/SearchService.java— AddedtavilyApiKeyandsearchProviderfields,searchTavily()method, and provider branching ingetAiSummary()src/main/resources/application.properties.example— Addedsearch.providerandtavily.api.keypropertiesDependency changes
RestTemplateandObjectMapperEnvironment variable changes
TAVILY_API_KEY→ maps totavily.api.keySpring propertySEARCH_PROVIDER→ maps tosearch.provider(values:googleortavily, defaultgoogle)Notes for reviewers
include_raw_content=trueandmax_results=5to match the existing Google path's behaviorisBlockedSource) is applied to Tavily results as well🤖 Generated with Claude Code
Automated Review
https://api.tavily.com/searchwith valid parameters (api_key,query,include_raw_content,max_results), and the response is parsed correctly usingresults[].urlandresults[].raw_content. The additive strategy is cleanly implemented — Google+Jsoup is the preserved default, Tavily is an opt-in provider viasearch.provider=tavily, and a Google-to-Tavily fallback is added when Google returns empty results.application.properties.exampleis updated with the two new properties and a helpful comment. No regressions, no dead code, no broken imports. Three minor issues found but none block approval.