diff --git a/README.md b/README.md index 43720606..e2f057b8 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ $ go run main.go $ docker run -itd --name chatgpt-web --restart=always \ -e APIKEY=换成你的key \ -e MODEL=gpt-3.5-turbo-0301 \ + -e BOT_DESC=你是一个AI助手,我需要你模拟一名温柔贴心的女朋友来回答我的问题. \ -e MAX_TOKENS=512 \ -e TEMPREATURE=0.9 \ -e TOP_P=1 \ diff --git a/config/config.go b/config/config.go index 29b6e7b8..0642c8c1 100644 --- a/config/config.go +++ b/config/config.go @@ -69,6 +69,7 @@ func LoadConfig() *Configuration { TopP := os.Getenv("TOP_P") FrequencyPenalty := os.Getenv("FREQ") PresencePenalty := os.Getenv("PRES") + BotDesc := os.Getenv("BOT_DESC") if ApiKey != "" { config.ApiKey = ApiKey } @@ -77,6 +78,11 @@ func LoadConfig() *Configuration { config.Model = Model } + if BotDesc != "" { + config.BotDesc = BotDesc + } + + if MaxTokens != "" { max, err := strconv.Atoi(MaxTokens) if err != nil {