Skip to content

feat: add optional you.com search integration - #1004

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

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

Conversation

@mouse-value-add

Copy link
Copy Markdown

Summary

This adds You.com as an optional search engine provider, following the exact same SearchEngine pattern used by Exa, SerpApi, Tavily, and ArXiv.

You.com offers both API-key-authenticated and keyless search — the keyless tier works immediately with no API key or signup, making it the easiest way to get started with a web search backend.

What changed

  • Added ms_agent/tools/search/youcom/ with search.py, schema.py, http.py following the Tavily provider pattern exactly
  • Registered YOCOM in SearchEngineType enum and ENGINE_TOOL_NAMES
  • Added dispatch in search_engine.py, websearch_tool.py (both get_search_engine_class and get_search_engine), and search_request.py
  • Updated .env.example with YDC_API_KEY (documented as optional)
  • Updated projects/deep_research/conf.yaml with a commented-out youcom config example
  • Updated projects/fin_research/README.md with You.com as another search engine option

Setup

Three ways to use it:

  1. Keyless (no config needed): set engine: youcom in conf.yaml
  2. API key: set YDC_API_KEY in .env (get one at https://you.com/platform/api-keys)
  3. Programmatic: get_search_engine('youcom') or YouSearch()

Why optional

  • No new dependencies (stdlib only: urllib, json)
  • Existing Exa/SerpApi/Tavily/ArXiv behavior unchanged
  • When YDC_API_KEY is unset, it uses the keyless free tier transparently
  • API errors raise typed exceptions with structured fields (status, code, retry_after)

Validation

All 4 new files compile cleanly. Unit tests verified:

  • Schema serialization (YouSearchRequest.to_api_body)
  • Result parsing (YouSearchResult.to_list with empty/valid responses)
  • HTTP error classification (quota 429, auth 401/403, transport failures)
  • YouSearch keyless mode vs keyed mode (_search_url, _headers)
  • build_request_from_args and get_tool_definition
  • Enum registration (SearchEngineType.YOCOM, ENGINE_TOOL_NAMES['youcom'])

I kept this optional, following the existing provider pattern. Happy to adjust the shape if you prefer a different abstraction.

This branch has not been deployed

No deployments
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