| 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}" | |