secert updated

This commit is contained in:
2026-09-24 17:20:04 +05:30
parent 299871b820
commit 00317a00d8
11 changed files with 517 additions and 81 deletions

View File

@@ -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())
}