From fcdc6ad08552158116e37ede3c21677d1b7e2c1d Mon Sep 17 00:00:00 2001 From: kunkeji <49889250+kunkeji@users.noreply.github.com> Date: Fri, 29 Nov 2024 10:36:48 +0800 Subject: [PATCH] Fix the issue where the agent interface cannot call the context (#3725) ### What problem does this PR solve? Fix the context of the agent interface call to the context during web testing, and change it to the context record of user chat Remove duplicate messages and add them, which can be viewed in the messages section of database api_4_comversation ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --------- Co-authored-by: Kevin Hu Co-authored-by: Jin Hai --- api/apps/sdk/session.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/api/apps/sdk/session.py b/api/apps/sdk/session.py index fff67707b..3874035bf 100644 --- a/api/apps/sdk/session.py +++ b/api/apps/sdk/session.py @@ -308,7 +308,6 @@ def agent_completion(tenant_id, agent_id): if 'docnm_kwd' in chunk_i: chunk_i['doc_name'] = chunk_i['docnm_kwd'] chunk_i.pop('docnm_kwd') - conv.message.append(msg[-1]) if not conv.reference: conv.reference = [] @@ -317,7 +316,6 @@ def agent_completion(tenant_id, agent_id): final_ans = {"reference": [], "content": ""} - canvas.messages.append(msg[-1]) canvas.add_user_input(msg[-1]["content"]) if stream: