Files
tw/run.py
2026-02-27 16:03:04 +08:00

26 lines
710 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- 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已停止")