Id of the agent this participant is an instance of, as configured server-side.
Distinguishes which agent joined, where id identifies this particular participant.
What the agent is doing right now, one of AgentState.
Kept in sync from the agent-state-changed event, which useAgentParticipant surfaces as onAgentStateChanged.
true, which is what separates this from a Participant.The event to unsubscribe from.
The same function that was passed to on.
Subscribes to this agent's own events.
The three agent-specific ones are what useAgentParticipant surfaces as onAgentStateChanged, onAgentTranscriptionReceived and onAgentMetrics.
The event to subscribe to.
Called when the event fires.
AgentParticipantis an AI agent in the room.Agents and people arrive through the same useRoom
onParticipantJoinedevent and sit in the sameparticipantsmap, soisAgentis the first place they can be told apart. Branch on it before choosing a hook: useParticipant throws for an agent id, and useAgentParticipant is the one that takes it.Prefer useAgentParticipant in a component — it exposes this state as tracked React state plus the agent's own events. This class documents what the raw object carries.