if '疾病症状' in entities and '疾病' not in entities:
sql_q = "match (a:疾病)-[r:疾病的症状]->(b:疾病症状 {名称:'%s'}) return a.名称" % (entities['疾病症状'])
res = list(client.run(sql_q).data()[0].values())
# print('res=',res)
if len(res)>0:
entities['疾病'] = random.choice(res)
all_en = "、".join(res)
prompt+=f"<提示>用户有{entities['疾病症状']}的情况,知识库推测其可能是得了{all_en}。请注意这只是一个推测,你需要明确告知用户这一点。提示>"
根据实体确定图数据库查询语句,从中查询得到结果。疾病症状和知识库查询结果一起组成prompt,输入大模型中

实体识别
意图识别
知识图谱
对话
intent
intent_name_field = ResponseSchema(name=“intent”, description=f"Based on the latest user message, extract the user message intent. Here are some possible labels: ‘greetings’, ‘booking’, ‘complaint’ or ‘other’")
user need
user_need_field = ResponseSchema(name=“user_need”, description=“Rephrase the latest user request and make it a meaningful question without missing any details. Use ‘’ if it is not available”)
user sentiment
sentiment_field = ResponseSchema(name=“sentiment”, description=“Based on the latest user message, extract the user sentiment. Here are some possible labels: ‘positive’, ‘neutral’, ‘negative’, ‘mixed’ or ‘other’”)
number of pizzas to be ordered
n_pizzas_field = ResponseSchema(name=“n_pizzas”, description=“Based on the user need, extract the number of pizzas to be made. Use ‘’ if it is not available”)