update:iot设备多指令适配

This commit is contained in:
CGD
2025-06-24 14:55:34 +08:00
parent bc2fc35cc9
commit 896b318c49
3 changed files with 19 additions and 1 deletions
@@ -61,6 +61,16 @@ class FunctionHandler:
return self.function_registry.get_function(name)
def handle_llm_function_call(self, conn, function_call_data):
# 多函数调用处理
if "function_calls" in function_call_data:
responses = []
for call in function_call_data["function_calls"]:
func = self.get_function(call["name"])
if func:
# 执行函数并收集响应
response = func(conn, **call.get("arguments", {}))
responses.append(response)
return self._combine_responses(responses) # 合并响应
try:
function_name = function_call_data["name"]
funcItem = self.get_function(function_name)