diff --git a/app/store/app.ts b/app/store/app.ts index 60d0f932cbf..05be1a139e8 100644 --- a/app/store/app.ts +++ b/app/store/app.ts @@ -383,14 +383,15 @@ export const useChatStore = create()( } //Add system prompt - const SYSTEM_PROMPT = process.env.SYSTEM_PROMPT?.toString() ?? ""; - const systemMessage: Message = { - content: SYSTEM_PROMPT, - role: "system", - date: "", - }; + if (process.env.NEXT_PUBLIC_SYSTEM_PROMPT != undefined) { + const systemMessage: Message = { + content: `${process.env.NEXT_PUBLIC_SYSTEM_PROMPT}`, + role: "system", + date: "", + }; - recentMessages.unshift(systemMessage); + recentMessages.unshift(systemMessage); + } return recentMessages; },