From 1290ed84497ad61bfb1db4191e3792c13c632dee Mon Sep 17 00:00:00 2001 From: Antonio Date: Fri, 16 Jun 2023 16:51:29 +0800 Subject: [PATCH] default enable history --- typings/chatgpt/request.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/typings/chatgpt/request.go b/typings/chatgpt/request.go index dafab11..b6eb574 100644 --- a/typings/chatgpt/request.go +++ b/typings/chatgpt/request.go @@ -1,6 +1,10 @@ package chatgpt -import "github.com/google/uuid" +import ( + "os" + + "github.com/google/uuid" +) type chatgpt_message struct { ID uuid.UUID `json:"id"` @@ -29,11 +33,12 @@ type ChatGPTRequest struct { } func NewChatGPTRequest() ChatGPTRequest { + disable_history := os.Getenv("DISABLE_HISTORY") == "" return ChatGPTRequest{ Action: "next", ParentMessageID: uuid.NewString(), Model: "text-davinci-002-render-sha", - HistoryAndTrainingDisabled: true, + HistoryAndTrainingDisabled: disable_history, } }