liuhua liuhua Kevin Hu commited on
Commit
54cd6b8
·
1 Parent(s): 0f0c543

Fix agent_completion bug (#4329)

Browse files

### 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 <kevinhu.sh@gmail.com>

Files changed (1) hide show
  1. api/apps/sdk/session.py +4 -0
api/apps/sdk/session.py CHANGED
@@ -35,6 +35,7 @@ from api.utils.api_utils import get_result, token_required
35
  from api.db.services.llm_service import LLMBundle
36
 
37
 
 
38
  @manager.route('/chats/<chat_id>/sessions', methods=['POST']) # noqa: F821
39
  @token_required
40
  def create(tenant_id, chat_id):
@@ -92,6 +93,9 @@ def create_agent_session(tenant_id, agent_id):
92
  else:
93
  if "value" in ele:
94
  ele.pop("value")
 
 
 
95
  cvs.dsl = json.loads(str(canvas))
96
  conv = {
97
  "id": get_uuid(),
 
35
  from api.db.services.llm_service import LLMBundle
36
 
37
 
38
+
39
  @manager.route('/chats/<chat_id>/sessions', methods=['POST']) # noqa: F821
40
  @token_required
41
  def create(tenant_id, chat_id):
 
93
  else:
94
  if "value" in ele:
95
  ele.pop("value")
96
+ else:
97
+ for ans in canvas.run(stream=False):
98
+ pass
99
  cvs.dsl = json.loads(str(canvas))
100
  conv = {
101
  "id": get_uuid(),