push gitignore

This commit is contained in:
zhh
2025-10-24 10:37:19 +08:00
parent ce00630bb2
commit 1adf29a3f6
36 changed files with 6089 additions and 334 deletions

26
app/main.py Normal file
View File

@@ -0,0 +1,26 @@
import logging.config
import os
import litserve as ls
from app.server.ChatbotAgent.agent_server import LCAgent
from app.server.ChatbotAgent.chatbot_server import LCChatBot
from logging_env import LOGGER_CONFIG_DICT
logger = logging.getLogger(__name__)
# 判断目录是否存在
logs = 'logs'
if not os.path.exists(logs):
# 不存在则创建目录parents=True 允许创建多级目录exist_ok=True 避免目录已存在时报错)
os.makedirs(logs, exist_ok=True)
logger.info(f"目录 {logs} 创建成功")
else:
logger.info(f"目录 {logs} 已存在")
logging.config.dictConfig(LOGGER_CONFIG_DICT)
# STEP 2: START THE SERVER
if __name__ == "__main__":
chat_boot_api = LCChatBot(enable_async=True, stream=True, api_path='/api/v1/chatbot')
agent_api = LCAgent(enable_async=True, api_path='/api/v1/agent')
server = ls.LitServer([chat_boot_api, agent_api])
server.run(port=8001)