add prompt to message (#2099)

### What problem does this PR solve?

#2098

### Type of change
 
- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
Kevin Hu
2024-08-26 16:14:15 +08:00
committed by GitHub
parent 6b7c028578
commit 6d3e3e4e3c
2 changed files with 12 additions and 9 deletions

View File

@ -140,7 +140,8 @@ def completion():
if not conv.reference:
conv.reference.append(ans["reference"])
else: conv.reference[-1] = ans["reference"]
conv.message[-1] = {"role": "assistant", "content": ans["answer"], "id": message_id}
conv.message[-1] = {"role": "assistant", "content": ans["answer"],
"id": message_id, "prompt": ans.get("prompt", "")}
def stream():
nonlocal dia, msg, req, conv