This commit is contained in:
zyp
2026-11-18 16:01:50 +08:00
parent 0dc48ad092
commit 0c3d0c1ce4
30 changed files with 1525 additions and 93 deletions
+6 -2
View File
@@ -9,6 +9,10 @@ from app.modules.work_assistant.routes import router
def create_assistant_app() -> FastAPI:
settings = get_settings()
if settings.app_env.lower() in {"prod", "production"} and settings.app_mode != "work-assistant":
raise RuntimeError("The standalone assistant requires APP_MODE=work-assistant in production")
@asynccontextmanager
async def lifespan(app):
from app.modules.work_assistant.bid_queue import bid_queue
@@ -20,7 +24,7 @@ def create_assistant_app() -> FastAPI:
app = FastAPI(title="管理系统工作助手", debug=False, lifespan=lifespan)
app.middleware("http")(request_id_middleware)
prefix = get_settings().api_prefix
prefix = settings.api_prefix
app.include_router(router, prefix=f"{prefix}/work-assistant")
@app.get(f"{prefix}/health")
@@ -29,7 +33,7 @@ def create_assistant_app() -> FastAPI:
return {"status": "ok", "service": "work-assistant", "protocol_versions": [1,2] if ready else [1],
"orchestration": "langgraph" if ready else "legacy", "features": {
"module_skills": ready, "explicit_turn_intent": ready, "adaptive_evidence_review": ready,
"structured_computation":ready}}
"structured_computation":ready, "conversation_reply_memory": True}}
return app