@livekit/agents-plugin-bey
v1.0.14
Published
Beyond Presence plugin for LiveKit Node Agents
Maintainers
Keywords
Readme
Beyond Presence plugin for LiveKit Agents
Support for Beyond Presence virtual avatars.
See https://docs.livekit.io/agents/integrations/avatar/bey/ for more information.
Installation
npm install @livekit/agents-plugin-beyor
pnpm add @livekit/agents-plugin-beyPre-requisites
Create a developer API key from the creator dashboard and set the BEY_API_KEY environment variable with it:
export BEY_API_KEY=<your-bey-api-key>Usage
import { AvatarSession } from '@livekit/agents-plugin-bey';
import { AgentSession } from '@livekit/agents';
// Create an avatar session
const avatarSession = new AvatarSession({
avatarId: 'your-avatar-id', // optional, defaults to stock avatar
apiKey: process.env.BEY_API_KEY, // optional if set via env var
});
// Start the avatar in your agent
await avatarSession.start(agentSession, room, {
livekitUrl: process.env.LIVEKIT_URL,
livekitApiKey: process.env.LIVEKIT_API_KEY,
livekitApiSecret: process.env.LIVEKIT_API_SECRET,
});API
AvatarSession
Creates a new Beyond Presence avatar session.
Constructor Options
avatarId?: string- The avatar ID to use. Defaults to stock avatar.apiUrl?: string- The Bey API URL. Defaults tohttps://api.bey.dev.apiKey?: string- Your Bey API key. Can also be set viaBEY_API_KEYenvironment variable.avatarParticipantIdentity?: string- The identity for the avatar participant. Defaults to'bey-avatar-agent'.avatarParticipantName?: string- The name for the avatar participant. Defaults to'bey-avatar-agent'.connOptions?: APIConnectOptions- Connection options for retry logic.
Methods
start(agentSession: AgentSession, room: Room, options?: StartOptions): Promise<void>
Starts the avatar session and connects it to the room.
Options:
livekitUrl?: string- The LiveKit server URL. Can also be set viaLIVEKIT_URLenvironment variable.livekitApiKey?: string- Your LiveKit API key. Can also be set viaLIVEKIT_API_KEYenvironment variable.livekitApiSecret?: string- Your LiveKit API secret. Can also be set viaLIVEKIT_API_SECRETenvironment variable.
License
Apache 2.0
