From 76bc3fc3ae3cf3ec39331260f22e76323b856aa1 Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Wed, 19 Jun 2024 20:01:36 +0100 Subject: [PATCH] fix/dont split numbers (#5) reported in chat https://matrix.to/#/!EOygeDJPfJQOfNacqH:matrix.org/$bch65GzxNCnCiUwmY81I2VKNVE8DI5zTuLdmmAnRqOg?via=matrix.org&via=mozilla.org&via=matrix.strongthany.cc --- ovos_solver_openai_persona/engines.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ovos_solver_openai_persona/engines.py b/ovos_solver_openai_persona/engines.py index a7e6b33..1913107 100644 --- a/ovos_solver_openai_persona/engines.py +++ b/ovos_solver_openai_persona/engines.py @@ -161,6 +161,8 @@ def stream_utterances(self, query): for chunk in self._do_streaming_api_request(messages): answer += chunk if any(chunk.endswith(p) for p in [".", "!", "?", "\n", ":"]): + if chunk[-2].isdigit() and chunk[-1] == ".": + continue # dont split numbers if answer.strip(): yield answer answer = ""