chore: update test logic

This commit is contained in:
JustSong 2023-06-08 14:09:39 +08:00
parent c6edb78ac9
commit 9301b3fed3

View File

@ -56,7 +56,7 @@ func testChannel(channel *model.Channel, request *ChatRequest) error {
if err != nil {
return err
}
if response.Error.Message != "" || response.Error.Code != "" {
if response.Usage.CompletionTokens == 0 {
return errors.New(fmt.Sprintf("type %s, code %s, message %s", response.Error.Type, response.Error.Code, response.Error.Message))
}
return nil