fix nextchapter bug

This commit is contained in:
Cai
2025-10-27 11:08:46 +08:00
parent b921bda4bc
commit 33bf569fb0
4 changed files with 1138 additions and 6 deletions

View File

@@ -155,7 +155,7 @@ class AgentNamespace(Namespace):
if data['type'] == 'function': # 在这里 前端会发送允许执行的function与参数
print("function_call", data['data'])
d = data['data']
res = chatmanager[uuid].function_call(d['data']['name'], d['data']['args'])
res = chatmanager[uuid].function_call(d['data']['name'], d['data'].get('args', {}))
d['data'] = res.to_dict()
print("function_call_res", d['data'])
emit(d['route'], d, room=uuid, namespace='/agent')
@@ -234,7 +234,6 @@ class AgentNamespace(Namespace):
emit('message', res.message, room=uuid, namespace='/agent')
def on_disconnect(self,data):
ex = current_app.extensions
uuid = session.get('user_uuid')