Fix: grow reference list (#9674)
### What problem does this PR solve? Fix Multiple conversations cause the reference list to grow indefinitely due to Python's mutable default argument behavior. Explicitly initialize reference as empty list when creating new sessions ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
e40be8e541
commit
5e2c33e5b0
1 changed files with 2 additions and 1 deletions
|
|
@ -182,7 +182,8 @@ def completion(tenant_id, agent_id, session_id=None, **kwargs):
|
|||
"user_id": user_id,
|
||||
"message": [],
|
||||
"source": "agent",
|
||||
"dsl": cvs.dsl
|
||||
"dsl": cvs.dsl,
|
||||
"reference": []
|
||||
}
|
||||
API4ConversationService.save(**conv)
|
||||
conv = API4Conversation(**conv)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue