diff --git a/nanobot/utils/helpers.py b/nanobot/utils/helpers.py index 1f14cb36e..3b4f9f25a 100644 --- a/nanobot/utils/helpers.py +++ b/nanobot/utils/helpers.py @@ -15,9 +15,12 @@ from loguru import logger def strip_think(text: str) -> str: - """Remove blocks and any unclosed trailing tag.""" + """Remove thinking blocks and any unclosed trailing tag.""" text = re.sub(r"[\s\S]*?", "", text) text = re.sub(r"[\s\S]*$", "", text) + # Gemma 4 and similar models use ... blocks + text = re.sub(r"[\s\S]*?", "", text) + text = re.sub(r"[\s\S]*$", "", text) return text.strip()