Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
CC11001100 committed Dec 7, 2022
1 parent 96d8e02 commit 7a26abd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion chatgpt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion chatgpt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 7a26abd

Please sign in to comment.