Skip to content

feat: add optional You.com search integration - #205

Open
mouse-value-add wants to merge 1 commit into
szczyglis-dev:masterfrom
mouse-value-add:feat/youcom-search-integration
Open

feat: add optional You.com search integration#205
mouse-value-add wants to merge 1 commit into
szczyglis-dev:masterfrom
mouse-value-add:feat/youcom-search-integration

Conversation

@mouse-value-add

Copy link
Copy Markdown

This adds You.com as an optional web search engine provider for the Web Search plugin, following the existing provider pattern (GoogleCustomSearch, MicrosoftBingSearch, DuckDuckGoSearch in pygpt_net/provider/web/).

What changed

  • src/pygpt_net/provider/web/youcom_search.py — new YouComSearch provider implementing BaseProvider, registered alongside the built-in providers in app.py
  • tests/provider/web/test_youcom_search.py — unit tests (request construction, SSE/JSON response parsing, limit/offset, de-dup, fail-safe on errors, is_configured behavior, env var fallback)
  • Docs: provider list + option reference in README.md, docs/source/intro.rst, docs/source/plugins.rst

Why

The docs note the Web Search plugin "can be extended with other search engine providers" — this adds one more option through that existing extension point. The provider calls the You.com MCP server's you-search tool over plain HTTPS using the repo's existing requests dependency. No new dependencies.

Setup

Select You.com in the Web Search plugin's Provider option. It works keyless out of the box — the default endpoint (https://api.you.com/mcp?profile=free) needs no credentials. Optionally, a You.com API KEY can be set in the plugin settings (or via the YDC_API_KEY env var as a fallback); when a key is present, requests switch to the authenticated endpoint https://api.you.com/mcp with bearer auth. The endpoint is also overridable in settings, like bing_endpoint.

Behavior / fail-safe

  • Opt-in: only active when selected as the provider — default provider (google_custom_search) and all existing providers are untouched
  • is_configured returns True for the keyless endpoint; the authenticated endpoint requires the key, otherwise the standard "set API key in plugin settings" flow kicks in
  • HTTP errors, JSON-RPC error envelopes, and exceptions return an empty URL list (matching the DuckDuckGo provider's never-raise pattern) — the plugin then tries the next step as usual

Validation

  • pytest tests/provider/web/ tests/plugin/cmd_web/ — 20/20 pass
  • flake8 clean on both new files (--max-line-length=120)
  • Live keyless end-to-end check of the provider's real HTTP path against https://api.you.com/mcp?profile=free (returns URLs, offset pagination works)
  • Registration verified through the real Web.register() path: youcom_search shows up in the provider combo and settings tabs, defaults unchanged
  • Full-suite collection errors in this environment are pre-existing (missing optional deps like llama_index, speech_recognition) and identical on unmodified master

Happy to adjust the shape if you'd prefer the provider under a different name/id or a different option layout.

Add optional You.com provider to the Web Search plugin, following the
existing search engine provider pattern (Google Custom Search, Microsoft
Bing, DuckDuckGo). Uses the You.com MCP server you-search tool via the
repo's existing requests dependency - no new dependencies.

Works keyless by default (https://api.you.com/mcp?profile=free); an
optional API key (youcom_api_key, falls back to YDC_API_KEY env var)
switches to the authenticated endpoint with bearer auth. Provider is
opt-in via the provider selector in plugin settings - default provider
and all existing providers are 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