feat: add Tavily as configurable search provider alongside Brave#1
Open
tavily-integrations wants to merge 1 commit into
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
Adds Tavily as a selectable web search provider alongside the existing Brave Search integration. Users can choose between Brave, Tavily, or Auto (fallback) mode via a new segmented picker in Settings > Web Search.
Changes
New file
Sources/LocalNotch/TavilySearchService.swift— Tavily search service using URLSession POST tohttps://api.tavily.com/search, matching BraveSearchService'ssearch(_ query:) async -> String?interface and output format.Modified files
Sources/LocalNotch/AppSettings.swift— AddedSearchProviderenum (brave/tavily/auto),tavilyAPIKeyandsearchProvider@published properties with UserDefaults persistence. UpdateddefaultSystemPromptto use provider-neutral "web search" language instead of "Brave Search".Sources/LocalNotch/SettingsView.swift— Replaced single Brave key field with a provider segmented picker and conditional key input fields for Brave and Tavily. Status text reflects the active provider.Sources/LocalNotch/ChatState.swift— Updated system preamble to use "real-time web search" instead of "Brave Search API".Sources/LocalNotch/ChatView.swift— AddedperformWebSearch()routing method that dispatches to BraveSearchService or TavilySearchService based onsearchProvidersetting, with fallback in auto mode. UpdateddecideSearchQueryto check for either API key. Made<source>tag provider-neutral.Dependency changes
Environment / config changes
tavilyAPIKey,searchProviderNotes for reviewers
braveto maintain existing behavior for current usersAutomated Review