Skip to main content
IntroductionBuild AgentsAgent FrontendsTelephonyWebRTC TransportManage & DeployReferences
GitHub

Source

useAgentExpression

Note

This feature is under active development and may change based on developer feedback and real-world usage.

useAgentExpression returns the agent's current emotional delivery, as published by Expressive Mode.

Reads the transcript stream the session already subscribes to, so it adds no second text stream handler. The mood decays back to null after ttlTurns agent turns without a new expression, so a feeling doesn't outlive the moment that produced it.

Import

import { useAgentExpression } from "@livekit/components-react";

Usage

const { mood, expression } = useAgentExpression();
return <span title={expression ?? undefined}>{mood ?? "neutral"}</span>;

Properties

opts.ttlTurnsnumber

Agent turns an expression survives before the mood decays to null. 0 disables decay.

Returns

UseAgentExpressionReturn;