From df22ead84113d753ca6c326747fa68267dc9b4a4 Mon Sep 17 00:00:00 2001 From: liuhua <10215101452@stu.ecnu.edu.cn> Date: Thu, 2 Jan 2025 16:59:54 +0800 Subject: [PATCH] Fix agent_completion bug (#4329) ### What problem does this PR solve? Fix agent_completion bug #4320 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --------- Co-authored-by: liuhua <10215101452@stu.ecun.edu.cn> Co-authored-by: Kevin Hu --- api/apps/sdk/session.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/apps/sdk/session.py b/api/apps/sdk/session.py index eff4dcfe0..f6d083eb1 100644 --- a/api/apps/sdk/session.py +++ b/api/apps/sdk/session.py @@ -35,6 +35,7 @@ from api.utils.api_utils import get_result, token_required from api.db.services.llm_service import LLMBundle + @manager.route('/chats//sessions', methods=['POST']) # noqa: F821 @token_required def create(tenant_id, chat_id): @@ -92,6 +93,9 @@ def create_agent_session(tenant_id, agent_id): else: if "value" in ele: ele.pop("value") + else: + for ans in canvas.run(stream=False): + pass cvs.dsl = json.loads(str(canvas)) conv = { "id": get_uuid(),