mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 09:50:21 +08:00
refactor: 引入模块钩子系统,解耦认证逻辑,支持模块/normalizer/parser 自动发现
- 新增 HookDispatcher 钩子分发器,支持 FIRST_RESULT 和 COLLECT_ALL 两种策略 - LDAP 认证逻辑从 AuthService 移至 ldap 模块钩子实现 - Management Token 前缀认证从 pipeline 硬编码改为模块钩子注册 - src/modules/ 改为自动扫描子目录发现 ModuleDefinition - normalizers 和 parsers 注册改为基于类属性自动发现 - OpenAI CLI 增加 /v1/responses/compact 端点和并行 tool_call 支持 - OpenAI CLI normalizer 支持 Chat Completions 格式自动回退 - Codex 适配器增加 compact 模式上下文传递和 header 调整 - HeaderBuilder 改进非 latin-1 字符处理(UTF-8 字节透传) - Gunicorn 增加 graceful_timeout 防止僵尸进程
This commit is contained in:
@@ -3,6 +3,7 @@ OpenAI API 端点
|
||||
|
||||
- /v1/chat/completions - OpenAI Chat API
|
||||
- /v1/responses - OpenAI Responses API (CLI)
|
||||
- /v1/responses/compact - OpenAI Responses Compaction API (CLI)
|
||||
|
||||
注意: /v1/models 端点由 models.py 统一处理,根据请求头返回对应格式
|
||||
"""
|
||||
@@ -54,6 +55,29 @@ async def create_chat_completion(
|
||||
)
|
||||
|
||||
|
||||
@router.post("/v1/responses/compact")
|
||||
async def create_responses_compact(
|
||||
http_request: Request,
|
||||
db: Session = Depends(get_db),
|
||||
) -> Any:
|
||||
"""
|
||||
OpenAI Responses Compaction API (CLI)
|
||||
|
||||
用于压缩/总结之前的 responses,永远非流式。
|
||||
Codex CLI 使用 compact 模型后缀(如 gpt-5-compact)时调用此端点。
|
||||
|
||||
**认证方式**: Bearer Token(API Key 或 JWT Token)
|
||||
"""
|
||||
adapter = OpenAICliAdapter(compact=True)
|
||||
return await pipeline.run(
|
||||
adapter=adapter,
|
||||
http_request=http_request,
|
||||
db=db,
|
||||
mode=adapter.mode,
|
||||
api_format_hint=adapter.allowed_api_formats[0],
|
||||
)
|
||||
|
||||
|
||||
@router.post("/v1/responses")
|
||||
async def create_responses(
|
||||
http_request: Request,
|
||||
|
||||
Reference in New Issue
Block a user