Skip to main content
Version: 1.0.x

RoomOptions

RoomOptions is a configuration class that defines how an AI agent connects to and behaves within a VideoSDK meeting room. It serves as the primary interface for customizing agent behavior, meeting connection parameters, and session management settings.

Introduction

The RoomOptions class is the central configuration point for VideoSDK AI agents, providing comprehensive control over how agents join meetings, interact with participants, and manage their sessions. This configuration is passed to the JobContext during agent initialization and influences all aspects of the agent's behavior within the meeting environment.

Core Features

  • Meeting Connection: Configure room ID, authentication, and transport mode for VideoSDK meetings
  • Agent Identity: Set display name, participant ID, and visual representation
  • Session Management: Control automatic session termination and timeouts
  • Media Capabilities: Enable vision processing, meeting recording, and background audio
  • Telemetry: Configure traces, metrics, and log collection/export
  • Transport Modes: Support for VideoSDK, WebSocket, and WebRTC transports
  • Development Tools: Playground mode for testing and development
  • Error Handling: Custom error handling callbacks
  • Avatar Integration: Support for virtual avatars

Basic Example

main.py
from videosdk.agents import RoomOptions, JobContext  

# Basic configuration
room_options = RoomOptions(
room_id="your-meeting-id",
name="My AI Agent",
playground=True
)

# Create job context
context = JobContext(room_options=room_options)

Parameters

Parameters that you can pass with RoomOptions:

Connection & Identity

ParameterTypeDefaultDescription
room_idOptional[str]NoneUnique identifier for the VideoSDK meeting
auth_tokenOptional[str]NoneVideoSDK authentication token
nameOptional[str]"Agent"Display name of the agent in the meeting
agent_participant_idOptional[str]NoneCustom participant ID for the agent
join_meetingOptional[bool]TrueWhether agent should join the meeting
signaling_base_urlOptional[str]"api.videosdk.live"VideoSDK signaling server URL

Media & Features

ParameterTypeDefaultDescription
playgroundboolTrueEnable playground mode for easy testing
visionboolFalseEnable video processing capabilities
recordingboolFalseEnable meeting recording. When True, audio is always recorded via the track API. Use recording_options to additionally record camera video or screen share.
recording_optionsOptional[RecordingOptions]NoneFine-grained control over what is recorded alongside audio (see RecordingOptions)
background_audioboolFalseEnable background audio (e.g., thinking sounds)
avatarOptional[Any]NoneVirtual avatar for visual representation

Session Management

ParameterTypeDefaultDescription
auto_end_sessionboolTrueAutomatically end session when participants leave
session_timeout_secondsOptional[int]5Seconds to wait before ending the session after the last participant leaves
no_participant_timeout_secondsOptional[int]90Seconds to wait for the first participant to join before automatically shutting down. Set to None to wait indefinitely.
on_room_errorOptional[Callable]NoneError handling callback function

Telemetry & Logging

ParameterTypeDefaultDescription
tracesOptional[TracesOptions]TracesOptions()OpenTelemetry trace export configuration
metricsOptional[MetricsOptions]MetricsOptions()Metrics collection and export configuration
logsOptional[LoggingOptions]LoggingOptions()Log collection and export configuration
send_logs_to_dashboardboolFalseSend logs to VideoSDK dashboard
dashboard_log_levelstr"INFO"Log level for dashboard logs
send_analytics_to_pubsubOptional[bool]FalseSend analytics data via PubSub

Transport Configuration

ParameterTypeDefaultDescription
transport_modeOptional[str | TransportMode]"videosdk"Transport mode: "videosdk", "websocket", or "webrtc"
websocketOptional[WebSocketConfig]WebSocketConfig()WebSocket transport configuration
webrtcOptional[WebRTCConfig]WebRTCConfig()WebRTC transport configuration

TracesOptions

ParameterTypeDefaultDescription
enabledboolTrueEnable trace collection
export_urlOptional[str]NoneCustom export endpoint URL
export_headersOptional[Dict[str, str]]NoneCustom headers for the export endpoint

MetricsOptions

ParameterTypeDefaultDescription
enabledboolTrueEnable metrics collection
export_urlOptional[str]NoneCustom export endpoint URL
export_headersOptional[Dict[str, str]]NoneCustom headers for the export endpoint

LoggingOptions

ParameterTypeDefaultDescription
enabledboolFalseEnable log export
levelstr"INFO"Log level filter (DEBUG, INFO, WARNING, ERROR)
export_urlOptional[str]NoneCustom export endpoint URL
export_headersOptional[Dict[str, str]]NoneCustom headers for the export endpoint

WebSocketConfig

ParameterTypeDefaultDescription
portint8080Port for the WebSocket server
pathstr"/ws"Endpoint path for the WebSocket connection

WebRTCConfig

ParameterTypeDefaultDescription
signaling_urlOptional[str]NoneSignaling server URL (required for WebRTC mode)
signaling_typestr"websocket"Type of signaling transport
ice_serversOptional[list][{"urls": "stun:stun.l.google.com:19302"}]ICE server configuration for NAT traversal

RecordingOptions

Controls what is recorded in addition to audio when recording=True. Audio is always recorded via the track API when recording=True; these fields opt in to additional streams.

ParameterTypeDefaultDescription
videoboolFalseAlso record the agent's camera video track (composite audio+video via participant recording API)
screen_shareboolFalseAlso record the screen-share track. Requires vision=True.
main.py
from videosdk.agents import RoomOptions, RecordingOptions

# Audio-only recording (default when recording_options is omitted)
room_options = RoomOptions(
room_id="your-room-id",
recording=True,
)

# Audio + screen share recording
room_options = RoomOptions(
room_id="your-room-id",
vision=True, # required for screen share recording
recording=True,
recording_options=RecordingOptions(screen_share=True),
)

# Composite audio + video (participant recording API)
room_options = RoomOptions(
room_id="your-room-id",
recording=True,
recording_options=RecordingOptions(video=True),
)
note

recording_options.screen_share=True requires vision=True because vision subscribes to the video/share streams needed for screen recording. Setting screen_share=True without vision=True raises a ValueError at startup.

Transport Modes

The RoomOptions supports three transport modes:

main.py
from videosdk.agents import RoomOptions, WebSocketConfig, WebRTCConfig

# Default: VideoSDK transport
room_options = RoomOptions(room_id="your-meeting-id")

# WebSocket transport
room_options = RoomOptions(
transport_mode="websocket",
websocket=WebSocketConfig(port=8080, path="/ws")
)

# WebRTC transport
room_options = RoomOptions(
transport_mode="webrtc",
webrtc=WebRTCConfig(signaling_url="wss://your-signaling-server.com")
)

Telemetry Configuration

Configure traces, metrics, and logging for observability:

main.py
from videosdk.agents import RoomOptions, TracesOptions, MetricsOptions, LoggingOptions

room_options = RoomOptions(
room_id="your-meeting-id",
traces=TracesOptions(
enabled=True,
export_url="https://your-otel-collector.com/v1/traces",
export_headers={"Authorization": "Bearer your-token"}
),
metrics=MetricsOptions(
enabled=True,
export_url="https://your-otel-collector.com/v1/metrics"
),
logs=LoggingOptions(
enabled=True,
level="DEBUG"
)
)

Additional Resources

Got a Question? Ask us on discord