Skip to content

feat: 支持 OPD 训练类型与调用链 - #1

Closed
caogaoshuai wants to merge 3 commits into
mainfrom
feat/pg-opd
Closed

caogaoshuai wants to merge 3 commits into
mainfrom
feat/pg-opd

Conversation

@caogaoshuai

Copy link
Copy Markdown
Owner

变更说明

提交 dashscope-sdk-python 的 OPD 训练类型与调用链改动,作为 OPD 四仓发布链路中的 SDK 变更。

  • 源分支:feat/pg-opd
  • 候选 commit:c803e52019d71c90b3a5f3d6e453d2cd04d07cd2
  • 目标分支:main
  • 发布人:劲松

关联链路

agentic-rl-example → dashscope-sdk-python → DashScope → dashtuning-rft/verl

自测记录

  • OPD 定向测试:14 passed(历史记录)
  • SDK 全量测试:502 passed,41 skipped,339 warnings(历史记录)
  • 详细自测材料:OPD 发布物料 M03

caogaoshuai pushed a commit that referenced this pull request Sep 17, 2026
修复了 code review 中发现的 7 个问题:

P0:
- #1 encryption.py: 为 HTTP 请求添加 timeout 参数,避免线程无限阻塞

P1:
- dashscope#4 websocket_request.py: Authorization header 使用大写 'Bearer' 保持与 HTTP 请求一致
- dashscope#10 aiohttp_request.py: 为所有 DashScopeAPIResponse 添加 headers 参数

P2:
- dashscope#5 dashscope_response.py: 使用 sentinel 修复 pop() 方法签名,保持 dict 语义
- dashscope#9 api_request_data.py: 复制 parameters 字典后操作,避免修改原始数据

P3:
- dashscope#7 aio_session.py: 删除无效的 weakref.finalize,只保留 atexit 清理机制
- dashscope#8 http_request.py: 使用 if/elif 提升 task_id/output 处理逻辑的可读性

不修复:
- dashscope#6 URL 拼接(维持现状,使用 urljoin 反而有风险)
- dashscope#11 headers 合并顺序(行为正确)

待确认:
- dashscope#2/dashscope#3 query 分支是否有外部使用者
劲松 added 3 commits September 17, 2026 11:11
- 增加 pg-opd 训练类型与 teacher_model 请求传递
- 支持本地数据集自动上传及可选 Rollout/Reward 组件
- 修正函数启动脚本写入路径并补充示例与回归测试
- 将 SDK 请求和示例中的训练类型调整为 pg_opd
- 更新中英文文档与 OPD 单元测试
- 补 tests/__init__.py 与 tests/unit/__init__.py:仓库测试从 namespace 目录变
  为正规包,避免被 site-packages 中同名 tests 包遮蔽(本机 2026-09-02 实测:
  环境被装入了带 __init__.py 的 tests 包后,tests.unit.mock_server 无法导入)
- setup.py find_packages 的 exclude=("tests") 裸字符串按字符拆分、实际不排除
  任何包;改为 ("tests", "tests.*"),防止 tests 进入 wheel
@caogaoshuai

Copy link
Copy Markdown
Owner Author

关闭:这是误发到 fork 自己的 PR(fork 内 main ← feat/pg-opd),合它对上游贡献没有任何意义,还会让 fork 的 main 偏离上游。正确的贡献 PR 是 dashscope#198。

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