Add getTokenSize()

This commit is contained in:
Yang Luo
2023-05-02 10:04:11 +08:00
parent d699774179
commit cb13d693e6
5 changed files with 54 additions and 3 deletions

View File

@ -19,6 +19,7 @@ import (
"github.com/casdoor/casdoor/object"
"github.com/casdoor/casdoor/proxy"
"github.com/sashabaranov/go-openai"
)
func TestRun(t *testing.T) {
@ -32,3 +33,7 @@ func TestRun(t *testing.T) {
println(text)
}
func TestToken(t *testing.T) {
println(getTokenSize(openai.GPT3TextDavinci003, ""))
}