Skip to content

Commit

Permalink
Merge pull request #4 from linjungz/fix-system-prompt
Browse files Browse the repository at this point in the history
Fix system prompt
  • Loading branch information
linjungz authored Apr 6, 2023
2 parents caa2239 + a363275 commit 635fe8e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions app/store/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,14 +383,15 @@ export const useChatStore = create<ChatStore>()(
}

//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;
},
Expand Down

1 comment on commit 635fe8e

@vercel
Copy link

@vercel vercel bot commented on 635fe8e Apr 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.