kz919 commited on
Commit
5499441
1 Parent(s): d0de684

handle edge case where thinking is not invoked

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -62,8 +62,10 @@ def parse_response(response):
62
  reflection = reflection_match.group(1).strip() if reflection_match else ""
63
 
64
  steps = re.findall(r'<step>(.*?)</step>', response, re.DOTALL)
65
-
66
- return answer, reflection, steps
 
 
67
 
68
  def process_chat(message, history, model, system_prompt, thinking_budget, api_key):
69
  print(f"Received message: {message}")
 
62
  reflection = reflection_match.group(1).strip() if reflection_match else ""
63
 
64
  steps = re.findall(r'<step>(.*?)</step>', response, re.DOTALL)
65
+ if answer is not "":
66
+ return answer, reflection, steps
67
+ else:
68
+ return response, "", ""
69
 
70
  def process_chat(message, history, model, system_prompt, thinking_budget, api_key):
71
  print(f"Received message: {message}")