From 262376fb58d3e6a867fd40a77e0c7c317dab9157 Mon Sep 17 00:00:00 2001 From: Twirre Meulenbelt <43213592+TwirreM@users.noreply.github.com> Date: Wed, 5 Nov 2025 15:01:01 +0100 Subject: [PATCH] fix: break LLM response with fewer types of punctuation ref: N25B-207 --- src/control_backend/agents/llm/llm.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/control_backend/agents/llm/llm.py b/src/control_backend/agents/llm/llm.py index 0b9d259..4487b23 100644 --- a/src/control_backend/agents/llm/llm.py +++ b/src/control_backend/agents/llm/llm.py @@ -112,9 +112,7 @@ class LLMAgent(Agent): # Stream the message in chunks separated by punctuation. # We include the delimiter in the emitted chunk for natural flow. - pattern = re.compile( - r".*?(?:,|;|:|—|–|-|\.{3}|…|\.|\?|!|\(|\)|\[|\]|/)\s*", re.DOTALL - ) + pattern = re.compile(r".*?(?:,|;|:|—|–|\.{3}|…|\.|\?|!)\s*", re.DOTALL) for m in pattern.finditer(current_chunk): chunk = m.group(0) if chunk: