feat: add ChatbotController for handling AI chat queries and history retrieval
All checks were successful
Build and Release / release (push) Successful in 1m36s
All checks were successful
Build and Release / release (push) Successful in 1m36s
This commit is contained in:
@@ -46,9 +46,9 @@ func (cx *ChatbotController) Chat(c fiber.Ctx) error {
|
||||
})
|
||||
}
|
||||
|
||||
claims := c.Locals("user").(*response.JWTClaims)
|
||||
uid := c.Locals("uid").(string)
|
||||
|
||||
answer, err := cx.chatbotService.Chat(ctx, claims.UId, dto.ProjectID, dto.Question)
|
||||
answer, err := cx.chatbotService.Chat(ctx, uid, dto.ProjectID, dto.Question)
|
||||
if err != nil {
|
||||
if err.Error() == "you have reached your daily limit of 10 questions. Please come back tomorrow" {
|
||||
return c.Status(fiber.StatusTooManyRequests).JSON(response.CommonResponse{
|
||||
|
||||
Reference in New Issue
Block a user