mirror of
https://github.com/sqlchat/sqlchat.git
synced 2026-03-13 07:59:44 +08:00
chore: declare bots id
This commit is contained in:
@@ -21,7 +21,7 @@ const QueryDrawer = () => {
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const context = queryStore.context;
|
||||
const executionMessage = executionResult ? getMessageFromExecutionResult(executionResult) : "";
|
||||
const showExecutionWarningBanner = !checkStatementIsSelect(statement);
|
||||
const showExecutionWarningBanner = statement.trim() && !checkStatementIsSelect(statement);
|
||||
|
||||
useEffect(() => {
|
||||
if (!queryStore.showDrawer) {
|
||||
|
||||
@@ -2,6 +2,9 @@ import { first } from "lodash-es";
|
||||
import { Assistant, Id } from "@/types";
|
||||
import * as customAssistantList from "../../assistants";
|
||||
|
||||
export const GeneralBotId = "general-bot";
|
||||
export const SQLChatBotId = "sql-chat-bot";
|
||||
|
||||
export const assistantList: Assistant[] = Object.keys(customAssistantList).map((name) => {
|
||||
return {
|
||||
...((customAssistantList as any)[name].default as Assistant),
|
||||
|
||||
@@ -3,11 +3,12 @@ import { create } from "zustand";
|
||||
import { persist } from "zustand/middleware";
|
||||
import { Conversation, Id } from "@/types";
|
||||
import { generateUUID } from "@/utils";
|
||||
import { GeneralBotId, SQLChatBotId } from ".";
|
||||
|
||||
const getDefaultConversation = (): Conversation => {
|
||||
return {
|
||||
id: generateUUID(),
|
||||
assistantId: "general-bot",
|
||||
assistantId: GeneralBotId,
|
||||
title: dayjs().format("LTS"),
|
||||
createdAt: Date.now(),
|
||||
};
|
||||
@@ -36,7 +37,7 @@ export const useConversationStore = create<ConversationState>()(
|
||||
databaseName,
|
||||
};
|
||||
if (connectionId) {
|
||||
conversation.assistantId = "sql-chat-bot";
|
||||
conversation.assistantId = SQLChatBotId;
|
||||
}
|
||||
set((state) => ({
|
||||
conversationList: [...state.conversationList, conversation],
|
||||
|
||||
Reference in New Issue
Block a user