diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx index 75316308eca7beff76b27fe97b1ada073e3469dd..45193df5722587f410ee22f69b8e54dd4d703259 100644 --- a/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx +++ b/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx @@ -1,21 +1,10 @@ -import { - Chats, - CircleNotch, - Gear, - PaperPlaneRight, - Quotes, -} from "@phosphor-icons/react"; +import { CircleNotch, PaperPlaneRight } from "@phosphor-icons/react"; import React, { useState, useRef } from "react"; -import ManageWorkspace, { - useManageWorkspaceModal, -} from "../../../Modals/MangeWorkspace"; -import useUser from "@/hooks/useUser"; import SlashCommandsButton, { SlashCommands, useSlashCommands, } from "./SlashCommands"; import { isMobile } from "react-device-detect"; -import { Tooltip } from "react-tooltip"; export default function PromptInput({ workspace, @@ -27,10 +16,8 @@ export default function PromptInput({ sendCommand, }) { const { showSlashCommand, setShowSlashCommand } = useSlashCommands(); - const { showing, showModal, hideModal } = useManageWorkspaceModal(); const formRef = useRef(null); const [_, setFocused] = useState(false); - const { user } = useUser(); const handleSubmit = (e) => { setFocused(false); @@ -100,24 +87,6 @@ export default function PromptInput({ </div> <div className="flex justify-between py-3.5"> <div className="flex gap-x-2"> - {user?.role !== "default" && ( - <div> - <Gear - onClick={showModal} - data-tooltip-id="tooltip-workspace-settings-prompt" - data-tooltip-content={`Open the ${workspace.name} workspace settings`} - className="w-7 h-7 text-white/60 hover:text-white cursor-pointer" - weight="fill" - /> - <Tooltip - id="tooltip-workspace-settings-prompt" - place="top" - delayShow={300} - className="tooltip !text-xs z-99" - /> - </div> - )} - <ChatModeSelector workspace={workspace} /> <SlashCommandsButton showing={showSlashCommand} setShowSlashCommand={setShowSlashCommand} @@ -127,44 +96,6 @@ export default function PromptInput({ </div> </div> </form> - {showing && ( - <ManageWorkspace hideModal={hideModal} providedSlug={workspace.slug} /> - )} - </div> - ); -} - -function ChatModeSelector({ workspace }) { - const STORAGE_KEY = `workspace_chat_mode_${workspace.slug}`; - const [chatMode, setChatMode] = useState( - window.localStorage.getItem(STORAGE_KEY) ?? "chat" - ); - - function toggleMode() { - const newChatMode = chatMode === "chat" ? "query" : "chat"; - setChatMode(newChatMode); - window.localStorage.setItem(STORAGE_KEY, newChatMode); - } - - const ModeIcon = chatMode === "chat" ? Chats : Quotes; - return ( - <div - data-tooltip-id="chat-mode-toggle" - data-tooltip-content={`You are currently in ${chatMode} mode. Click to switch to ${ - chatMode === "chat" ? "query" : "chat" - } mode.`} - > - <ModeIcon - onClick={toggleMode} - className="w-7 h-7 text-white/60 hover:text-white cursor-pointer" - weight="fill" - /> - <Tooltip - id="chat-mode-toggle" - place="top" - delayShow={300} - className="tooltip !text-xs z-99" - /> </div> ); } diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/index.jsx index 543d6105e5b7019ce4d9c5860766691b1e2a1879..8a99a62a2eb9381a242d0416a9df09e1dbcc24e4 100644 --- a/frontend/src/components/WorkspaceChat/ChatContainer/index.jsx +++ b/frontend/src/components/WorkspaceChat/ChatContainer/index.jsx @@ -77,9 +77,6 @@ export default function ChatContainer({ workspace, knownHistory = [] }) { await Workspace.threads.streamChat( { workspaceSlug: workspace.slug, threadSlug }, promptMessage.userMessage, - window.localStorage.getItem( - `workspace_chat_mode_${workspace.slug}` - ) ?? "chat", (chatResult) => handleChat( chatResult, @@ -93,9 +90,6 @@ export default function ChatContainer({ workspace, knownHistory = [] }) { await Workspace.streamChat( workspace, promptMessage.userMessage, - window.localStorage.getItem( - `workspace_chat_mode_${workspace.slug}` - ) ?? "chat", (chatResult) => handleChat( chatResult, diff --git a/frontend/src/index.css b/frontend/src/index.css index b9e6976da2436154911eb623d22a7743cf846aae..2c43798221b7e3991a72dcc9776598d87589f1ba 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -439,3 +439,7 @@ dialog::backdrop { .slide-up { animation: slideUp 0.3s ease-out forwards; } + +.input-label { + @apply text-[14px] font-bold text-white; +} diff --git a/frontend/src/models/workspace.js b/frontend/src/models/workspace.js index 3b31646dfdc7e8a8a63c7a64a26f554215c3da6d..d77e2ad5592b248333db683f66855a0c84862fc3 100644 --- a/frontend/src/models/workspace.js +++ b/frontend/src/models/workspace.js @@ -73,11 +73,11 @@ const Workspace = { .catch(() => false); return result; }, - streamChat: async function ({ slug }, message, mode = "query", handleChat) { + streamChat: async function ({ slug }, message, handleChat) { const ctrl = new AbortController(); await fetchEventSource(`${API_BASE}/workspace/${slug}/stream-chat`, { method: "POST", - body: JSON.stringify({ message, mode }), + body: JSON.stringify({ message }), headers: baseHeaders(), signal: ctrl.signal, openWhenHidden: true, diff --git a/frontend/src/models/workspaceThread.js b/frontend/src/models/workspaceThread.js index 256ea496ebd6ec1a72662ad460b27124e4110a17..f9fad31738e0b768445216f1824c9e3becb8062c 100644 --- a/frontend/src/models/workspaceThread.js +++ b/frontend/src/models/workspaceThread.js @@ -77,7 +77,6 @@ const WorkspaceThread = { streamChat: async function ( { workspaceSlug, threadSlug }, message, - mode = "query", handleChat ) { const ctrl = new AbortController(); @@ -85,7 +84,7 @@ const WorkspaceThread = { `${API_BASE}/workspace/${workspaceSlug}/thread/${threadSlug}/stream-chat`, { method: "POST", - body: JSON.stringify({ message, mode }), + body: JSON.stringify({ message }), headers: baseHeaders(), signal: ctrl.signal, openWhenHidden: true, diff --git a/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatHistorySettings/index.jsx b/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatHistorySettings/index.jsx index 29083574c3905908d992b9417d59b688a3ab13e0..9d46bc3bf4ba32a42ce6b99ff2192fa49d6c1d43 100644 --- a/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatHistorySettings/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatHistorySettings/index.jsx @@ -2,10 +2,7 @@ export default function ChatHistorySettings({ workspace, setHasChanges }) { return ( <div> <div className="flex flex-col gap-y-1 mb-4"> - <label - htmlFor="name" - className="block mb-2 text-sm font-medium text-white" - > + <label htmlFor="name" className="block mb-2 input-label"> Chat History </label> <p className="text-white text-opacity-60 text-xs font-medium"> diff --git a/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatModeSelection/index.jsx b/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatModeSelection/index.jsx new file mode 100644 index 0000000000000000000000000000000000000000..0b3bb3b71ee71546a2648d394c2e0cdf3728a13f --- /dev/null +++ b/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatModeSelection/index.jsx @@ -0,0 +1,57 @@ +import { useState } from "react"; +export default function ChatModeSelection({ workspace, setHasChanges }) { + const [chatMode, setChatMode] = useState(workspace?.chatMode || "chat"); + + return ( + <div> + <div className="flex flex-col"> + <label htmlFor="chatMode" className="block input-label"> + Chat mode + </label> + </div> + + <div className="flex flex-col gap-y-1 mt-2"> + <div className="w-fit flex gap-x-1 items-center p-1 rounded-lg bg-zinc-800 "> + <input type="hidden" name="chatMode" value={chatMode} /> + <button + type="button" + disabled={chatMode === "chat"} + onClick={() => { + setChatMode("chat"); + setHasChanges(true); + }} + className="transition-bg duration-200 px-6 py-1 text-md text-white/60 disabled:text-white bg-transparent disabled:bg-[#687280] rounded-md" + > + Chat + </button> + <button + type="button" + disabled={chatMode === "query"} + onClick={() => { + setChatMode("query"); + setHasChanges(true); + }} + className="transition-bg duration-200 px-6 py-1 text-md text-white/60 disabled:text-white bg-transparent disabled:bg-[#687280] rounded-md" + > + Query + </button> + </div> + <p className="text-sm text-white/60"> + {chatMode === "chat" ? ( + <> + <b>Chat</b> will provide answers with the LLM's general knowledge{" "} + <i className="font-semibold">and</i> document context that is + found. + </> + ) : ( + <> + <b>Query</b> will provide answers{" "} + <i className="font-semibold">only</i> if document context is + found. + </> + )} + </p> + </div> + </div> + ); +} diff --git a/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatModelSelection/index.jsx b/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatModelSelection/index.jsx index 7affa88fcd18b98dc77e4becbd99a0fec41f713c..3ef7bb7aca164367408a68590cdb59d377278e59 100644 --- a/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatModelSelection/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatModelSelection/index.jsx @@ -16,10 +16,7 @@ export default function ChatModelSelection({ return ( <div> <div className="flex flex-col"> - <label - htmlFor="name" - className="block text-sm font-medium text-white" - > + <label htmlFor="name" className="block input-label"> Chat model </label> <p className="text-white text-opacity-60 text-xs font-medium py-1.5"> @@ -44,7 +41,7 @@ export default function ChatModelSelection({ return ( <div> <div className="flex flex-col"> - <label htmlFor="name" className="block text-sm font-medium text-white"> + <label htmlFor="name" className="block input-label"> Chat model{" "} <span className="font-normal">({settings?.LLMProvider})</span> </label> diff --git a/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatPromptSettings/index.jsx b/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatPromptSettings/index.jsx index 63b309ad695607aec38ab519b55342c5e2272830..7ac0c10a3fb62d78790a58f05124057f5dfd8da6 100644 --- a/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatPromptSettings/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatPromptSettings/index.jsx @@ -4,7 +4,7 @@ export default function ChatPromptSettings({ workspace, setHasChanges }) { return ( <div> <div className="flex flex-col"> - <label htmlFor="name" className="block text-sm font-medium text-white"> + <label htmlFor="name" className="block input-label"> Prompt </label> <p className="text-white text-opacity-60 text-xs font-medium py-1.5"> diff --git a/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatTemperatureSettings/index.jsx b/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatTemperatureSettings/index.jsx index 563211629807d35b025fb3975400c1b700d8d141..bd2178a67d0c54f741eea85cf80e0cb252a326ce 100644 --- a/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatTemperatureSettings/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatTemperatureSettings/index.jsx @@ -16,7 +16,7 @@ export default function ChatTemperatureSettings({ return ( <div> <div className="flex flex-col"> - <label htmlFor="name" className="block text-sm font-medium text-white"> + <label htmlFor="name" className="block input-label"> LLM Temperature </label> <p className="text-white text-opacity-60 text-xs font-medium py-1.5"> diff --git a/frontend/src/pages/WorkspaceSettings/ChatSettings/index.jsx b/frontend/src/pages/WorkspaceSettings/ChatSettings/index.jsx index d1f5a5014892cea414af62b63964c352e129c0f0..3004b871ce09a376c4a53e1abdc9342f3a5abfe5 100644 --- a/frontend/src/pages/WorkspaceSettings/ChatSettings/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/ChatSettings/index.jsx @@ -7,6 +7,7 @@ import ChatModelSelection from "./ChatModelSelection"; import ChatHistorySettings from "./ChatHistorySettings"; import ChatPromptSettings from "./ChatPromptSettings"; import ChatTemperatureSettings from "./ChatTemperatureSettings"; +import ChatModeSelection from "./ChatModeSelection"; export default function ChatSettings({ workspace }) { const [settings, setSettings] = useState({}); @@ -48,6 +49,7 @@ export default function ChatSettings({ workspace }) { onSubmit={handleUpdate} className="w-1/2 flex flex-col gap-y-6" > + <ChatModeSelection workspace={workspace} setHasChanges={setHasChanges} /> <ChatModelSelection settings={settings} workspace={workspace} diff --git a/frontend/src/pages/WorkspaceSettings/GeneralAppearance/SuggestedChatMessages/index.jsx b/frontend/src/pages/WorkspaceSettings/GeneralAppearance/SuggestedChatMessages/index.jsx index 0713f029e216a2b8671ba2b955a64d0e5ecae3db..12bc2e97de047d42630d2c527f44a6e7a9a468ad 100644 --- a/frontend/src/pages/WorkspaceSettings/GeneralAppearance/SuggestedChatMessages/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/GeneralAppearance/SuggestedChatMessages/index.jsx @@ -91,9 +91,7 @@ export default function SuggestedChatMessages({ slug }) { if (loading) return ( <div className="flex flex-col"> - <label className="block text-sm font-medium text-white"> - Suggested Chat Messages - </label> + <label className="block input-label">Suggested Chat Messages</label> <p className="text-white text-opacity-60 text-xs font-medium py-1.5"> Customize the messages that will be suggested to your workspace users. </p> @@ -105,9 +103,7 @@ export default function SuggestedChatMessages({ slug }) { return ( <div className="w-screen"> <div className="flex flex-col"> - <label className="block text-sm font-medium text-white"> - Suggested Chat Messages - </label> + <label className="block input-label">Suggested Chat Messages</label> <p className="text-white text-opacity-60 text-xs font-medium py-1.5"> Customize the messages that will be suggested to your workspace users. </p> diff --git a/frontend/src/pages/WorkspaceSettings/GeneralAppearance/VectorCount/index.jsx b/frontend/src/pages/WorkspaceSettings/GeneralAppearance/VectorCount/index.jsx index 898ab7964afc61bc58111d0557cf4e93e89e5238..9a882875f8f2d80f8a6318de09562445dfe432f7 100644 --- a/frontend/src/pages/WorkspaceSettings/GeneralAppearance/VectorCount/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/GeneralAppearance/VectorCount/index.jsx @@ -16,7 +16,7 @@ export default function VectorCount({ reload, workspace }) { if (totalVectors === null) return ( <div> - <h3 className="text-white text-sm font-semibold">Number of vectors</h3> + <h3 className="input-label">Number of vectors</h3> <p className="text-white text-opacity-60 text-xs font-medium py-1"> Total number of vectors in your vector database. </p> @@ -27,7 +27,7 @@ export default function VectorCount({ reload, workspace }) { ); return ( <div> - <h3 className="text-white text-sm font-semibold">Number of vectors</h3> + <h3 className="input-label">Number of vectors</h3> <p className="text-white text-opacity-60 text-xs font-medium py-1"> Total number of vectors in your vector database. </p> diff --git a/frontend/src/pages/WorkspaceSettings/GeneralAppearance/WorkspaceName/index.jsx b/frontend/src/pages/WorkspaceSettings/GeneralAppearance/WorkspaceName/index.jsx index 8b75977b7d3b9154cea145cd46c6b65ae3eab17c..b7c7f30f13617a9d79e997d796da887e1b0dba3b 100644 --- a/frontend/src/pages/WorkspaceSettings/GeneralAppearance/WorkspaceName/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/GeneralAppearance/WorkspaceName/index.jsx @@ -2,7 +2,7 @@ export default function WorkspaceName({ workspace, setHasChanges }) { return ( <div> <div className="flex flex-col"> - <label htmlFor="name" className="block text-sm font-medium text-white"> + <label htmlFor="name" className="block input-label"> Workspace Name </label> <p className="text-white text-opacity-60 text-xs font-medium py-1.5"> diff --git a/frontend/src/pages/WorkspaceSettings/VectorDatabase/DocumentSimilarityThreshold/index.jsx b/frontend/src/pages/WorkspaceSettings/VectorDatabase/DocumentSimilarityThreshold/index.jsx index e627962eef3c2eb507b4b199cfbc5fb43bdfb370..122e1144b0bfd922333a92cd9a2c329b486cd5b4 100644 --- a/frontend/src/pages/WorkspaceSettings/VectorDatabase/DocumentSimilarityThreshold/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/VectorDatabase/DocumentSimilarityThreshold/index.jsx @@ -5,7 +5,7 @@ export default function DocumentSimilarityThreshold({ return ( <div> <div className="flex flex-col"> - <label htmlFor="name" className="block text-sm font-medium text-white"> + <label htmlFor="name" className="block input-label"> Document similarity threshold </label> <p className="text-white text-opacity-60 text-xs font-medium py-1.5"> diff --git a/frontend/src/pages/WorkspaceSettings/VectorDatabase/MaxContextSnippets/index.jsx b/frontend/src/pages/WorkspaceSettings/VectorDatabase/MaxContextSnippets/index.jsx index ba3f4c4fd8426bf00c710e339999fd8e2456eb81..504779066c298a86a86efef89f73277f59b96b3a 100644 --- a/frontend/src/pages/WorkspaceSettings/VectorDatabase/MaxContextSnippets/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/VectorDatabase/MaxContextSnippets/index.jsx @@ -2,7 +2,7 @@ export default function MaxContextSnippets({ workspace, setHasChanges }) { return ( <div> <div className="flex flex-col"> - <label htmlFor="name" className="block text-sm font-medium text-white"> + <label htmlFor="name" className="block input-label"> Max Context Snippets </label> <p className="text-white text-opacity-60 text-xs font-medium py-1.5"> diff --git a/frontend/src/pages/WorkspaceSettings/VectorDatabase/VectorDBIdentifier/index.jsx b/frontend/src/pages/WorkspaceSettings/VectorDatabase/VectorDBIdentifier/index.jsx index c57e7d4d830bb4f13ac117680383e2c76db8c246..9140d7fc0f76839566f5bd177ee7ef5f40b76230 100644 --- a/frontend/src/pages/WorkspaceSettings/VectorDatabase/VectorDBIdentifier/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/VectorDatabase/VectorDBIdentifier/index.jsx @@ -1,13 +1,9 @@ export default function VectorDBIdentifier({ workspace }) { return ( <div> - <h3 className="text-white text-sm font-semibold"> - Vector database identifier - </h3> - <p className="text-white text-opacity-60 text-xs font-medium py-1"> </p> - <p className="text-white text-opacity-60 text-sm font-medium"> - {workspace?.slug} - </p> + <h3 className="input-label">Vector database identifier</h3> + <p className="text-white/60 text-xs font-medium py-1"> </p> + <p className="text-white/60 text-sm">{workspace?.slug}</p> </div> ); } diff --git a/server/endpoints/chat.js b/server/endpoints/chat.js index 756944bea21a7acbcb4f2b55ea1c4d659682c0ff..a08b36e24358550d2eb6d6d7f81c7695d3046286 100644 --- a/server/endpoints/chat.js +++ b/server/endpoints/chat.js @@ -1,14 +1,10 @@ const { v4: uuidv4 } = require("uuid"); const { reqBody, userFromSession, multiUserMode } = require("../utils/http"); -const { Workspace } = require("../models/workspace"); const { validatedRequest } = require("../utils/middleware/validatedRequest"); const { WorkspaceChats } = require("../models/workspaceChats"); const { SystemSettings } = require("../models/systemSettings"); const { Telemetry } = require("../models/telemetry"); -const { - streamChatWithWorkspace, - VALID_CHAT_MODE, -} = require("../utils/chats/stream"); +const { streamChatWithWorkspace } = require("../utils/chats/stream"); const { ROLES, flexUserRoleValid, @@ -16,6 +12,7 @@ const { const { EventLogs } = require("../models/eventLogs"); const { validWorkspaceAndThreadSlug, + validWorkspaceSlug, } = require("../utils/middleware/validWorkspace"); const { writeResponseChunk } = require("../utils/helpers/chat/responses"); @@ -24,32 +21,21 @@ function chatEndpoints(app) { app.post( "/workspace/:slug/stream-chat", - [validatedRequest, flexUserRoleValid([ROLES.all])], + [validatedRequest, flexUserRoleValid([ROLES.all]), validWorkspaceSlug], async (request, response) => { try { const user = await userFromSession(request, response); - const { slug } = request.params; - const { message, mode = "query" } = reqBody(request); - - const workspace = multiUserMode(response) - ? await Workspace.getWithUser(user, { slug }) - : await Workspace.get({ slug }); - - if (!workspace) { - response.sendStatus(400).end(); - return; - } + const { message } = reqBody(request); + const workspace = response.locals.workspace; - if (!message?.length || !VALID_CHAT_MODE.includes(mode)) { + if (!message?.length) { response.status(400).json({ id: uuidv4(), type: "abort", textResponse: null, sources: [], close: true, - error: !message?.length - ? "Message is empty." - : `${mode} is not a valid mode.`, + error: !message?.length ? "Message is empty." : null, }); return; } @@ -95,7 +81,13 @@ function chatEndpoints(app) { } } - await streamChatWithWorkspace(response, workspace, message, mode, user); + await streamChatWithWorkspace( + response, + workspace, + message, + workspace?.chatMode, + user + ); await Telemetry.sendTelemetry("sent_chat", { multiUserMode: multiUserMode(response), LLMSelection: process.env.LLM_PROVIDER || "openai", @@ -137,20 +129,18 @@ function chatEndpoints(app) { async (request, response) => { try { const user = await userFromSession(request, response); - const { message, mode = "query" } = reqBody(request); + const { message } = reqBody(request); const workspace = response.locals.workspace; const thread = response.locals.thread; - if (!message?.length || !VALID_CHAT_MODE.includes(mode)) { + if (!message?.length) { response.status(400).json({ id: uuidv4(), type: "abort", textResponse: null, sources: [], close: true, - error: !message?.length - ? "Message is empty." - : `${mode} is not a valid mode.`, + error: !message?.length ? "Message is empty." : null, }); return; } @@ -202,7 +192,7 @@ function chatEndpoints(app) { response, workspace, message, - mode, + workspace?.chatMode, user, thread ); diff --git a/server/models/workspace.js b/server/models/workspace.js index 9cc142e74ab5fbb1626d9ec8b91a7fb20ce25620..92c2f9e36257604317a464b7b6b5b4579dd788d2 100644 --- a/server/models/workspace.js +++ b/server/models/workspace.js @@ -18,6 +18,7 @@ const Workspace = { "similarityThreshold", "chatModel", "topN", + "chatMode", ], new: async function (name = null, creatorId = null) { @@ -59,7 +60,7 @@ const Workspace = { try { const workspace = await prisma.workspaces.update({ where: { id }, - data, + data, // TODO: strict validation on writables here. }); return { workspace, message: null }; } catch (error) { diff --git a/server/prisma/migrations/20240216214639_init/migration.sql b/server/prisma/migrations/20240216214639_init/migration.sql new file mode 100644 index 0000000000000000000000000000000000000000..368782bc9b550516872f251e8d602af7b5d22ebc --- /dev/null +++ b/server/prisma/migrations/20240216214639_init/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "workspaces" ADD COLUMN "chatMode" TEXT DEFAULT 'chat'; diff --git a/server/prisma/schema.prisma b/server/prisma/schema.prisma index 55b469cfc1b6b196ef471d3c886ddce7e6d76992..77b25c8de741f61159958995c9197d00fce51484 100644 --- a/server/prisma/schema.prisma +++ b/server/prisma/schema.prisma @@ -98,6 +98,7 @@ model workspaces { similarityThreshold Float? @default(0.25) chatModel String? topN Int? @default(4) + chatMode String? @default("chat") workspace_users workspace_users[] documents workspace_documents[] workspace_suggested_messages workspace_suggested_messages[]