feat(core): Support multi round conversation operator (#986)

This commit is contained in:
Fangyin Cheng
2023-12-27 23:26:28 +08:00
committed by GitHub
parent 9aec636b02
commit b13d3f6d92
63 changed files with 2011 additions and 314 deletions

View File

@@ -217,6 +217,10 @@ async def dialogue_list(
model_name = item.get("model_name", CFG.LLM_MODEL)
user_name = item.get("user_name")
sys_code = item.get("sys_code")
if not item.get("messages"):
# Skip the empty messages
# TODO support new conversation and message mode
continue
messages = json.loads(item.get("messages"))
last_round = max(messages, key=lambda x: x["chat_order"])