Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make mark terminated sync instead of async #28

Merged
merged 1 commit into from
Jun 14, 2024
Merged
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
8 changes: 4 additions & 4 deletions vocode/streaming/streaming_conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ async def process(self, item: InterruptibleAgentResponseEvent[AgentResponse]):
if self.last_agent_response_tracker is not None:
await self.last_agent_response_tracker.wait()
item.agent_response_tracker.set()
await self.conversation.mark_terminated(bot_disconnect=True)
self.conversation.mark_terminated(bot_disconnect=True)
return

agent_response_message = typing.cast(AgentResponseMessage, agent_response)
Expand Down Expand Up @@ -747,7 +747,7 @@ async def send_initial_message(

async def action_on_idle(self):
logger.debug("Conversation idle for too long, terminating")
await self.mark_terminated(bot_disconnect=True)
self.mark_terminated(bot_disconnect=True)
return

async def check_for_idle(self):
Expand Down Expand Up @@ -961,11 +961,11 @@ async def get_chunks(
synthesis_result.synthesis_total_span.finish()
return message_sent, cut_off

async def mark_terminated(self, bot_disconnect: bool = False):
def mark_terminated(self, bot_disconnect: bool = False):
self.active = False

async def terminate(self):
await self.mark_terminated()
self.mark_terminated()
self.broadcast_interrupt()
self.events_manager.publish_event(
TranscriptCompleteEvent(
Expand Down
Loading