```@dataclass class RoomInputOptions: text_ena...
# ask-ai
b
Copy code
@dataclass
class RoomInputOptions:
    text_enabled: NotGivenOr[bool] = NOT_GIVEN
    """If not given, default to True."""
    audio_enabled: NotGivenOr[bool] = NOT_GIVEN
    """If not given, default to True."""
    video_enabled: NotGivenOr[bool] = NOT_GIVEN
    """If not given, default to False."""
    audio_sample_rate: int = 24000
    audio_num_channels: int = 1
    noise_cancellation: rtc.NoiseCancellationOptions | None = None
    text_input_cb: TextInputCallback = _default_text_input_cb
    participant_kinds: NotGivenOr[list[rtc.ParticipantKind.ValueType]] = NOT_GIVEN
    """Participant kinds accepted for auto subscription. If not provided,
    accept `DEFAULT_PARTICIPANT_KINDS`."""
    participant_identity: NotGivenOr[str] = NOT_GIVEN
    """The participant to link to. If not provided, link to the first participant.
    Can be overridden by the `participant` argument of RoomIO constructor or `set_participant`."""
    pre_connect_audio: bool = True
    """Pre-connect audio enabled or not."""
    pre_connect_audio_timeout: float = 3.0
    """The pre-connect audio will be ignored if it doesn't arrive within this time."""
    close_on_disconnect: bool = True
    """Close the AgentSession if the linked participant disconnects with reasons in
    CLIENT_INITIATED, ROOM_DELETED, or USER_REJECTED."""
what are all these values in the roomInputOptions
t
Thanks for reaching out, Mohammed. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The
RoomInputOptions
class configures how an agent receives input from participants in a LiveKit room. Below are the attributes, their values, and purposes: • Input Type Controls: ◦ `text_enabled`: Controls whether the agent accepts text input. Default is True. ◦ `audio_enabled`: Controls whether the agent accepts audio input. Default is True. ◦ `video_enabled`: Controls whether the agent accepts video input. Default is False. • Audio Configuration: ◦ `audio_sample_rate`: Sets the sample rate for audio input processing. Default is 24,000 Hz. ◦ `audio_num_channels`: Sets the number of audio channels. Default is 1 (mono). ◦ `noise_cancellation`: Configures noise cancellation options. Default is None (no noise cancellation). • Participant Management: ◦ `participant_kinds`: Specifies participant kinds accepted for auto subscription. Default is _DEFAULT_PARTICIPANT_KINDS_. ◦ `participant_identity`: Specifies the participant to link to. Default is the first participant. • Text Input Handling: ◦ `text_input_cb`: Callback function to handle text input events. Default is __default_text_input_cb_. • Pre-connect Audio: ◦ `pre_connect_audio`: Enables or disables pre-connect audio. Default is True. ◦ `pre_connect_audio_timeout`: Sets the timeout for pre-connect audio. Default is 3.0 seconds. • Session Management: ◦ `close_on_disconnect`: Controls whether the session closes when the linked participant disconnects for specific reasons. Default is True. These options allow for detailed customization of input handling, audio quality, participant filtering, and session behavior. Sources: livekit-agents/livekit/agents/voice/room_io/__init__.py