Skip to content

Commit

Permalink
move interrupt to overridable conversation function (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajar98 authored Aug 3, 2023
1 parent 9166d8b commit f8b24af
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions vocode/streaming/streaming_conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,7 @@ async def process(self, transcription: Transcription):
)
if (
not self.conversation.is_human_speaking
and transcription.confidence
>= (
self.conversation.transcriber.get_transcriber_config().min_interrupt_confidence
or 0
)
and self.conversation.is_interrupt(transcription)
):
self.conversation.current_transcription_is_interrupt = (
self.conversation.broadcast_interrupt()
Expand Down Expand Up @@ -557,6 +553,11 @@ def broadcast_interrupt(self):
self.agent_responses_worker.cancel_current_task()
return num_interrupts > 0

def is_interrupt(self, transcription: Transcription):
return transcription.confidence >= (
self.transcriber.get_transcriber_config().min_interrupt_confidence or 0
)

async def send_speech_to_output(
self,
message: str,
Expand Down

0 comments on commit f8b24af

Please sign in to comment.