chore-refactor_askAI

This commit is contained in:
Akhil Vamshi Konam
2024-08-16 16:10:45 +05:30
parent 420c380169
commit be8a432b97

View File

@@ -263,6 +263,7 @@ class RephraseGrammarEndpoint(BaseAPIView):
context = request.data.get("context", "")
user_prompt = request.data.get("text_input", "")
# Check inputs
if not context or not user_prompt:
return Response(
{"error": "Both context and user prompt are required"},
@@ -273,6 +274,7 @@ class RephraseGrammarEndpoint(BaseAPIView):
else:
text_input = request.data.get("text_input", "")
# Check inputs
if not text_input:
return Response(
{"error": "Text input is required"},