From fa70c91a67193feb00b95aaa78434365586d57ae Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 8 Apr 2024 13:32:36 +0200 Subject: [PATCH] [assistant.picovoice] Better partial transcript + flush handling logic. --- platypush/plugins/assistant/picovoice/__init__.py | 4 ++++ platypush/plugins/assistant/picovoice/_assistant.py | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/platypush/plugins/assistant/picovoice/__init__.py b/platypush/plugins/assistant/picovoice/__init__.py index c669f19f99..9426ba6081 100644 --- a/platypush/plugins/assistant/picovoice/__init__.py +++ b/platypush/plugins/assistant/picovoice/__init__.py @@ -40,6 +40,10 @@ class AssistantPicovoicePlugin(AssistantPlugin, RunnablePlugin): * **Leopard**: speech-to-text engine aimed at offline transcription of audio files rather than real-time transcription. + * **Orca**: text-to-speech engine, if you want to create your custom + logic to respond to user's voice commands and render the responses as + audio. + """ def __init__( diff --git a/platypush/plugins/assistant/picovoice/_assistant.py b/platypush/plugins/assistant/picovoice/_assistant.py index e511bc01ca..25142f336c 100644 --- a/platypush/plugins/assistant/picovoice/_assistant.py +++ b/platypush/plugins/assistant/picovoice/_assistant.py @@ -287,10 +287,8 @@ class Assistant: if self.cheetah: phrase = self.cheetah.flush() - if not self._ctx.is_final: - self._ctx.partial_transcript += phrase - phrase = self._ctx.partial_transcript - + self._ctx.partial_transcript += phrase + phrase = self._ctx.partial_transcript phrase = phrase[:1].lower() + phrase[1:] if self._ctx.is_final or phrase: