Parcourir la source

chore: rewrite 429 prompt text (close #96)

JustSong il y a 2 ans
Parent
commit
ced89398a5
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      controller/relay.go

+ 3 - 0
controller/relay.go

@@ -75,6 +75,9 @@ func countToken(text string) int {
 func Relay(c *gin.Context) {
 	err := relayHelper(c)
 	if err != nil {
+		if err.StatusCode == http.StatusTooManyRequests {
+			err.OpenAIError.Message = "负载已满,请稍后再试,或升级账户以提升服务质量。"
+		}
 		c.JSON(err.StatusCode, gin.H{
 			"error": err.OpenAIError,
 		})