Update handler.py
Browse files- handler.py +3 -1
handler.py
CHANGED
@@ -33,7 +33,9 @@ class EndpointHandler():
|
|
33 |
|
34 |
def response(self, result, user_name):
|
35 |
result = result.rsplit("Alice Gate:", 1)[1].split(f"{user_name}:",1)[0].strip()
|
36 |
-
|
|
|
|
|
37 |
return {
|
38 |
"message": result
|
39 |
}
|
|
|
33 |
|
34 |
def response(self, result, user_name):
|
35 |
result = result.rsplit("Alice Gate:", 1)[1].split(f"{user_name}:",1)[0].strip()
|
36 |
+
try:
|
37 |
+
result = result[:[m.start() for m in re.finditer(r'[.!?]', result)][-1]+1]
|
38 |
+
except Exception: pass
|
39 |
return {
|
40 |
"message": result
|
41 |
}
|