fix channel test
This commit is contained in:
parent
e8b50b3e78
commit
8bfea688a7
@ -58,7 +58,7 @@ func testChannel(channel *model.Channel, request ChatRequest) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if response.Usage.CompletionTokens == 0 {
|
||||
if response.Id == "" {
|
||||
return errors.New(fmt.Sprintf("type %s, code %v, message %s", response.Error.Type, response.Error.Code, response.Error.Message))
|
||||
}
|
||||
return nil
|
||||
|
@ -70,6 +70,7 @@ type OpenAIErrorWithStatusCode struct {
|
||||
}
|
||||
|
||||
type TextResponse struct {
|
||||
Id string `json:"id"`
|
||||
Usage `json:"usage"`
|
||||
Error OpenAIError `json:"error"`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user