mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-29 05:09:46 +01:00
Update connection.py
This commit is contained in:
parent
4b826ebcc2
commit
caa7352028
1 changed files with 4 additions and 2 deletions
|
|
@ -18,6 +18,7 @@ from core.handle.audioHandle import handleAudioMessage, sendAudioMessage
|
||||||
from config.private_config import PrivateConfig
|
from config.private_config import PrivateConfig
|
||||||
from core.auth import AuthMiddleware, AuthenticationError
|
from core.auth import AuthMiddleware, AuthenticationError
|
||||||
from core.utils.auth_code_gen import AuthCodeGenerator # 添加导入
|
from core.utils.auth_code_gen import AuthCodeGenerator # 添加导入
|
||||||
|
from core.utils.performance_monitor import track_performance
|
||||||
|
|
||||||
TAG = __name__
|
TAG = __name__
|
||||||
|
|
||||||
|
|
@ -189,7 +190,8 @@ class ConnectionHandler:
|
||||||
return False
|
return False
|
||||||
return not self.is_device_verified
|
return not self.is_device_verified
|
||||||
|
|
||||||
def chat(self, query):
|
@track_performance("LLM")
|
||||||
|
def process_llm_response(self, query: str) -> bool:
|
||||||
# 如果设备未验证,就发送验证码
|
# 如果设备未验证,就发送验证码
|
||||||
if self.isNeedAuth():
|
if self.isNeedAuth():
|
||||||
self.llm_finish_task = True
|
self.llm_finish_task = True
|
||||||
|
|
@ -335,4 +337,4 @@ class ConnectionHandler:
|
||||||
while self.scheduled_tasks:
|
while self.scheduled_tasks:
|
||||||
task = self.scheduled_tasks.popleft()
|
task = self.scheduled_tasks.popleft()
|
||||||
task.cancel()
|
task.cancel()
|
||||||
self.scheduled_tasks.clear()
|
self.scheduled_tasks.clear()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue