From 7bb68fd28aa8e2f8b91fe041add1ca41feb4cde5 Mon Sep 17 00:00:00 2001 From: steven Date: Wed, 29 Mar 2023 16:59:37 +0800 Subject: [PATCH] chore: update connection creation modal --- components/CreateConnectionModal.tsx | 3 ++- store/assistant.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/CreateConnectionModal.tsx b/components/CreateConnectionModal.tsx index 35367d3..1143345 100644 --- a/components/CreateConnectionModal.tsx +++ b/components/CreateConnectionModal.tsx @@ -32,7 +32,8 @@ const CreateConnectionModal = (props: Props) => { const [isRequesting, setIsRequesting] = useState(false); const showDatabaseField = connection.engineType === Engine.PostgreSQL; const isEditing = editConnection !== undefined; - const allowSave = connection.host !== "" && connection.username !== ""; + const allowSave = + connection.host !== "" && connection.username !== "" && (connection.engineType === Engine.PostgreSQL ? connection.database : true); useEffect(() => { if (show) { diff --git a/store/assistant.ts b/store/assistant.ts index babfa1c..0fc3028 100644 --- a/store/assistant.ts +++ b/store/assistant.ts @@ -18,8 +18,9 @@ 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. + 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. +2. Please be careful to return only key information, and try not to make it too long. `; if (assistant.id === "sql-assistant") { return (schema: string) =>