Spaces:
Running
Running
Update helper/keywords.py
Browse files- helper/keywords.py +15 -1
helper/keywords.py
CHANGED
|
@@ -159,4 +159,18 @@ def is_structured_task(prompt: str) -> bool:
|
|
| 159 |
return False
|
| 160 |
|
| 161 |
def multiple_questions(prompt: str) -> bool:
|
| 162 |
-
return prompt.count("?") >= 3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
return False
|
| 160 |
|
| 161 |
def multiple_questions(prompt: str) -> bool:
|
| 162 |
+
return prompt.count("?") >= 3
|
| 163 |
+
|
| 164 |
+
def contains_images(messages):
|
| 165 |
+
for msg in messages:
|
| 166 |
+
content = msg.get("content")
|
| 167 |
+
|
| 168 |
+
if isinstance(content, list):
|
| 169 |
+
for part in content:
|
| 170 |
+
if isinstance(part, dict) and part.get("type") in ["image_urls", "image_url"]:
|
| 171 |
+
return True
|
| 172 |
+
|
| 173 |
+
if "image" in msg or "image_url" in msg:
|
| 174 |
+
return True
|
| 175 |
+
|
| 176 |
+
return False
|