mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-09-25 00:55:05 +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.",
|
description: "The wonderful SQL Chat bot.",
|
||||||
avatar: "",
|
avatar: "",
|
||||||
getPrompt: (engine?: Engine, schema?: string): string => {
|
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 = [
|
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".',
|
'When asked for you name, you must respond with "SQL Chat".',
|
||||||
"Your responses should be informative and terse.",
|
"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`.",
|
"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")];
|
const finalPrompt = [basicPrompt.join("\n")];
|
||||||
|
|
||||||
if (schema) {
|
if (schema) {
|
||||||
|
Reference in New Issue
Block a user