End to end connected for demo #17
@@ -112,9 +112,7 @@ class LLMAgent(Agent):
|
|||||||
|
|
||||||
# Stream the message in chunks separated by punctuation.
|
# Stream the message in chunks separated by punctuation.
|
||||||
# We include the delimiter in the emitted chunk for natural flow.
|
# We include the delimiter in the emitted chunk for natural flow.
|
||||||
pattern = re.compile(
|
pattern = re.compile(r".*?(?:,|;|:|—|–|\.{3}|…|\.|\?|!)\s*", re.DOTALL)
|
||||||
r".*?(?:,|;|:|—|–|-|\.{3}|…|\.|\?|!|\(|\)|\[|\]|/)\s*", re.DOTALL
|
|
||||||
)
|
|
||||||
for m in pattern.finditer(current_chunk):
|
for m in pattern.finditer(current_chunk):
|
||||||
chunk = m.group(0)
|
chunk = m.group(0)
|
||||||
if chunk:
|
if chunk:
|
||||||
|
|||||||
Reference in New Issue
Block a user