tessl install tessl/pypi-aiortc@1.13.0Python implementation of WebRTC and ORTC for real-time peer-to-peer communication
Agent Success
Agent success rate when using this tile
87%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.02x
Baseline
Agent success rate without this tile
85%
A system for managing video conference participants with selective audio/video transmission capabilities. The system should allow fine-grained control over which media types each participant can send and receive.
The system should support three participant roles with different transmission capabilities:
Implement a participant manager that:
The system must support the following role transitions:
@generates
"""Video conference participant manager with role-based media control."""
from aiortc import RTCPeerConnection
from enum import Enum
from typing import Optional
class ParticipantRole(Enum):
"""Participant role definitions."""
PRESENTER = "presenter"
VIEWER = "viewer"
MODERATOR = "moderator"
class ParticipantManager:
"""Manages video conference participants with role-based media control."""
def __init__(self):
"""Initialize the participant manager."""
pass
def create_participant(
self,
participant_id: str,
role: ParticipantRole,
peer_connection: RTCPeerConnection
) -> None:
"""
Create a participant with the specified role and configure media transceivers.
Args:
participant_id: Unique identifier for the participant
role: The participant's role (PRESENTER, VIEWER, or MODERATOR)
peer_connection: The RTCPeerConnection for this participant
"""
pass
def change_role(
self,
participant_id: str,
new_role: ParticipantRole
) -> None:
"""
Change a participant's role and update their media transceiver directions.
Args:
participant_id: The participant's unique identifier
new_role: The new role to assign
"""
pass
def get_participant_role(self, participant_id: str) -> Optional[ParticipantRole]:
"""
Get the current role of a participant.
Args:
participant_id: The participant's unique identifier
Returns:
The participant's current role, or None if not found
"""
passProvides WebRTC implementation for real-time communication, including RTCPeerConnection and transceiver management.