bstraehle commited on
Commit
044c0a3
·
1 Parent(s): ebcdcac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -42,10 +42,11 @@ MODEL_NAME = "gpt-4"
42
 
43
  def invoke(openai_api_key, use_rag, prompt):
44
  if (openai_api_key == ""):
45
- print(use_rag)
46
- raise gr.Error("'OpenAI API Key' is required.")
 
47
  if (prompt == ""):
48
- raise gr.Error("'Prompt' is required.")
49
  try:
50
  llm = ChatOpenAI(model_name = MODEL_NAME,
51
  openai_api_key = openai_api_key,
 
42
 
43
  def invoke(openai_api_key, use_rag, prompt):
44
  if (openai_api_key == ""):
45
+ raise gr.Error("OpenAI API Key is required.")
46
+ if (use_rag is None):
47
+ raise gr.Error("Retrieval Augmented Generation is required.")
48
  if (prompt == ""):
49
+ raise gr.Error("Prompt is required.")
50
  try:
51
  llm = ChatOpenAI(model_name = MODEL_NAME,
52
  openai_api_key = openai_api_key,