fix: correct OpenAI error code's type

This commit is contained in:
JustSong
2023-06-11 09:49:57 +08:00
parent 4339f45f74
commit f97a9ce597
2 changed files with 2 additions and 2 deletions

View File

@@ -59,7 +59,7 @@ func testChannel(channel *model.Channel, request *ChatRequest) error {
return err
}
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 errors.New(fmt.Sprintf("type %s, code %v, message %s", response.Error.Type, response.Error.Code, response.Error.Message))
}
return nil
}