From 72f6573c9d8fa4128ce8b36c0212c3d0653049fa Mon Sep 17 00:00:00 2001 From: CakeCN Date: Sun, 14 Sep 2025 13:31:07 +0800 Subject: [PATCH] function call and return --- Html/apps/sockets/namespaces.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Html/apps/sockets/namespaces.py b/Html/apps/sockets/namespaces.py index 9c3a5b2..5edb637 100644 --- a/Html/apps/sockets/namespaces.py +++ b/Html/apps/sockets/namespaces.py @@ -5,10 +5,9 @@ from flask_socketio import Namespace, join_room, leave_room, emit from ..function_tools import judge from ..function_tools import next_chapter -from ..services.memory_service import save_chapter_memory_by_uuid from ..services.backboard_service import realtime_response from ..services.markdown_service import load_full_markdown_file -from ..extension_ase.ase_client import HSAEngineClient, ChatManager +from ..extension_ase.ase_client import HSAEngineClient @@ -112,7 +111,9 @@ class AgentNamespace(Namespace): if data['type'] == 'function': # 在这里 前端会发送允许执行的function与参数 print("function_call", data['data']) - chatmanager[uuid].function_call(uuid, data['data']) + res = chatmanager[uuid].function_call(uuid, data['data']) + data['data'] = res + emit(data['route'], data, room=uuid, namespace='/agent') def receive_ase_dialog(client_entry: HSAEngineClient, namespace_entry: Namespace, data, init_data): @@ -121,7 +122,7 @@ class AgentNamespace(Namespace): def receive_ase_judge(client_entry: HSAEngineClient, namespace_entry: Namespace, data, init_data): print("receive_ase_judge", data) - namespace_entry.emit('request_function', data['data'], room=init_data['room'], namespace='/agent') # data 是一个列表 /dict也支持 + namespace_entry.emit('request_function', data, room=init_data['room'], namespace='/agent') # data 是一个列表 /dict也支持 def receive_ase_next_chapter(client_entry: HSAEngineClient, namespace_entry: Namespace, data, init_data): print("receive_ase_next_chapter", data)