From 52ee8c56151ba825d89d364bc2dda878cf8b826e Mon Sep 17 00:00:00 2001 From: Nikhil <118773738+pablohashescobar@users.noreply.github.com> Date: Tue, 18 Jul 2023 15:09:44 +0530 Subject: [PATCH] chore: remove logger from gpt assistant (#1542) * chore: add triggered by details for notifications * dev: update issue activity json to include extra fields * chore: remove logger from gpt assistant --- apiserver/plane/api/views/gpt.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/apiserver/plane/api/views/gpt.py b/apiserver/plane/api/views/gpt.py index 8878e99a5..f8065f6d0 100644 --- a/apiserver/plane/api/views/gpt.py +++ b/apiserver/plane/api/views/gpt.py @@ -30,31 +30,6 @@ class GPTIntegrationEndpoint(BaseAPIView): status=status.HTTP_400_BAD_REQUEST, ) - count = 0 - - # If logger is enabled check for request limit - if settings.LOGGER_BASE_URL: - try: - headers = { - "Content-Type": "application/json", - } - - response = requests.post( - settings.LOGGER_BASE_URL, - json={"user_id": str(request.user.id)}, - headers=headers, - ) - count = response.json().get("count", 0) - if not response.json().get("success", False): - return Response( - { - "error": "You have surpassed the monthly limit for AI assistance" - }, - status=status.HTTP_429_TOO_MANY_REQUESTS, - ) - except Exception as e: - capture_exception(e) - prompt = request.data.get("prompt", False) task = request.data.get("task", False) @@ -82,7 +57,6 @@ class GPTIntegrationEndpoint(BaseAPIView): { "response": text, "response_html": text_html, - "count": count, "project_detail": ProjectLiteSerializer(project).data, "workspace_detail": WorkspaceLiteSerializer(workspace).data, },