refactor: 重构 inference 模块架构,引入设计模式并分组文件
- 新增 protocol.py 协议层,Template Method 模式消除流/非流分支 45% 重复 - SSEBuilder 统一 SSE 构造,StopChecker 独立 stop_sequence 检测 - AnthropicHandler 追踪已产出文本,修复 stop 时重复 delta - server.py 路由从约 100 行缩减至 3 行 - 拆分为 core/(cache/executor/scheduler/task)和 api/(protocol/server) - 外部保持二级导入路径(from astrai.inference import Name) - 删除所有分隔线注释,代码按语义自然分组
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import pytest
|
||||
|
||||
from astrai.inference.server import app
|
||||
from astrai.inference import app
|
||||
|
||||
|
||||
def test_health_no_model(client):
|
||||
|
||||
Reference in New Issue
Block a user