fix read config error 🐛

This commit is contained in:
Evan 2022-12-07 15:12:19 +09:00
parent 0081e69728
commit 801e8c68c5
3 changed files with 5 additions and 10 deletions

View File

@ -1,6 +1,3 @@
# wechatgpt
![coming](https://media.istockphoto.com/id/1332167985/photo/coming-soon-neon-sign-the-banner-shining-light-signboard-collection.jpg?b=1&s=170667a&w=0&k=20&c=Le4B-lJt-jXjeAOdlTQptNvN_DmRwWF19ShNc5VY4a4=)
# how to use # how to use
## prepare runtime environment ## prepare runtime environment

View File

@ -24,11 +24,9 @@ func init() {
} }
func Handler(msg *openwechat.Message) { func Handler(msg *openwechat.Message) {
if msg.IsSendByGroup() { err := handlers[GroupHandler].handle(msg)
err := handlers[GroupHandler].handle(msg) if err != nil {
if err != nil { log.Errorf("handle error: %s\n", err.Error())
log.Errorf("handle error: %s\n", err.Error()) return
return
}
} }
} }

View File

@ -57,7 +57,7 @@ func Completions(msg string, token string) (*string, error) {
requestBody := ChatGPTRequestBody{ requestBody := ChatGPTRequestBody{
Model: "text-davinci-003", Model: "text-davinci-003",
Prompt: msg, Prompt: msg,
MaxTokens: 100, MaxTokens: 4000,
Temperature: 1, Temperature: 1,
TopP: 1, TopP: 1,
FrequencyPenalty: 0, FrequencyPenalty: 0,