mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-07-29 02:04:48 +08:00
chore: update prompts for code block language
This commit is contained in:
@ -37,7 +37,7 @@ export const CodeBlock = (props: Props) => {
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<SyntaxHighlighter language={language} style={oneDark} customStyle={{ margin: 0 }}>
|
||||
<SyntaxHighlighter language={language.toLowerCase()} style={oneDark} customStyle={{ margin: 0 }}>
|
||||
{value}
|
||||
</SyntaxHighlighter>
|
||||
</div>
|
||||
|
@ -193,7 +193,7 @@ const ConnectionSidebar = () => {
|
||||
) : (
|
||||
<Icon.IoChatbubbleOutline className="w-5 h-auto mr-1.5 opacity-80 shrink-0" />
|
||||
)}
|
||||
<span className="truncate">{chat.title || "SQL Chat"}</span>
|
||||
<span className="truncate grow">{chat.title || "SQL Chat"}</span>
|
||||
<span
|
||||
className="ml-0.5 shrink-0 opacity-60 hidden group-hover:block hover:opacity-80"
|
||||
onClick={(e) => {
|
||||
|
@ -18,9 +18,12 @@ export const getAssistantById = (id: Id) => {
|
||||
|
||||
// getPromptOfAssistant define the special prompt for each assistant.
|
||||
export const getPromptGeneratorOfAssistant = (assistant: User) => {
|
||||
const basicPrompt = `Please follow the instructions to answer the questions.
|
||||
1. Set the language to the markdown code block for each code block. For example, \`SELECT * FROM table\` is SQL.
|
||||
`;
|
||||
if (assistant.id === "sql-assistant") {
|
||||
return (schema: string) =>
|
||||
`This is my database schema"${schema}". You will see the tables and columns in the database. And please answer the following questions about the database.`;
|
||||
`This is my database schema"${schema}". You will see the tables and columns in the database. And please answer the following questions about the database.\n${basicPrompt}`;
|
||||
}
|
||||
return () => "";
|
||||
return () => `\n${basicPrompt}`;
|
||||
};
|
||||
|
Reference in New Issue
Block a user