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

Adds code to have better control over the agent. Now, you can pause s… #1119

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yepher
Copy link

@yepher yepher commented Nov 21, 2024

See issue: #1118 - #1118

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.")

…o you won't get interrupted while talking to other channel members, resume functionality, and set the participant the agent should actively listen to.
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Chris Wilson seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants