add:支持IOT功能

* 自动注册iot消息为function call函数,并通过function call控制设备

* 增加配置项,控制iot自动注册function call功能的开启

* 增加function call action的 Error code

* update:补充音量太大声、太小声的意图动作

* update:支持IOT功能

---------

Co-authored-by: 玄凤科技 <eric230308@gmail.com>
Co-authored-by: hrz <1710360675@qq.com>
This commit is contained in:
欣南科技
2025-03-18 00:34:16 +08:00
committed by GitHub
co-authored by 玄凤科技 hrz
parent 773790c8ec
commit 5aa4199dfb
9 changed files with 370 additions and 108 deletions
+4 -3
View File
@@ -458,7 +458,7 @@ class ConnectionHandler:
future = self.executor.submit(self.speak_and_play, text, text_index)
self.tts_queue.put(future)
self.dialogue.put(Message(role="assistant", content=text))
if result.action == Action.REQLLM: # 调用函数后再请求llm生成回复
elif result.action == Action.REQLLM: # 调用函数后再请求llm生成回复
text = result.result
if text is not None and len(text) > 0:
@@ -473,9 +473,10 @@ class ConnectionHandler:
self.dialogue.put(Message(role="tool", tool_call_id=function_id, content=text))
self.chat_with_function_calling(text, tool_call=True)
if result.action == Action.NOTFOUND:
elif result.action == Action.NOTFOUND:
text = result.response
else:
text = result.response
def _tts_priority_thread(self):