Skip to content

feat(deepagent): integrate You.com Search API as a DeepAgent tool - #224

Open
tra371 wants to merge 1 commit into
apconw:masterfrom
Cooperation-org:feature/youchannels-search
Open

feat(deepagent): integrate You.com Search API as a DeepAgent tool#224
tra371 wants to merge 1 commit into
apconw:masterfrom
Cooperation-org:feature/youchannels-search

Conversation

@tra371

@tra371 tra371 commented Jul 9, 2026

Copy link
Copy Markdown

PR描述(中文):

摘要

  • 集成 You.com Search API 作为 DeepAgent 的可调用工具 (youcom_search),在 REPORT_QA 流水线中启用实时网络搜索
  • 工具同时注册到 SQLAlchemy 和原生驱动工具列表中,无论查询走哪条后端路径都可以使用
  • 返回格式化的搜索结果,包含标题、链接、摘要和页面时间

改动

  • agent/deepagent/tools/youcom_search_tool.py — 新工具实现
  • agent/deepagent/deep_data_agent.py — 在 SQLAlchemy 和原生驱动工具列表中注册工具
  • .env.dev — 添加 YOU_SEARCH_API_KEY= 占位符

测试计划

  • 全部13个单元测试通过(独立运行,无外部依赖):python tests/test_youcom_search_tool.py
  • 使用有效 API key 验证 DeepAgent REPORT_QA 网络搜索端到端可用
  • 确认搜索结果在 SSE 流式响应中正确渲染

备注

  • 使用 X-API-Key 请求头(非 Authorization: Bearer)
  • 端点:https://ydc-index.io/v1/search
  • 需要在 .env.dev 中设置 YOU_SEARCH_API_KEY
  • 本地测试文件因 .gitignore: tests/* 规则未提交

Summary

  • Integrates You.com Search API into the DeepAgent system as a callable tool (youcom_search), enabling real-time web search within the REPORT_QA pipeline
  • Tool is registered in both SQLAlchemy and native driver tool lists, so it's available regardless of which backend path handles the query
  • Returns formatted results with title, link, snippet, and page age for each web result

Changes

  • agent/deepagent/tools/youcom_search_tool.py — new tool implementation
  • agent/deepagent/deep_data_agent.py — registered tool in SQLAlchemy and native driver tool lists
  • .env.dev — added YOU_SEARCH_API_KEY= placeholder

Test plan

  • All 13 unit tests pass (standalone, no external deps): python tests/test_youcom_search_tool.py
  • Verify DeepAgent REPORT_QA query with web search works end-to-end with a valid API key
  • Confirm search results render correctly in the SSE streaming response

Notes

  • Uses X-API-Key header (not Authorization: Bearer)
  • Endpoint: https://ydc-index.io/v1/search
  • Requires YOU_SEARCH_API_KEY to be set in .env.dev
  • Local tests are gitignored (tests/test_youcom_search_tool.py) — not committed due to .gitignore: tests/* rule in this repo

Adds `youcom_search` tool that calls `POST https://ydc-index.io/v1/search`
with `X-API-Key` header to enable real-time web search within the DeepAgent
REPORT_QA pipeline. The tool is registered in both the SQLAlchemy and
native driver tool lists.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tra371

tra371 commented Jul 9, 2026

Copy link
Copy Markdown
Author

@apconw 您好!由于时间关系这次没有提前创建 issue,直接提交了 PR,还请见谅。
这个 PR 为 DeepAgent 集成了 You.com Search API,填补了 DeepAgent 流水线中实时网络搜索的能力空白。目前 REPORT_QA 查询无法获取实时网络信息,集成后可以直接在深度问答场景中搜索最新资料,对需要引用外部信息的用户会很有帮助。
API 为免费层每天100次请求,使用 X-API-Key 认证,代码改动也很小(一个工具文件 + 两行注册),不会影响现有功能。麻烦帮忙 review 一下,有任何问题随时沟通 🙏

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