diff --git a/ovos_solver_openai_persona/engines.py b/ovos_solver_openai_persona/engines.py index 1913107..11116f3 100644 --- a/ovos_solver_openai_persona/engines.py +++ b/ovos_solver_openai_persona/engines.py @@ -161,7 +161,7 @@ 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] == ".": + if len(chunk) >= 2 and chunk[-2].isdigit() and chunk[-1] == ".": continue # dont split numbers if answer.strip(): yield answer