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

fixes agent response interrupts #326

Merged
merged 1 commit into from
Aug 2, 2023
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
14 changes: 14 additions & 0 deletions vocode/streaming/streaming_conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,20 @@ def create_interruptible_event(
self.conversation.interruptible_events.put_nowait(interruptible_event)
return interruptible_event

def create_interruptible_agent_response_event(
self,
payload: Any,
is_interruptible: bool = True,
agent_response_tracker: Optional[asyncio.Event] = None,
) -> InterruptibleAgentResponseEvent:
interruptible_event = super().create_interruptible_agent_response_event(
payload,
is_interruptible=is_interruptible,
agent_response_tracker=agent_response_tracker,
)
self.conversation.interruptible_events.put_nowait(interruptible_event)
return interruptible_event

class TranscriptionsWorker(AsyncQueueWorker):
"""Processes all transcriptions: sends an interrupt if needed
and sends final transcriptions to the output queue"""
Expand Down
Loading