CodCodingCode commited on
Commit
7c03503
·
1 Parent(s): 1875c73

fixed thinking bug

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -70,6 +70,9 @@ class RoleAgent:
70
  self.role_instruction = role_instruction
71
 
72
  def act(self, input_text):
 
 
 
73
  prompt = (
74
  f"instruction: {self.role_instruction}\n"
75
  f"input: {input_text}\n"
@@ -170,6 +173,7 @@ class RoleAgent:
170
  f"[CLEANED RESPONSE] Original length: {len(response)}, Cleaned: '{answer}'"
171
  )
172
 
 
173
  return {"thinking": thinking, "output": answer}
174
 
175
 
 
70
  self.role_instruction = role_instruction
71
 
72
  def act(self, input_text):
73
+ # Initialize thinking variable at the start
74
+ thinking = "" # Initialize here, at the beginning of the method
75
+
76
  prompt = (
77
  f"instruction: {self.role_instruction}\n"
78
  f"input: {input_text}\n"
 
173
  f"[CLEANED RESPONSE] Original length: {len(response)}, Cleaned: '{answer}'"
174
  )
175
 
176
+ # Return both thinking and answer
177
  return {"thinking": thinking, "output": answer}
178
 
179