Repository navigation
feat: add optional you.com search integration - #51
Open
brainsparker wants to merge 1 commit into
Open
brainsparker wants to merge 1 commit into
brainsparker wants to merge 1 commit into
Conversation
Fall back to You.com search when TAVILY_API_KEY is not set. Works without a key on the free tier; YDC_API_KEY raises limits. Search only; extract and crawl still use Tavily.
2 of 6 tasks
This branch has not been deployed
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.
I work at You.com, so treat the recommendation accordingly.
Right now
search_webonly exists whenTAVILY_API_KEYis set. Without it, agents start with no web search at all and setup prints a hint to go get a key.This PR keeps Tavily exactly as it is and adds You.com as the fallback for that case. You.com's free endpoint (
https://api.you.com/v1/agents/search) needs no API key or account, sosearch_webworks on first run.What changes
AgentCrew/modules/web_search/you_service.py(YouSearchService). Stdliburllibonly, no new dependency.GET https://api.you.com/v1/agents/search(free tier, 100 searches a day, counted per IP).YDC_API_KEYset:POST https://ydc-index.io/v1/searchwithX-API-Key, higher limits.{results: [{title, url, content}]}shape as Tavily, so the existingsearch_webhandler and formatter work unchanged.Retry-Afteron 429 is honored once.User-Agent: youdotcom-integration/saigontechnology-agentcrewon You.com requests only.setup.py: ifTavilySearchService()raises the missing-keyValueError, useYouSearchServiceinstead and print one line saying so. Any other error still disables web search as before.web_search/tool.py: when the service is You.com, onlysearch_webis registered.fetch_webpageandcrawl_websitestill need Tavily.YDC_API_KEYadded to the config key list, the GUI API key settings (marked optional), andCONFIGURATION.md.tests/test_you_search.py: mocked tests for the keyless GET, the keyed POST, error mapping and handler output. No network.What doesn't change
TAVILY_API_KEYset, behavior is identical: Tavily handles search, extract and crawl.pyproject.toml.Testing
pytest tests/test_you_search.py: 4 passed.pytest tests: same pass/fail set before and after this change (the existing failures are environment-related, e.g. PortAudio and GUI tests on a headless box).blackandruffclean on the changed files.YouSearchService().search("AgentCrew multi-agent framework", max_results=3)returned 3 results, top hit agentcrew.dev.I saw #49 adds Parallel as an MCP example in the docs. This is a different shape (built-in fallback, no config needed), so they don't conflict.
If you'd rather have this as an explicit opt-in (for example a
search_providersetting) instead of a fallback, say so and I'll change it.