From 9a680128a940016d4a7795883209e9f495508ef2 Mon Sep 17 00:00:00 2001 From: angelplusultra Date: Fri, 3 Oct 2025 15:31:43 -0700 Subject: [PATCH 1/3] Add Default System Prompt Management - Introduced a new route for fetching and updating the default system prompt in the backend. - Added a new Admin page for managing the default system prompt, including a form for editing and saving changes. - Updated the SettingsSidebar to include a link to the new Default System Prompt page. - Implemented fetching of available system prompt variables for use in the prompt editor. - Enhanced the ChatSettings and ChatPromptSettings components to support the new default system prompt functionality. This commit lays the groundwork for improved management of system prompts across workspaces. --- frontend/src/App.jsx | 7 + .../src/components/SettingsSidebar/index.jsx | 6 + frontend/src/models/system.js | 29 ++ .../pages/Admin/DefaultSystemPrompt/index.jsx | 267 ++++++++++++++++++ .../ChatSettings/ChatPromptSettings/index.jsx | 125 ++++---- .../WorkspaceSettings/ChatSettings/index.jsx | 16 +- frontend/src/utils/chat/index.js | 2 +- frontend/src/utils/paths.js | 3 + server/endpoints/system.js | 56 ++++ server/models/systemSettings.js | 3 + server/models/workspace.js | 41 ++- 11 files changed, 485 insertions(+), 70 deletions(-) create mode 100644 frontend/src/pages/Admin/DefaultSystemPrompt/index.jsx diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index a2bed2ecca5..e172bd1a8ba 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -92,6 +92,9 @@ const SystemPromptVariables = lazy( const MobileConnections = lazy( () => import("@/pages/GeneralSettings/MobileConnections") ); +const DefaultSystemPrompt = lazy( + () => import("@/pages/Admin/DefaultSystemPrompt") +); export default function App() { return ( @@ -217,6 +220,10 @@ export default function App() { path="/settings/system-prompt-variables" element={} /> + } + /> ( href: paths.settings.invites(), roles: ["admin", "manager"], }, + { + btnText: "Default System Prompt", + href: paths.settings.defaultSystemPrompt(), + flex: true, + roles: ["admin"], + }, ]} />