M0-08 AI Gateway 基础版 #8
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
目标
设计知习后端 AI 网关模块,为全系统提供统一的 AI 模型调用入口,封装模型路由、Prompt 管理、token 统计、失败重试和超时控制。
本 Issue 只做架构设计,不直接实现代码。
背景说明
知习后端多个模块需要调用 AI 能力:RAG Chat 需要 DeepSeek 生成回答、Learning Engine 需要 AI 诊断、Artifact 需要 AI 生成知识点、Ingestion 需要 OCR 和 Vision。如果每个模块各自对接模型 API,会导致:供应商切换困难、Prompt 版本混乱、token 消耗无法统一管控、成本核算分散。
AI Gateway 作为全系统唯一的 AI 调用出口,所有 AI 请求必须经过它。业务模块只需要告诉 Gateway"我要做什么",Gateway 负责"用哪个模型、什么 Prompt、怎么重试"。
模块职责
本模块负责:
本模块不负责:
候选数据对象
基础设施依赖判断
API 设计
Internal Provider(供业务模块调用):
AAPI:
Domain Event 设计
Admin 视图设计
安全设计
交付检查
验收标准
禁止事项
不建议当前阶段实现