mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-27 01:23:55 +08:00
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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user