Update utils/utils.py
Browse files- utils/utils.py +2 -2
utils/utils.py
CHANGED
|
@@ -113,14 +113,14 @@ def read_pptx_text(file_path):
|
|
| 113 |
# Input validation
|
| 114 |
|
| 115 |
def validate_input(question, openai_api_key, gemini_api_key, anthropic_api_key, file_name):
|
| 116 |
-
|
| 117 |
|
| 118 |
if question.len() > 500 or
|
| 119 |
openai_api_key.len() > 150 or
|
| 120 |
gemini_api_key.len() > 150 or
|
| 121 |
anthropic_api_key.len() > 150 or
|
| 122 |
file_name > 150:
|
| 123 |
-
|
| 124 |
|
| 125 |
# Allow: letters, numbers, spaces, basic punctuation, common symbols
|
| 126 |
# Block: HTML tags, script injection, control characters, etc.
|
|
|
|
| 113 |
# Input validation
|
| 114 |
|
| 115 |
def validate_input(question, openai_api_key, gemini_api_key, anthropic_api_key, file_name):
|
| 116 |
+
is_valid = True
|
| 117 |
|
| 118 |
if question.len() > 500 or
|
| 119 |
openai_api_key.len() > 150 or
|
| 120 |
gemini_api_key.len() > 150 or
|
| 121 |
anthropic_api_key.len() > 150 or
|
| 122 |
file_name > 150:
|
| 123 |
+
is_valid = False
|
| 124 |
|
| 125 |
# Allow: letters, numbers, spaces, basic punctuation, common symbols
|
| 126 |
# Block: HTML tags, script injection, control characters, etc.
|