[assistant.picovoice] Better partial transcript + flush handling logic.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Fabio Manganiello 2024-04-08 13:32:36 +02:00
parent c7094c7886
commit fa70c91a67
Signed by: blacklight
GPG Key ID: D90FBA7F76362774
2 changed files with 6 additions and 4 deletions

View File

@ -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__(

View File

@ -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: