feat(benchmark): Add VikingBot testing to RAG benchmark
Description
本 PR 将 VikingBot 测试添加到了 OpenViking benchmark/RAG 框架中,并添加了自定义 prompt 配置功能,同时优化了执行流程。
- VikingBot 集成 :添加 VikingBot 测试功能,支持代理式 RAG 评估
- 自定义 Prompt 配置 :添加 prompt 和 base_instruction 两个配置项,让用户可以灵活自定义 bot 的 prompt
- 执行流程拆分 :将 --step gen 拆分为 ingest (数据导入)和 gen (RAG 生成)两个独立步骤
- 断点续传功能 :添加 resume/checkpoint 机制,支持在 gen 和 eval 阶段断点续传
- Bot 专用配置文件 :为所有数据集添加 bot 专用配置文件示例(位于 config/bot/ 目录下)
Related Issue
Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Refactoring (no functional changes)
- [ ] Performance improvement
- [ ] Test update
Changes Made
新增
- benchmark/RAG/src/core/checkpoint.py - 检查点管理器,支持断点续传
- benchmark/RAG/src/vikingbot_runner.py - VikingBot 运行器,支持自定义 prompt
- benchmark/RAG/config/bot/locomo_bot_config.yaml - Locomo 数据集 bot 配置
- benchmark/RAG/config/bot/qasper_bot_config.yaml - Qasper 数据集 bot 配置
- benchmark/RAG/config/bot/financebench_bot_config.yaml - FinanceBench 数据集 bot 配置
- benchmark/RAG/config/bot/syllabusqa_bot_config.yaml - SyllabusQA 数据集 bot 配置 修改
- benchmark/RAG/run.py - 更新命令行参数和执行流程
- benchmark/RAG/src/pipeline.py - 拆分执行流程,添加 resume 支持
- benchmark/RAG/config/*.yaml - 更新标准配置文件
- benchmark/RAG/README.md - 更新英文文档
- benchmark/RAG/README_zh.md - 更新中文文档
Testing
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] I have tested this on the following platforms:
- [ ] Linux
- [ ] macOS
- [ ] Windows
Checklist
- [ ] My code follows the project's coding style
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] Any dependent changes have been merged and published
Screenshots (if applicable)
Additional Notes
功能详情
-
VikingBot 自定义 Prompt
- prompt :完全自定义 prompt,支持 {question} 占位符
- base_instruction :自定义基础指令,保持默认结构
- 向后兼容:不配置时使用默认 prompt
-
执行流程拆分
- --step ingest :只执行数据导入
- --step gen :只执行 RAG 生成
- --step eval :只执行评估
- --step del :只执行数据删除
- --step all :执行所有步骤(向后兼容)
- 删除了 skip_ingestion 配置项
-
断点续传功能
- 支持 --step gen 和 --step eval 两个阶段
- 自动保存进度到 benchmark_checkpoint.json
- 配置哈希验证,防止错误的实验结果覆盖
更多详细内容以及使用示例请参考readme文档
PR Reviewer Guide 🔍
Here are some key observations to aid the review process:
| ⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪ |
| 🏅 Score: 70 |
| 🧪 No relevant tests |
| 🔒 No security concerns identified |
| ✅ No TODO sections |
🔀 Multiple PR themesSub-PR theme: Add checkpoint/resume functionality and split steps into ingest/genRelevant files:
Sub-PR theme: Add VikingBot integration and custom prompt configurationRelevant files:
|
⚡ Recommended focus areas for reviewAPI Key Environment Variable Regression
api_key_env_var configuration option, which previously allowed loading the API key from an environment variable. This breaks existing configurations that rely on environment variables for API keys. |
PR Code Suggestions ✨
Explore these optional code suggestions:
| Category | Suggestion | Impact |
| General |
Stop server only with VikingBotOnly stop the OpenViking server if we actually used VikingBot (i.e., when benchmark/RAG/src/pipeline.py [112-176]
Suggestion importance[1-10]: 5__ Why: The suggestion correctly modifies the code to only stop the OpenViking server when VikingBot is actually used, avoiding unnecessary operations in standard RAG mode. | Low |