diff --git a/.changeset/tender-falcons-direct.md b/.changeset/tender-falcons-direct.md new file mode 100644 index 000000000..e7d769a46 --- /dev/null +++ b/.changeset/tender-falcons-direct.md @@ -0,0 +1,5 @@ +--- +"@livekit/agents-plugin-anam": patch +--- + +feat(anam): add director notes config diff --git a/plugins/anam/etc/agents-plugin-anam.api.md b/plugins/anam/etc/agents-plugin-anam.api.md index 72271318d..4a9a3a8d4 100644 --- a/plugins/anam/etc/agents-plugin-anam.api.md +++ b/plugins/anam/etc/agents-plugin-anam.api.md @@ -62,7 +62,14 @@ export class AvatarSession extends voice.AvatarSession { } // @public (undocumented) -export function mintAvatarJoinToken(input: { +export type DirectorNotes = { + expressivity?: number; + presetStyle?: string; + customStylePrompt?: string; +}; + +// @public (undocumented) +export function mintAvatarJoinToken({ roomName, avatarIdentity, publishOnBehalf, apiKey, apiSecret, ttl, }: { roomName: string; avatarIdentity: string; publishOnBehalf: string; @@ -76,6 +83,7 @@ export type PersonaConfig = { name?: string; avatarId?: string; avatarModel?: string; + directorNotes?: DirectorNotes; personaId?: string; }; diff --git a/plugins/anam/src/api.ts b/plugins/anam/src/api.ts index 9f9601e8c..22a1423c0 100644 --- a/plugins/anam/src/api.ts +++ b/plugins/anam/src/api.ts @@ -130,6 +130,11 @@ export class AnamAPI { sessionOptions?: SessionOptions; }) { const pc = params.personaConfig; + const directorNotes = pc.directorNotes + ? Object.fromEntries( + Object.entries(pc.directorNotes).filter(([, value]) => value !== undefined), + ) + : undefined; // Anam's personaConfig is a `oneOf`: reference a previously created // (stateful) persona by `personaId` — the "dev flow" — or configure an // ephemeral persona inline with name/avatarId/llmId. The two are mutually @@ -145,6 +150,7 @@ export class AnamAPI { // Only forward the avatar model version when set; otherwise let Anam // fall back to the avatar's default model. ...(pc.avatarModel ? { avatarModel: pc.avatarModel } : {}), + ...(directorNotes && Object.keys(directorNotes).length > 0 ? { directorNotes } : {}), }; const payload: Record = { diff --git a/plugins/anam/src/types.ts b/plugins/anam/src/types.ts index 491d3b87f..87cd14ed8 100644 --- a/plugins/anam/src/types.ts +++ b/plugins/anam/src/types.ts @@ -1,6 +1,16 @@ // SPDX-FileCopyrightText: 2025 LiveKit, Inc. // // SPDX-License-Identifier: Apache-2.0 +/** @public */ +export type DirectorNotes = { + /** Normalized expressivity in [0, 1] controlling how strongly the avatar responds to style/cues. */ + expressivity?: number; + /** Built-in expressive style, mutually exclusive with customStylePrompt. */ + presetStyle?: string; + /** Free-form expressive style prompt, mutually exclusive with presetStyle. */ + customStylePrompt?: string; +}; + /** @public */ export type PersonaConfig = { /** Optional display name (prod flow) */ @@ -9,6 +19,8 @@ export type PersonaConfig = { avatarId?: string; /** Optional avatar model version, e.g. "cara-3" or "cara-4-latest" (prod flow) */ avatarModel?: string; + /** Optional per-session director-notes overrides (prod flow) */ + directorNotes?: DirectorNotes; /** Optional persona id (dev flow) */ personaId?: string; };