From a5a16cfffb4d412ac6159895b88e5748562d2ec0 Mon Sep 17 00:00:00 2001 From: seven Date: Sat, 29 Mar 2025 18:24:58 +0800 Subject: [PATCH] add --- main/xiaozhi-server/core/connection.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/main/xiaozhi-server/core/connection.py b/main/xiaozhi-server/core/connection.py index 14482e1c9..9a7ffb148 100644 --- a/main/xiaozhi-server/core/connection.py +++ b/main/xiaozhi-server/core/connection.py @@ -255,6 +255,8 @@ class ConnectionHandler: future = asyncio.run_coroutine_threadsafe(self._check_and_broadcast_auth_code(), self.loop) future.result() return True + if hasattr(self.tts, 'provider_name') and self.tts.provider_name == 'linkerai' and self.tts.stream_mode == 'double_stream': + return self.chat_double_stream(query) self.dialogue.put(Message(role="user", content=query)) @@ -608,13 +610,7 @@ class ConnectionHandler: """Chat with the user and then close the connection""" try: # Use the existing chat method - - if 1:#hasattr(self.tts, 'provider_name') and self.tts.provider_name == 'linkerai' and 'double_stream' in self.tts.stream_mode: - self.logger.bind(tag=TAG).info(f"self.tts.provider_name: { self.tts.provider_name} {self.tts.stream_mode}") - self.chat_double_stream('你好') - else: - self.logger.bind(tag=TAG).info(f"self.tts.provider_name: single_stream") - self.chat('你好') + self.chat(text) # After chat is complete, close the connection self.close_after_chat = True