Rajan Sharma commited on
Commit
0cffbe0
·
verified ·
1 Parent(s): f3f85b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -100,11 +100,16 @@ def is_identity_query(message, history):
100
  r"\bdescribe\s+yourself\b", r"\band\s+you\s*\?\b", r"\byour\s+name\b",
101
  r"\bwho\s+am\s+i\s+chatting\s+with\b",
102
  ]
103
- def match(t): return any(re.search(p, (t or "").strip().lower()) for p in patterns))
104
- if match(message): return True
 
 
 
 
105
  if history:
106
  last_user = history[-1][0] if isinstance(history[-1], (list, tuple)) else None
107
- if match(last_user): return True
 
108
  return False
109
 
110
  def _iter_user_assistant(history):
 
100
  r"\bdescribe\s+yourself\b", r"\band\s+you\s*\?\b", r"\byour\s+name\b",
101
  r"\bwho\s+am\s+i\s+chatting\s+with\b",
102
  ]
103
+
104
+ def match(t):
105
+ return any(re.search(p, (t or "").strip().lower()) for p in patterns)
106
+
107
+ if match(message):
108
+ return True
109
  if history:
110
  last_user = history[-1][0] if isinstance(history[-1], (list, tuple)) else None
111
+ if match(last_user):
112
+ return True
113
  return False
114
 
115
  def _iter_user_assistant(history):