Repository navigation
feat: 统一模型调用并隔离 Provider 凭据 - #8
Merged
Merged
Conversation
This was referenced Oct 11, 2026
Merged
Merged
ZhuLinsen
marked this pull request as ready for review
October 11, 2026 13:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
使用 any-llm-sdk 1.33.0 统一异步模型调用,复用客户端,并让自定义 OpenAI-compatible Provider 使用自己的凭据。
改动
模型统一为 provider:model-id;配置显式隔离 Provider 密钥。流式文本和多工具调用分片完整组装后才进入执行层,未完成响应拒绝执行。自定义端点禁用 SDK 重试,原生 Provider 保留 SDK 行为。
验证
203 passed, 1 live test deselected;四组 CI 全部通过。
真实锁定 SDK 配合本地 HTTP MockTransport,验证自定义地址和 usage;不把 Mock 计作真实 API 验收。
官方 Python 物理行数 4365 → 4492。复现:python -m pytest tests -q;python scripts/source_stats.py。
SDK 上游:https://github.com/mozilla-ai/any-llm
兼容、边界与回滚
DeepSeek/Qwen/Claude 真实基础、工具和流式调用尚未验收;显式 base URL 使用兼容模式,与原生协议能力可能不同。旧配置不自动迁移,新增 providers 配置已同步 .env.example 和运行指南。
本项为 3/6,base 为 codex/lean-02-runtime;#11 补充签名保留、四类原生 SDK 多轮协议测试与可选 live 工具验收。
按 #6 → #7 → #8 → #9 → #10 → #11 合入,中间阶段不单独发布。回滚时逆序 revert 本项及后续依赖;不触发 tag。