secert updated
This commit is contained in:
@@ -112,6 +112,13 @@ func (ctl *AssistantController) Ask(c *fiber.Ctx) error {
|
||||
if errors.As(err, &tooFast) {
|
||||
return assistantRefuse(c, http.StatusTooManyRequests, err.Error())
|
||||
}
|
||||
// The provider's quota, as opposed to our own limiter above. Same status
|
||||
// for the same reason — it is not a bad question, it is a busy minute —
|
||||
// and the message is ours rather than Groq's, which names our billing
|
||||
// account and the tokens-per-minute arithmetic behind it.
|
||||
if errors.Is(err, utils.ErrBusy) {
|
||||
return assistantRefuse(c, http.StatusTooManyRequests, utils.ErrBusy.Error())
|
||||
}
|
||||
return assistantRefuse(c, http.StatusBadRequest, err.Error())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user