Skip to content

Commit

Permalink
Skip processing except for ask when content is not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
jaresty committed Aug 12, 2024
1 parent a5407dd commit d607dbf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions GPT/gpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ def gpt_apply_prompt(prompt: str, source: str = "", destination: str = ""):
if prompt.startswith("ask"):
text_to_process = format_message(prompt.removeprefix("ask"))
prompt = "Generate text that satisfies the question or request given in the input."
elif (
text_to_process.get("text", "") == ""
and text_to_process.get("image_url", "") == ""
):
text_to_process = None # type: ignore

response = gpt_query(format_message(prompt), text_to_process, destination)

Expand Down

0 comments on commit d607dbf

Please sign in to comment.