mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 01:40:21 +08:00
feat: 实现 executor 流式执行路径及完善 gateway 多格式 plan 构建
- Rust executor 新增流式 plan 支持,覆盖 openai/claude/gemini 的 chat/cli/video 格式 - Gateway 新增 finalize-sync、report-stream 端点及 stream report 模型 - 新增 video sync 操作(create/cancel/remix/delete)的 plan 构建 - 修正 OpenAI Responses(openai:cli) SSE 格式: 添加 event: 行、移除 [DONE] 哨兵 - 统一 OpenAI CLI normalizer 的 ID 生成方法
This commit is contained in:
32
tests/api/handlers/base/test_cli_sse_helpers.py
Normal file
32
tests/api/handlers/base/test_cli_sse_helpers.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import json
|
||||
|
||||
from src.api.handlers.base.cli_sse_helpers import _format_converted_events_to_sse
|
||||
|
||||
|
||||
def test_format_converted_events_to_sse_uses_event_lines_for_openai_cli() -> None:
|
||||
events = [
|
||||
{
|
||||
"type": "response.output_text.delta",
|
||||
"item_id": "msg_123",
|
||||
"output_index": 0,
|
||||
"content_index": 0,
|
||||
"delta": "Hi",
|
||||
"logprobs": [],
|
||||
"sequence_number": 1,
|
||||
}
|
||||
]
|
||||
|
||||
lines = _format_converted_events_to_sse(events, "openai:cli")
|
||||
|
||||
assert lines == [
|
||||
"event: response.output_text.delta\n"
|
||||
f"data: {json.dumps(events[0], ensure_ascii=False)}\n"
|
||||
]
|
||||
|
||||
|
||||
def test_format_converted_events_to_sse_keeps_data_only_for_openai_chat() -> None:
|
||||
events = [{"id": "chatcmpl-123", "object": "chat.completion.chunk", "choices": []}]
|
||||
|
||||
lines = _format_converted_events_to_sse(events, "openai:chat")
|
||||
|
||||
assert lines == [f"data: {json.dumps(events[0], ensure_ascii=False)}\n"]
|
||||
Reference in New Issue
Block a user