1010from datetime import datetime
1111
1212# 라우터 임포트
13- from app .routers import recommendation , chatbot
13+ from app .routers import recommendation , chatbot , crowd
1414
1515# 환경 변수 설정
1616OPENAI_API_KEY = os .getenv ("OPENAI_API_KEY" , "" )
@@ -47,6 +47,7 @@ async def global_exception_handler(request: Request, exc: Exception):
4747# 라우터 등록
4848app .include_router (recommendation .router )
4949app .include_router (chatbot .router )
50+ app .include_router (crowd .router )
5051
5152@app .get ("/" )
5253async def root ():
@@ -68,7 +69,7 @@ async def root():
6869 "stats" : "/api/chat/stats"
6970 },
7071 "description" : "OpenAI GPT 기반 데이트 코스 추천 챗봇" ,
71- "status" : "active" if hasattr (chatbot , 'openai_service ' ) else "inactive"
72+ "status" : "active" if hasattr (chatbot , 'langchain_agent_service ' ) else "inactive"
7273 }
7374 },
7475 "documentation" : "/docs"
@@ -84,7 +85,7 @@ async def health_check():
8485
8586 # 챗봇 상태 확인
8687 chatbot_status = "inactive"
87- if hasattr (chatbot , 'openai_service ' ) and chatbot .openai_service :
88+ if hasattr (chatbot , 'langchain_agent_service ' ) and chatbot .langchain_agent_service :
8889 chatbot_status = "active"
8990
9091 # 전체 상태 결정
@@ -112,7 +113,7 @@ async def get_overall_stats():
112113 "type" : "ELK + DeepCTR"
113114 },
114115 "chatbot" : {
115- "status" : "active" if hasattr (chatbot , 'openai_service ' ) else "inactive" ,
116+ "status" : "active" if hasattr (chatbot , 'langchain_agent_service ' ) else "inactive" ,
116117 "type" : "OpenAI GPT" ,
117118 "active_sessions" : len (getattr (chatbot , 'active_sessions' , {}))
118119 }
0 commit comments