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

Ability to pause/resume agent interaction in channel for multimodal_agent #1118

Open
yepher opened this issue Nov 21, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@yepher
Copy link

yepher commented Nov 21, 2024

See PR: #1119 - #1119

In my application case, I need to have the ability to "pause" the Multimodal agent so I can speak to participants in the channel without the LLM interrupting me. I also need to be able to resume the LLM interaction.

In addition to pausing the resume, I also need to be able to set the source participant the agent should be actively listening to. In my app there are multiple participants in the room.

Locally I am doing this and it seems to work:
update multimodal_agent.py

    def set_source_participant(self, participant_identity: str) -> None:
        """Set the source participant for the agent."""
        self._link_participant(participant_identity)

    def pause_listening(self) -> None:
        """Pause listening to the audio stream."""
        if self._read_micro_atask is not None:
            self._read_micro_atask.cancel()  # Stop the current task
            self._read_micro_atask = None
            logger.info("Paused listening to the audio stream.")

    def resume_listening(self) -> None:
        """Resume listening to the audio stream."""
        if self._subscribed_track is not None and self._read_micro_atask is None:
            self._read_micro_atask = asyncio.create_task(
                self._micro_task(self._subscribed_track)  # Restart the task
            )
            logger.info("Resumed listening to the audio stream.")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant