bstraehle commited on
Commit
99db5a1
1 Parent(s): efc66f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -24,11 +24,11 @@ logging.basicConfig(stream = sys.stdout, level = logging.DEBUG)
24
  logging.getLogger().addHandler(logging.StreamHandler(stream = sys.stdout))
25
 
26
  def invoke(openai_api_key, prompt, agent_option):
27
- if (openai_api_key == ""):
28
  raise gr.Error("OpenAI API Key is required.")
29
- if (prompt == ""):
30
  raise gr.Error("Prompt is required.")
31
- if (agent_option is None):
32
  raise gr.Error("Use Agent is required.")
33
 
34
  with lock:
 
24
  logging.getLogger().addHandler(logging.StreamHandler(stream = sys.stdout))
25
 
26
  def invoke(openai_api_key, prompt, agent_option):
27
+ if not openai_api_key:
28
  raise gr.Error("OpenAI API Key is required.")
29
+ if not prompt:
30
  raise gr.Error("Prompt is required.")
31
+ if not agent_option:
32
  raise gr.Error("Use Agent is required.")
33
 
34
  with lock: