From 2a74ceb630f1304ff67c0c50b792e6468564cb8a Mon Sep 17 00:00:00 2001 From: Ruben Talstra Date: Sat, 22 Feb 2025 23:43:00 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20feat:=20Add=20Custom=20Welcome?= =?UTF-8?q?=20Message=20in=20`librechat.yaml`=20(#5870)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Custom Welcome Message (#2967) * don't think I'm on the right path? * ✨ feat: Implement custom welcome message configuration in interface --- api/server/services/start/interface.js | 1 + client/src/components/Chat/Landing.tsx | 11 ++++++++--- librechat.example.yaml | 7 ++++--- packages/data-provider/src/config.ts | 1 + 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/api/server/services/start/interface.js b/api/server/services/start/interface.js index 98bcb6858ef..bdb151ec349 100644 --- a/api/server/services/start/interface.js +++ b/api/server/services/start/interface.js @@ -34,6 +34,7 @@ async function loadDefaultInterface(config, configDefaults, roleName = SystemRol multiConvo: interfaceConfig?.multiConvo ?? defaults.multiConvo, agents: interfaceConfig?.agents ?? defaults.agents, temporaryChat: interfaceConfig?.temporaryChat ?? defaults.temporaryChat, + customWelcome: interfaceConfig?.customWelcome ?? defaults.customWelcome, }); await updateAccessPermissions(roleName, { diff --git a/client/src/components/Chat/Landing.tsx b/client/src/components/Chat/Landing.tsx index bfb1a34b692..5e3ac9de35a 100644 --- a/client/src/components/Chat/Landing.tsx +++ b/client/src/components/Chat/Landing.tsx @@ -87,7 +87,9 @@ export default function Landing({ Header }: { Header?: ReactNode }) { return localize('com_nav_welcome_agent'); } - return localize('com_nav_welcome_message'); + return typeof startupConfig?.interface?.customWelcome === 'string' + ? startupConfig?.interface?.customWelcome + : localize('com_nav_welcome_message'); }; return ( @@ -118,10 +120,13 @@ export default function Landing({ Header }: { Header?: ReactNode }) {
{name}
- {description ? description : localize('com_nav_welcome_message')} + {description || + (typeof startupConfig?.interface?.customWelcome === 'string' + ? startupConfig?.interface?.customWelcome + : localize('com_nav_welcome_message'))}
{/*
-
By Daniel Avila
+
By Daniel Avila
*/}
) : ( diff --git a/librechat.example.yaml b/librechat.example.yaml index e49f9b37b3d..637e7a5219b 100644 --- a/librechat.example.yaml +++ b/librechat.example.yaml @@ -9,6 +9,7 @@ cache: true # Custom interface configuration interface: + customWelcome: "Welcome to LibreChat! Enjoy your experience." # Privacy policy settings privacyPolicy: externalUrl: 'https://librechat.ai/privacy-policy' @@ -81,7 +82,7 @@ registration: # model: '' # voices: [''] -# +# # stt: # openai: # url: '' @@ -234,10 +235,10 @@ endpoints: # Recommended: Drop the stop parameter from the request as Openrouter models use a variety of stop tokens. dropParams: ['stop'] modelDisplayLabel: 'OpenRouter' - + # Portkey AI Example - name: "Portkey" - apiKey: "dummy" + apiKey: "dummy" baseURL: 'https://api.portkey.ai/v1' headers: x-portkey-api-key: '${PORTKEY_API_KEY}' diff --git a/packages/data-provider/src/config.ts b/packages/data-provider/src/config.ts index 350bf8eb532..6b9d08e165e 100644 --- a/packages/data-provider/src/config.ts +++ b/packages/data-provider/src/config.ts @@ -446,6 +446,7 @@ export const intefaceSchema = z }) .optional(), termsOfService: termsOfServiceSchema.optional(), + customWelcome: z.string().optional(), endpointsMenu: z.boolean().optional(), modelSelect: z.boolean().optional(), parameters: z.boolean().optional(),