From 35bdf71912dc06b3d0eaf7daf05b8200ab8ac82f Mon Sep 17 00:00:00 2001 From: "tuyang.yhj" Date: Thu, 29 Jun 2023 19:30:14 +0800 Subject: [PATCH] WEB API independent --- pilot/scene/chat_db/professional_qa/prompt.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pilot/scene/chat_db/professional_qa/prompt.py b/pilot/scene/chat_db/professional_qa/prompt.py index ff360cb65..342e76c76 100644 --- a/pilot/scene/chat_db/professional_qa/prompt.py +++ b/pilot/scene/chat_db/professional_qa/prompt.py @@ -8,7 +8,7 @@ from pilot.common.schema import SeparatorStyle CFG = Config() -PROMPT_SCENE_DEFINE = """A chat between a curious user and an artificial intelligence assistant, who very familiar with database related knowledge. """ +PROMPT_SCENE_DEFINE = """You are an assistant that answers user specialized database questions. """ # PROMPT_SUFFIX = """Only use the following tables generate sql if have any table info: # {table_info} @@ -27,21 +27,24 @@ PROMPT_SCENE_DEFINE = """A chat between a curious user and an artificial intelli # """ _DEFAULT_TEMPLATE_EN = """ -You are a database expert. you will be given metadata information about a database or table, and then provide a brief summary and answer to the question. For example, question: "How many tables are there in database 'db_gpt'?" , answer: "There are 5 tables in database 'db_gpt', which are 'book', 'book_category', 'borrower', 'borrowing', and 'category'. -Based on the database metadata information below, provide users with professional and concise answers to their questions. If the answer cannot be obtained from the provided content, please say: "The information provided in the knowledge base is not sufficient to answer this question." It is forbidden to make up information randomly. -database metadata information: +Provide professional answers to requests and questions. If you can't get an answer from what you've provided, say: "Insufficient information in the knowledge base is available to answer this question." Feel free to fudge information. +Use the following tables generate sql if have any table info: {table_info} -question: + +user question: {input} +think step by step. """ _DEFAULT_TEMPLATE_ZH = """ -你是一位数据库专家。你将获得有关数据库或表的元数据信息,然后提供简要的总结和回答。例如,问题:“数据库 'db_gpt' 中有多少个表?” 答案:“数据库 'db_gpt' 中有 5 个表,分别是 'book'、'book_category'、'borrower'、'borrowing' 和 'category'。” -根据以下数据库元数据信息,为用户提供专业简洁的答案。如果无法从提供的内容中获取答案,请说:“知识库中提供的信息不足以回答此问题。” 禁止随意捏造信息。 -数据库元数据信息: +根据要求和问题,提供专业的答案。如果无法从提供的内容中获取答案,请说:“知识库中提供的信息不足以回答此问题。” 禁止随意捏造信息。 + +使用一下表结构信息: {table_info} + 问题: {input} +一步步思考 """ _DEFAULT_TEMPLATE = (