Update app.py
Browse files
app.py
CHANGED
|
@@ -64,8 +64,10 @@ def ask(question, openai_api_key, gemini_api_key, anthropic_api_key, file_name =
|
|
| 64 |
gr.Warning("Anthropic API Key is required.")
|
| 65 |
return "", ""
|
| 66 |
|
| 67 |
-
|
| 68 |
-
|
|
|
|
|
|
|
| 69 |
return "", ""
|
| 70 |
|
| 71 |
if file_name:
|
|
|
|
| 64 |
gr.Warning("Anthropic API Key is required.")
|
| 65 |
return "", ""
|
| 66 |
|
| 67 |
+
is_valid, err_msg = validate_input(question, openai_api_key, gemini_api_key, anthropic_api_key, file_name)
|
| 68 |
+
|
| 69 |
+
if not is_valid:
|
| 70 |
+
gr.Warning(f"Invalid input: {err_msg}")
|
| 71 |
return "", ""
|
| 72 |
|
| 73 |
if file_name:
|