Spaces:
Build error
Build error
Update app.py
Browse files
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 |
-
|
46 |
-
|
|
|
47 |
if (prompt == ""):
|
48 |
-
raise gr.Error("
|
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,
|