Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip egress in wait_for_participant
Browse files Browse the repository at this point in the history
keepingitneil committed Oct 29, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent e6d12ed commit d901d32
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions livekit-agents/livekit/agents/job.py
Original file line number Diff line number Diff line change
@@ -54,6 +54,14 @@ class RunningJobInfo:
token: str


SKIP_PARTICIPANT_KINDS = set(
[
rtc.ParticipantKind.PARTICIPANT_KIND_AGENT,
rtc.ParticipantKind.PARTICIPANT_KIND_EGRESS,
]
)


class JobContext:
def __init__(
self,
@@ -120,14 +128,14 @@ async def wait_for_participant(
for p in self._room.remote_participants.values():
if (
identity is None or p.identity == identity
) and p.kind != rtc.ParticipantKind.PARTICIPANT_KIND_AGENT:
) and p.kind not in SKIP_PARTICIPANT_KINDS:
fut.set_result(p)
break

def _on_participant_connected(p: rtc.RemoteParticipant):
if (
identity is None or p.identity == identity
) and p.kind != rtc.ParticipantKind.PARTICIPANT_KIND_AGENT:
) and p.kind not in SKIP_PARTICIPANT_KINDS:
self._room.off("participant_connected", _on_participant_connected)
if not fut.done():
fut.set_result(p)

0 comments on commit d901d32

Please sign in to comment.