Update app.py
Browse files
app.py
CHANGED
@@ -81,11 +81,18 @@ def dic_ep(content: Text = None):
|
|
81 |
messages = [
|
82 |
{
|
83 |
"role": "system",
|
84 |
-
"content": "
|
|
|
|
|
|
|
|
|
85 |
}
|
86 |
]
|
87 |
obj = json.loads(content.content)
|
88 |
-
|
|
|
|
|
|
|
89 |
history = obj['history']
|
90 |
for his in history:
|
91 |
messages.append({"role": "user", "content": his[0]})
|
|
|
81 |
messages = [
|
82 |
{
|
83 |
"role": "system",
|
84 |
+
"content": "你是小鹏汽车数据智能中心(简称DIC)的IT服务台的智能助手"
|
85 |
+
+ "根据提供的参考文章,生成文本来回答问题。答案包含参考文章内容中HTML样式的图片、网址、超链接。准确、有用、清晰。"
|
86 |
+
+ "模仿提供的参考对话来有用的回复用户,进行多轮对话。"
|
87 |
+
+ "根据参考文章和参考对话来回答用户的IT类问题,无法回答非IT类问题。"
|
88 |
+
+ "你是一个对话机器人,无法提供对话之外的服务(如远程协助、到现场解决故障等)。用户有对话之外服务的需求,请回复他:正在转人工。"
|
89 |
}
|
90 |
]
|
91 |
obj = json.loads(content.content)
|
92 |
+
if 'ref_doc' in obj:
|
93 |
+
messages.append({"role": "system", "content": "参考文章:\n" + obj['ref_doc']})
|
94 |
+
if 'ref_dialog' in obj:
|
95 |
+
messages.append({"role": "system", "content": "参考对话:\n" + obj['ref_dialog']})
|
96 |
history = obj['history']
|
97 |
for his in history:
|
98 |
messages.append({"role": "user", "content": his[0]})
|