mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-07-25 16:13:10 +08:00
feat: relax sqlchat bot to be a general bot if no engine specified
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user