From 98a29cc5aa9c434182258f461fa1dfaf74a7f08e Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Sat, 22 Jun 2024 15:20:23 +0100 Subject: [PATCH] hotfix (#6) 2024-06-22 13:35:25.542 - skill-ovos-fallback-chatgpt.openvoiceos - ERROR - string index out of range --- ovos_solver_openai_persona/engines.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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