Package-level declarations

State functions for room/participants to use within composables.

Types

Link copied to clipboard
abstract class Agent

A representation of an LiveKit agent participant.

Link copied to clipboard
Link copied to clipboard
class ParticipantInfo(nameState: State<String?>, identityState: State<Participant.Identity?>, metadataState: State<String?>)

Holder for basic Participant information.

Link copied to clipboard
class RoomInfo(nameState: State<String?>, metadataState: State<String?>)

Holder for basic Room information.

Link copied to clipboard
abstract class Session

A Session represents a managed connection to a Room which can contain Agents.

Link copied to clipboard
data class SessionConnectOptions(val tracks: SessionConnectTrackOptions = SessionConnectTrackOptions(), val roomConnectOptions: ConnectOptions = ConnectOptions())

Options for connecting to a session.

Link copied to clipboard
data class SessionConnectTrackOptions(val microphoneEnabled: Boolean = true, val usePreconnectBuffer: Boolean = true, val microphoneCaptureOptions: LocalAudioTrackOptions = LocalAudioTrackOptions(), val microphonePublishOptions: AudioTrackPublishOptions = AudioTrackPublishOptions())

Track options for session connection.

Link copied to clipboard
abstract class SessionMessages

Handles all the messages that are sent and received within a Session.

Link copied to clipboard
data class SessionOptions(val room: Room? = null, val agentConnectTimeout: Duration = 20.seconds, val tokenRequestOptions: TokenRequestOptions = TokenRequestOptions())

Options for creating a Session.

Link copied to clipboard
class VoiceAssistant(agent: State<RemoteParticipant?>, state: State<AgentState?>, audioTrack: State<TrackReference?>, agentTranscriptions: State<List<TextStreamData>>, agentAttributes: State<Map<String, String>>)

Functions

Link copied to clipboard
fun Room.getTrackReferences(sources: List<Track.Source>, usePlaceholders: Set<Track.Source> = emptySet(), onlySubscribed: Boolean = true): List<TrackReference>
Link copied to clipboard
fun Participant.getTrackReferencesBySource(sources: List<Track.Source>, usePlaceholders: Set<Track.Source> = emptySet(), onlySubscribed: Boolean = true): List<TrackReference>
Link copied to clipboard
fun rememberAgent(session: Session? = null): Agent

This looks for the first agent-participant in the room.

Link copied to clipboard
fun rememberAgentState(participant: Participant?): State<AgentState>

Keeps track of the agent state for a participant.

Link copied to clipboard
fun rememberConnectionState(passedRoom: Room? = null): State<Room.State>

Returns the Room.State from passedRoom or the local RoomScope if null.

Link copied to clipboard
fun rememberLocalMedia(room: Room? = null): LocalMedia
Link copied to clipboard
fun rememberParticipantInfo(passedParticipant: Participant? = null): ParticipantInfo

Remembers the participant info and updates whenever it is changed.

Link copied to clipboard
fun rememberParticipants(passedRoom: Room? = null): State<List<Participant>>

Remembers the full list of participants, with the local participant included as the first item in the list.

Link copied to clipboard
fun rememberParticipantTrackReferences(sources: List<Track.Source> = listOf( Track.Source.CAMERA, Track.Source.SCREEN_SHARE ), usePlaceholders: Set<Track.Source> = emptySet(), passedParticipant: Participant? = null, onlySubscribed: Boolean = true): State<List<TrackReference>>
fun rememberParticipantTrackReferences(sources: List<Track.Source>, participantIdentity: Participant.Identity? = null, passedRoom: Room? = null, usePlaceholders: Set<Track.Source> = emptySet(), onlySubscribed: Boolean = true): State<List<TrackReference>>

Returns an array of TrackReferences for a participant depending the sources provided.

Link copied to clipboard
fun rememberRoomInfo(passedRoom: Room? = null): RoomInfo

Remembers the room info and updates whenever it is changed.

Link copied to clipboard
fun rememberSession(tokenSource: TokenSource, options: SessionOptions = SessionOptions()): Session
Link copied to clipboard
Link copied to clipboard
fun rememberSpeakingParticipants(room: Room? = null): State<List<Participant>>
Link copied to clipboard
fun <T : Track> rememberTrack(trackIdentifier: TrackIdentifier): State<T?>

Observes the trackIdentifier object for the track.

Link copied to clipboard
Link copied to clipboard
fun rememberTracks(sources: List<Track.Source> = listOf( Track.Source.CAMERA, Track.Source.SCREEN_SHARE ), usePlaceholders: Set<Track.Source> = emptySet(), passedRoom: Room? = null, onlySubscribed: Boolean = true): State<List<TrackReference>>

Returns an array of TrackReferences depending the sources provided.

Link copied to clipboard
fun rememberVoiceAssistant(passedRoom: Room? = null): VoiceAssistant

This looks for the first agent-participant in the room.