Skip to content

Commit

Permalink
Fixes error for None text
Browse files Browse the repository at this point in the history
  • Loading branch information
akash-plane authored Nov 9, 2024
1 parent 30b45bf commit bcd37bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apiserver/plane/app/views/external/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def post(self, request, slug, project_id):
)

text, error = get_gpt_response(task, request.data.get("prompt", False), OPENAI_API_KEY, GPT_ENGINE)
if error:
if not text and error:
return Response(
{"error": "An internal error has occurred."},
status=status.HTTP_500_INTERNAL_SERVER_ERROR,
Expand Down Expand Up @@ -120,7 +120,7 @@ def post(self, request, slug):
)

text, error = get_gpt_response(task, request.data.get("prompt", False), OPENAI_API_KEY, GPT_ENGINE)
if error:
if not text and error:
return Response(
{"error": "An internal error has occurred."},
status=status.HTTP_500_INTERNAL_SERVER_ERROR,
Expand Down

0 comments on commit bcd37bc

Please sign in to comment.