Skip to content

Commit

Permalink
feat: no length limit
Browse files Browse the repository at this point in the history
  • Loading branch information
pluveto committed Mar 27, 2023
1 parent 13ce2b8 commit 393ef9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
openai "github.com/sashabaranov/go-openai"
)

const kMaxTokens = 4000
const kMaxTokens = 400000

func main() {
apiKey, err := getAPIKey()
Expand Down

2 comments on commit 393ef9a

@vistamin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样改不对的。我大致看了下代码,是因为每次提问,会把之前的的所有历史回答以ChatMessageRoleAssistant的形式再一次提交,这样就会逐步超过4097的限制。

@pluveto
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样改不对的。我大致看了下代码,是因为每次提问,会把之前的的所有历史回答以ChatMessageRoleAssistant的形式再一次提交,这样就会逐步超过4097的限制。
最近很忙,有空的话你可以 PR

Please sign in to comment.