feat: add optional You.com search tool - #95
Open
mouse-value-add wants to merge 1 commit into
Open
mouse-value-add wants to merge 1 commit into
mouse-value-add wants to merge 1 commit into
Conversation
Adds a You.com Search API tool following the existing tools/ convention: - tools/youcom_search_tool.py: class Tools + Valves (YDC_API_KEY, MAX_RESULTS, FRESHNESS, COUNTRY, LANGUAGE, TIMEOUT_SECONDS), markdown output with citation events, graceful no-key and error handling - tests/test_youcom_search_tool.py: focused tests using the existing FakeSession/FakeResponse pattern - README: tool section + TOC entry The tool is fully opt-in: without a YDC_API_KEY valve it returns a setup message and makes no requests, so default behavior is unchanged.
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.
This adds a You.com web search tool to the collection, following the same shape as the existing search tools (Perplexica, SerpBase, wiki).
What it adds
tools/youcom_search_tool.py— aclass Toolswith pydanticValves, calling the You.com Search API (POST https://ydc-index.io/v1/search) withaiohttp. No new dependencies; justaiohttp+pydanticlike the other tools.tests/test_youcom_search_tool.py— focused tests using the sameFakeSession/FakeResponsepattern astest_outagedeck_status_tool.py.Why it's useful here
The collection already gives Open WebUI users a choice of search backends. You.com's Search API returns web + news results with snippets and supports a
freshnessfilter (day/week/month/yearor a date range), which is handy for the "latest release notes / current events" style queries the other tools also target. Results are emitted as markdown with citation events so Open WebUI can link sources, same as the SerpBase tool.Setup
YDC_API_KEYvalve (password input) — get a key at https://you.com/platform/api-keysMAX_RESULTS(1-100, default 10),FRESHNESS,COUNTRY(ISO 3166-1),LANGUAGE(BCP 47),TIMEOUT_SECONDSnum_results,freshnessUsage
Search You.com for the latest Open WebUI release notesKept optional
The tool is inert until a
YDC_API_KEYis set in the valves — without it, it returns a clear setup message and makes no requests, so nothing changes for existing users. HTTP errors, timeouts, and empty results are reported as plain messages instead of raising.Validation
pytest tests/— 77 passed, 3 skipped (includes the 6 new tests: request shape, valve/override handling, no-key behavior, HTTP error reporting, empty results, citation emission)Happy to adjust the shape if you'd prefer different valve defaults or naming.
Tracking issue (internal): youdotcom-oss/integration-tracking#230