main
HuangHai 4 months ago
parent ceccaace16
commit a6a51d6121

@ -122,8 +122,8 @@ async def reply(session_id: str = Form(...), prompt: str = Form(...)):
response = client.chat.completions.create(
model=MODEL_NAME,
messages=[
{"role": "system", "content": "你是一个私人助理,负责回答用户的问题。请根据用户的历史对话和当前问题,提供准确且简洁的回答。不要提及你是通义千问或其他无关信息"},
{"role": "user", "content": f"{history_prompt}用户: {prompt}"} # 将历史交互和当前输入一起发送
{"role": "system", "content": "你是一个私人助理,负责回答用户的问题。请根据用户的历史对话和当前问题,提供准确且简洁的回答。不要提及你是通义千问或其他无关信息,也不可以回复与本次用户问题不相关的历史对话记录内容"},
{"role": "user", "content": f"历史对话记录:{history_prompt},本次用户问题: {prompt}"} # 将历史交互和当前输入一起发送
],
max_tokens=500
)

Loading…
Cancel
Save