This commit is contained in:
Liang Ding 2023-03-05 11:49:57 +08:00
parent ba400854b0
commit 69c18db9ed
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
4 changed files with 81 additions and 9 deletions

View file

@ -45,6 +45,18 @@ func ChatGPT(msg string) (ret string) {
return
}
func ChatGPTTranslate(msg string, lang string) (ret string) {
msg = "Translate to " + lang + ":\n" + msg
ret, _ = ChatGPTContinueWrite(msg, nil)
return
}
func ChatGPTSummary(msg string, lang string) (ret string) {
msg = "Summarized as follows, the result is in {" + lang + "}:\n" + msg
ret, _ = ChatGPTContinueWrite(msg, nil)
return
}
func ChatGPTContinueWrite(msg string, contextMsgs []string) (ret string, retContextMsgs []string) {
if "" == OpenAIAPIKey {
return