This commit is contained in:
Max 2023-04-26 19:23:38 +08:00
parent 52a15bab2f
commit 4e37119714
3 changed files with 4 additions and 3 deletions

View file

@ -38,6 +38,8 @@ env:
MONGO_TEST_USER: "root" MONGO_TEST_USER: "root"
MONGO_TEST_PASS: "123456" MONGO_TEST_PASS: "123456"
OPENAI_TEST_KEY: ${{ secrets.OPENAI_TEST_KEY }}
TAB_NAME: "::PET ADMIN" TAB_NAME: "::PET ADMIN"
PAGE_SIZE: "20" PAGE_SIZE: "20"
PAGE_LINK: "https://yaoapps.com" PAGE_LINK: "https://yaoapps.com"

View file

@ -42,6 +42,8 @@ env:
MONGO_TEST_USER: "root" MONGO_TEST_USER: "root"
MONGO_TEST_PASS: "123456" MONGO_TEST_PASS: "123456"
OPENAI_TEST_KEY: ${{ secrets.OPENAI_TEST_KEY }}
TAB_NAME: "::PET ADMIN" TAB_NAME: "::PET ADMIN"
PAGE_SIZE: "20" PAGE_SIZE: "20"
PAGE_LINK: "https://yaoapps.com" PAGE_LINK: "https://yaoapps.com"

View file

@ -8,7 +8,6 @@ import (
"github.com/yaoapp/gou/connector" "github.com/yaoapp/gou/connector"
"github.com/yaoapp/gou/http" "github.com/yaoapp/gou/http"
"github.com/yaoapp/kun/exception" "github.com/yaoapp/kun/exception"
"github.com/yaoapp/kun/utils"
) )
// Tiktoken get number of tokens // Tiktoken get number of tokens
@ -187,8 +186,6 @@ func (openai OpenAI) stream(path string, payload map[string]interface{}, cb func
func (openai OpenAI) isError(res *http.Response) *exception.Exception { func (openai OpenAI) isError(res *http.Response) *exception.Exception {
if res.Status != 200 { if res.Status != 200 {
utils.Dump(res)
message := "OpenAI Error" message := "OpenAI Error"
if data, ok := res.Data.(map[string]interface{}); ok { if data, ok := res.Data.(map[string]interface{}); ok {
if err, has := data["error"]; has { if err, has := data["error"]; has {