File size: 444 Bytes
1c05b6d
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
from src.application import Application

class XiaozhiClient:
    def __init__(self):
        # 初始化单例 Application
        self.app = Application.get_instance()
        self.app.run(mode='cli', protocol='websocket')  # 不使用 gui 模式

    def chat(self, text):
        # 伪代码:你需要在这里调用实际的小智对话逻辑
        # 示例:return self.app.send_message(text)
        return f"你说的是:{text}"