diff --git a/controller/relay-text.go b/controller/relay-text.go index c61c523a..c245be94 100644 --- a/controller/relay-text.go +++ b/controller/relay-text.go @@ -331,6 +331,11 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode { fmt.Errorf("bad status code: %d", resp.StatusCode), "bad_status_code", resp.StatusCode) } + if resp.StatusCode != http.StatusOK { + return errorWrapper( + fmt.Errorf("bad status code: %d", resp.StatusCode), "bad_status_code", resp.StatusCode) + } + var textResponse TextResponse tokenName := c.GetString("token_name") channelId := c.GetInt("channel_id")