diff --git a/README.md b/README.md index 1566518..e6e7547 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ func main() { // 把JWT放到这里 jwt := "xxx" - chat := chatgpt.NewChat(jwt) + chat := chatgpt.NewChatGPT(jwt) talk, err := chat.Talk("你好,我的名字叫陈二!") if err != nil { fmt.Println(err.Error()) diff --git a/chatgpt.go b/chatgpt.go index 78cde25..df930f8 100644 --- a/chatgpt.go +++ b/chatgpt.go @@ -94,7 +94,7 @@ type ChatGPT struct { parentMessageID string } -func NewChat(jwt string) *ChatGPT { +func NewChatGPT(jwt string) *ChatGPT { return &ChatGPT{ jwt: jwt, authorization: "Bearer " + jwt, diff --git a/chatgpt_test.go b/chatgpt_test.go index a0c4a43..d0248f7 100644 --- a/chatgpt_test.go +++ b/chatgpt_test.go @@ -10,7 +10,7 @@ func TestFoo(t *testing.T) { // 把JWT Token放到这里 jwt := "xxxx" - chat := NewChat(jwt) + chat := NewChatGPT(jwt) talk, err := chat.Talk("你好,我的名字叫陈二!") assert.Nil(t, err) t.Log(talk.Message.Content) diff --git a/example/main.go b/example/main.go index 9c321d3..6d7c2f4 100644 --- a/example/main.go +++ b/example/main.go @@ -10,7 +10,7 @@ func main() { // 把JWT放到这里 jwt := "xxx" - chat := chatgpt.NewChat(jwt) + chat := chatgpt.NewChatGPT(jwt) talk, err := chat.Talk("你好,我的名字叫陈二!") if err != nil { fmt.Println(err.Error())