fix: break LLM response with fewer types of punctuation

ref: N25B-207
This commit is contained in:
Twirre Meulenbelt
2025-11-05 15:01:01 +01:00
parent 06e9e4fd15
commit 262376fb58

View File

@@ -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: