feat: LLM多阶段交互式Schema生成 + UI布局优化
- AI Service: 多阶段对话模型(理解→澄清→生成→校验→确认),支持对话历史和当前Schema上下文 - Backend: 适配多阶段AI模型,Gateway/Service/Controller传递history和currentSchema - Frontend: AiDesignerChat组件重写,支持阶段徽章、快速回复、Schema校验展示 - Frontend: 表单/流程设计器布局优化,AI助手和Schema预览作为独立列 - Frontend: 流程设计器元数据和模式选择器合并为一行 - Keycloak: 自定义登录主题(中文化) - 修复CSS媒体查询括号平衡问题
This commit is contained in:
+23
-1
@@ -1,13 +1,14 @@
|
||||
from fastapi import Depends, FastAPI, HTTPException
|
||||
|
||||
from app.config import get_settings
|
||||
from app.models import LeaveDraftSuggestionRequest, LeaveDraftSuggestionResponse, LeaveProgressAnswerRequest, LeaveProgressAnswerResponse
|
||||
from app.models import LeaveDraftSuggestionRequest, LeaveDraftSuggestionResponse, LeaveProgressAnswerRequest, LeaveProgressAnswerResponse, DesignerSuggestionRequest, DesignerSuggestionResponse
|
||||
from app.qwen import (
|
||||
QwenConfigurationError,
|
||||
QwenSuggestionGateway,
|
||||
QwenUpstreamError,
|
||||
SuggestionGateway,
|
||||
ProgressGateway,
|
||||
DesignerGateway,
|
||||
)
|
||||
|
||||
app = FastAPI(title="AIOA AI Service", version="0.1.0")
|
||||
@@ -21,6 +22,10 @@ def get_progress_gateway() -> ProgressGateway:
|
||||
return QwenSuggestionGateway(get_settings())
|
||||
|
||||
|
||||
def get_designer_gateway() -> DesignerGateway:
|
||||
return QwenSuggestionGateway(get_settings())
|
||||
|
||||
|
||||
@app.get("/health")
|
||||
async def health() -> dict[str, str]:
|
||||
return {"status": "UP"}
|
||||
@@ -55,3 +60,20 @@ async def answer_leave_progress(
|
||||
except QwenUpstreamError as exc:
|
||||
raise HTTPException(status_code=502, detail=str(exc)) from exc
|
||||
return LeaveProgressAnswerResponse(answer=answer, model=get_settings().qwen_model)
|
||||
|
||||
|
||||
@app.post("/v1/designer/suggest", response_model=DesignerSuggestionResponse)
|
||||
async def suggest_design(
|
||||
request: DesignerSuggestionRequest,
|
||||
gateway: DesignerGateway = Depends(get_designer_gateway),
|
||||
) -> DesignerSuggestionResponse:
|
||||
try:
|
||||
suggestion = await gateway.suggest_design(request)
|
||||
except QwenConfigurationError as exc:
|
||||
raise HTTPException(status_code=503, detail=str(exc)) from exc
|
||||
except QwenUpstreamError as exc:
|
||||
raise HTTPException(status_code=502, detail=str(exc)) from exc
|
||||
return DesignerSuggestionResponse(
|
||||
suggestion=suggestion,
|
||||
model=get_settings().qwen_model,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user