From 31129919bf125e7c0e52d0c1f6a128fb5bb206d3 Mon Sep 17 00:00:00 2001 From: Bryan Lee <38807139+liby@users.noreply.github.com> Date: Fri, 31 Mar 2023 09:16:02 +0800 Subject: [PATCH] feat: support custom default system prompt (#285) --- .env.local.example | 5 +++-- utils/app/const.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.env.local.example b/.env.local.example index 992bfab..1c0936e 100644 --- a/.env.local.example +++ b/.env.local.example @@ -1,2 +1,3 @@ -OPENAI_API_KEY=YOUR_KEY -DEFAULT_MODEL=gpt-3.5-turbo \ No newline at end of file +DEFAULT_MODEL=gpt-3.5-turbo +DEFAULT_SYSTEM_PROMPT=CUSTOM_SYSTEM_PROMPT +OPENAI_API_KEY=YOUR_KEY \ No newline at end of file diff --git a/utils/app/const.ts b/utils/app/const.ts index 3d01428..4155a3e 100644 --- a/utils/app/const.ts +++ b/utils/app/const.ts @@ -1,5 +1,5 @@ export const DEFAULT_SYSTEM_PROMPT = - "You are ChatGPT, a large language model trained by OpenAI. Follow the user's instructions carefully. Respond using markdown."; + process.env.DEFAULT_SYSTEM_PROMPT || "You are ChatGPT, a large language model trained by OpenAI. Follow the user's instructions carefully. Respond using markdown."; export const OPENAI_API_HOST = process.env.OPENAI_API_HOST || 'https://api.openai.com';