api key integration
This commit is contained in:
@@ -98,6 +98,13 @@ func (ctl *AssistantController) Ask(c *fiber.Ctx) error {
|
||||
"message": "Nearle Buddy is not switched on for this deployment.",
|
||||
})
|
||||
}
|
||||
// Asking too fast gets its own status, so the console and whatever
|
||||
// watches it can tell "you are going too quickly" apart from "that
|
||||
// question was malformed". The message already says how long to wait.
|
||||
var tooFast services.ErrTooFast
|
||||
if errors.As(err, &tooFast) {
|
||||
return assistantRefuse(c, http.StatusTooManyRequests, err.Error())
|
||||
}
|
||||
return assistantRefuse(c, http.StatusBadRequest, err.Error())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user