重构: 拆openai_compat协议适配(strategy核心库·对齐anthropic)

- 新建 df-ai/openai_helpers.rs(231行): apply_openai_sse纯函数 + 13 struct(OpenAi*字段pub(crate))
- openai_compat.rs 809→597: 删抽离+use引入, Provider impl保留(impl块约束: new/convert_request/parse_tool_calls/LlmProvider trait)
- lib.rs: pub mod openai_helpers
主代兜底: cargo check --workspace 0 + test df-ai 119
strategy: 核心库自底向上, impl块约束(Provider方法保留只抽纯函数/类型), 对齐anthropic_helpers模式
git add指定(df-ai/*)
协议适配双拆完整: anthropic_compat + openai_compat 均helpers抽离
This commit is contained in:
2026-06-19 04:36:42 +08:00
parent f3a287bbd4
commit a3835e2acb
3 changed files with 239 additions and 219 deletions

View File

@@ -9,6 +9,7 @@ pub mod coordinator;
pub mod model_fetch;
pub mod model_probe;
pub mod openai_compat;
pub mod openai_helpers;
pub mod provider;
pub mod router;
// CR-30-1: 流前重试退避对外复用。complete() 的 retry_with_backoff 仍 crate 内用,