likki1715 commited on
Commit
3ead1a8
·
verified ·
1 Parent(s): 5a57fa7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
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()