Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
//! - 三协议互转:入站 openai_chat / anthropic / responses 可调用只暴露
//! 其他协议端点的 plan(协议自动转换,见 src/protocol.rs);出站协议选择
//! 同协议优先 → anthropic → openai_chat → responses;跨协议才转换(同协议透传零损耗)。
//! - 流式 SSE 转换留 P3-B:流式请求仅支持同协议透传,跨协议 → 400 明确报错。
//! - 流式 SSE 跨协议转换(P3-B):stream:true 的跨协议请求同样转换,同协议透传。
//! 转换器清单、以及尚未覆盖的协议对(会明确返回 400),以 src/sse.rs 与
//! forward_stream 的转换器分派为准,此处不重复列举。
//!
//! 流程:请求体取 model → 路由选 key(粘性/随机/冷却/3 次切换)→
//! 按 plan 可用端点定出站协议(需要时转换请求体)→ reqwest 转发到 plan 对应
Expand Down
3 changes: 1 addition & 2 deletions src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
//! - 响应转换同步完成 usage 字段映射(prompt/completion ↔ input/output),
//! 网关计量按「上游原始响应」的协议解析(见 gateway::parse_usage),互不影响。
//!
//! 流式 SSE 转换留 P3-B(openai delta / anthropic content_block_delta /
//! responses output_text 事件互转)——本模块只处理非流式。
//! 流式 SSE 转换不在本模块,见 src/sse.rs(P3-B 已实现;本模块只处理非流式)。

use serde_json::{json, Value};

Expand Down
Loading