Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions vocode/streaming/models/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class AgentConfig(TypedModel, type=AgentType.BASE.value):
webhook_config: Optional[WebhookConfig] = None
track_bot_sentiment: bool = False
actions: Optional[List[ActionConfig]] = None
reengage_timeout: Optional[float] = None
reengage_options: Optional[List[str]] = None


class CutOffResponse(BaseModel):
Expand Down
2 changes: 0 additions & 2 deletions vocode/streaming/models/synthesizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ class SynthesizerConfig(TypedModel, type=SynthesizerType.BASE.value):
audio_encoding: AudioEncoding
should_encode_as_wav: bool = False
sentiment_config: Optional[SentimentConfig] = None
reengage_timeout: Optional[float] = None
reengage_options: Optional[List[str]] = None

class Config:
arbitrary_types_allowed = True
Expand Down
13 changes: 7 additions & 6 deletions vocode/streaming/streaming_conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ async def process(self, transcription: Transcription):
return
elif transcription.message.strip() == "<INTERRUPT>" and transcription.confidence == 1.0:
# self.kill_tasks_when_human_is_talking()
self.conversation.broadcast_interrupt()
# self.conversation.broadcast_interrupt()
pass

if transcription.is_final:
self.conversation.logger.debug(
Expand Down Expand Up @@ -529,9 +530,9 @@ async def start(self, mark_ready: Optional[Callable[[], Awaitable[None]]] = None
if len(self.events_manager.subscriptions) > 0:
self.events_task = asyncio.create_task(self.events_manager.start())
if (
self.synthesizer.get_synthesizer_config().reengage_timeout and
(self.synthesizer.get_synthesizer_config().reengage_options and
len(self.synthesizer.get_synthesizer_config().reengage_options) > 0)
self.agent.get_agent_config().reengage_timeout and
(self.agent.get_agent_config().reengage_options and
len(self.agent.get_agent_config().reengage_options) > 0)
):
self.human_prompt_checker = asyncio.create_task(self.check_if_human_should_be_prompted())

Expand Down Expand Up @@ -783,8 +784,8 @@ async def check_if_human_should_be_prompted(self):
self.logger.debug("starting should prompt user task")
self.last_agent_response = None
self.last_final_transcript_from_human = None
reengage_timeout = self.synthesizer.get_synthesizer_config().reengage_timeout
reengage_options = self.synthesizer.get_synthesizer_config().reengage_options
reengage_timeout = self.agent.get_agent_config().reengage_timeout
reengage_options = self.agent.get_agent_config().reengage_options
while self.active:
if self.last_agent_response and self.last_final_transcript_from_human:
last_human_touchpoint = time.time() - self.last_final_transcript_from_human
Expand Down