Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -241,6 +241,10 @@ CRITICAL RULES:
|
|
| 241 |
search_match = re.search(r'SEARCH:\s*(.+?)(?:\n|$)', response)
|
| 242 |
wiki_match = re.search(r'WIKIPEDIA:\s*(.+?)(?:\n|$)', response)
|
| 243 |
python_match = re.search(r'PYTHON:\s*```(?:python)?\n?(.*?)```', response, re.DOTALL)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
|
| 245 |
if answer_match:
|
| 246 |
answer = answer_match.group(1).strip()
|
|
|
|
| 241 |
search_match = re.search(r'SEARCH:\s*(.+?)(?:\n|$)', response)
|
| 242 |
wiki_match = re.search(r'WIKIPEDIA:\s*(.+?)(?:\n|$)', response)
|
| 243 |
python_match = re.search(r'PYTHON:\s*```(?:python)?\n?(.*?)```', response, re.DOTALL)
|
| 244 |
+
if not python_match:
|
| 245 |
+
python_match = re.search(r'```python\n(.*?)```', response, re.DOTALL)
|
| 246 |
+
if not python_match:
|
| 247 |
+
python_match = re.search(r'```\n(.*?)```', response, re.DOTALL)
|
| 248 |
|
| 249 |
if answer_match:
|
| 250 |
answer = answer_match.group(1).strip()
|