26 lines
710 B
Python
26 lines
710 B
Python
# -*- coding: utf-8 -*-
|
||
"""
|
||
项目入口 - 启动 WebSocket 客服客户端
|
||
用法:
|
||
python run.py # 正常启动(含 AI Agent)
|
||
python run.py --no-agent # 仅基础回复,不启用 AI
|
||
"""
|
||
import sys
|
||
from pathlib import Path
|
||
|
||
# 确保项目根目录在 sys.path 首位
|
||
_root = Path(__file__).resolve().parent
|
||
if str(_root) not in sys.path:
|
||
sys.path.insert(0, str(_root))
|
||
|
||
if __name__ == "__main__":
|
||
from core.websocket_client import QingjianAPIClient
|
||
import asyncio
|
||
|
||
enable_agent = "--no-agent" not in sys.argv
|
||
client = QingjianAPIClient(enable_agent=enable_agent)
|
||
try:
|
||
asyncio.run(client.run())
|
||
except KeyboardInterrupt:
|
||
print("\n已停止")
|