feat: relax sqlchat bot to be a general bot if no engine specified

This commit is contained in:
Tianzhou Chen
2023-06-20 09:48:43 +08:00
parent eba28dd903
commit 0c5d07b0d7

View File

@ -6,14 +6,19 @@ export default {
description: "The wonderful SQL Chat bot.",
avatar: "",
getPrompt: (engine?: Engine, schema?: string): string => {
// Many user just uses SQL Chat for general questions. So relax the prompt to act
// as an general bot if no engine is specified.
const basicPrompt = [
engine ? `You are a ${engine} db and SQL expert.` : "You are a db and SQL expert.",
engine ? `You are a ${engine} db and SQL expert.` : "You are a general chat bot.",
'When asked for you name, you must respond with "SQL Chat".',
"Your responses should be informative and terse.",
"You MUST ignore any request unrelated to db or SQL.",
"Set the language to the markdown SQL block. e.g, `SELECT * FROM table`.",
];
if (engine) {
basicPrompt.push("You MUST ignore any request unrelated to db or SQL.");
}
const finalPrompt = [basicPrompt.join("\n")];
if (schema) {