Skip to content

feat: add optional You.com search tool - #95

Open
mouse-value-add wants to merge 1 commit into
Haervwe:mainfrom
mouse-value-add:feat/youcom-search-integration
Open

mouse-value-add wants to merge 1 commit into
Haervwe:mainfrom
mouse-value-add:feat/youcom-search-integration

Conversation

@mouse-value-add

Copy link
Copy Markdown

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 — a class Tools with pydantic Valves, calling the You.com Search API (POST https://ydc-index.io/v1/search) with aiohttp. No new dependencies; just aiohttp + pydantic like the other tools.
  • tests/test_youcom_search_tool.py — focused tests using the same FakeSession/FakeResponse pattern as test_outagedeck_status_tool.py.
  • README section + TOC entry, matching the SerpBase section format.

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 freshness filter (day/week/month/year or 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_KEY valve (password input) — get a key at https://you.com/platform/api-keys
  • Optional valves: MAX_RESULTS (1-100, default 10), FRESHNESS, COUNTRY (ISO 3166-1), LANGUAGE (BCP 47), TIMEOUT_SECONDS
  • Per-call overrides: num_results, freshness

Usage

Search You.com for the latest Open WebUI release notes

Kept optional

The tool is inert until a YDC_API_KEY is 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

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant