AgentParticipant class
Represents an AI agent participant in the room.
AgentParticipant extends Participant and provides agent-specific
functionality such as state tracking (idle, listening, thinking,
speaking) and transcription events.
Agent-specific events:
- Events.agentStateChanged — emitted when the agent's state changes.
- Events.agentTranscriptionReceived — emitted when a transcription segment is received from the agent.
- Events.agentMetrics — emitted when metrics data is received from the agent.
Supported methods: remove, pin, unpin, getVideoStats, getAudioStats,
Methods that are not applicable to an agent participant throw an UnsupportedError when called.
Example
participant.on(Events.agentStateChanged, (AgentState state) {
print('Agent state: ${state.name}');
});
participant.on(Events.agentTranscriptionReceived, (TranscriptionSegment segment, Participant participant) {
print('Transcription: ${segment.text}');
});
});
- Inheritance
-
- Object
- Participant
- AgentParticipant
Properties
- agentId ↔ String?
-
The unique agent identifier.
getter/setter pair
- agentState → AgentState
-
The current state of the agent.
no setter
- displayName ↔ String
-
The display name of the participant who has joined the room.
getter/setter pairinherited
- id ↔ String
-
The unique identifier of the participant who has joined the room.
getter/setter pairinherited
- isAgent → bool
-
Whether this participant is an agent.
no setteroverride
- isLocal ↔ bool
-
Indicates whether this participant is the local participant.
getter/setter pairinherited
-
metaData
↔ Map<
String, dynamic> ? -
Additional metadata associated with the participant.
getter/setter pairinherited
- mode ↔ Mode
-
Represents the current mode of the participant.
getter/setter pairinherited
- pinState ↔ ParticipantPinState
-
Represents the current pin state of the participant.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
streams
↔ Map<
String, Stream> -
The media streams associated with this participant.
getter/setter pairinherited
Methods
-
getAudioStats(
) → List? -
Retrieves real-time audio statistics for the agent participant.
override
-
getVideoStats(
) → List? -
Retrieves real-time video statistics for the agent participant.
override
-
off(
Events event, Function handler) → void -
Removes a previously registered event listener from this AgentParticipant.
override
-
on(
Events event, Function handler) → void -
Registers an event listener on this AgentParticipant.
override
-
pin(
[PinType pinType = PinType.SHARE_AND_CAM]) → void -
Pins the agent participant's media streams.
override
-
remove(
) → dynamic -
Removes the agent participant from the room.
override
-
unpin(
[PinType pinType = PinType.SHARE_AND_CAM]) → void -
Unpins the agent participant's media streams.
override