Skip to content

【No.10】feat(deepeyes-v2): add pluggable search backend skeleton - #383

Draft
Q-Sophia wants to merge 1 commit into
redai-studio:mainfrom
Q-Sophia:feature/deepeyes-v2-search-backend
Draft

Q-Sophia wants to merge 1 commit into
redai-studio:mainfrom
Q-Sophia:feature/deepeyes-v2-search-backend

Conversation

@Q-Sophia

Copy link
Copy Markdown

What

将 DeepEyes-V2 中写死的占位 search() 改造成可插拔搜索后端。

当前已完成第一阶段:

  • DEEPEYES_V2_SEARCH_BACKEND 控制 backend,默认使用 mock。
  • mock 为确定性离线实现,不联网、不需要 API key。
  • 统一返回 elapsed_time 和 data,每条结果包含 title、link、snippet、date。
  • 为 retriever 和 external 预留入口,当前未实现时安全返回 "Error"。
  • 未知 backend 或内部异常统一返回 "Error",不向上抛出。
  • image_search() 未改动。
  • 新增 5 个单元测试。

后续会继续实现 Search-R1 retriever、external search API、超时/重试及相关文档。

Why

Relates to #321(贡献者计划第二期 No.10)。

当前 DeepEyes-V2 的 search() 是固定 placeholder,只能返回模拟搜索结果,无法接入真实检索服务或网页搜索 API。

本任务目标是支持 mock / retriever / external 三种后端,同时保持默认配置下完全离线可运行。

How

当前 search() 根据 DEEPEYES_V2_SEARCH_BACKEND 分发:

search()
├── mock       -> 已实现
├── retriever  -> WIP
└── external   -> WIP

默认 mock 根据 query 和 size 确定性生成统一格式结果。

backend 不存在或执行异常时沿用现有 "Error" 约定,因此本阶段无需修改 DeepEyes-V2 上层调用逻辑。

Testing

python -m pytest tests/examples/test_deepeyes_v2_search_utils.py -q

结果:

5 passed, 1 warning in 0.08s

当前覆盖:

  • 默认 mock backend
  • 统一结果 schema
  • mock 确定性
  • retriever / external 当前错误降级
  • 未知 backend 错误降级

git diff --check 通过。

  • pre-commit run --all-files passes
  • Tests pass (pytest tests/)
  • New tests added (if applicable)
  • Documentation updated (if applicable)

Type of Change

  • New feature (non-breaking change that adds functionality)

@SigureMo SigureMo changed the title feat(deepeyes-v2): add pluggable search backend skeleton 【No.10】feat(deepeyes-v2): add pluggable search backend skeleton Sep 29, 2026

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants