Skip to content

Allow tts_text_transforms to be set per-Agent, not just on AgentSession #7015

Description

@kaushal-aubie

Feature Type

Would make my life easier

Feature Description

Description

tts_text_transforms (and the built-in text_transforms.replace() helper) is currently only configurable on AgentSession. In multi-agent workflows/handoffs, different Agent instances often need different TTS text handling — e.g. a billing agent that needs replace() overrides for account/product terminology, while a support agent needs a different set (or none at all). Today the only workaround is manually re-running transforms per agent via a custom tts_node/transcription_node override, which duplicates logic that already exists at the session level.

This is inconsistent with the rest of the framework: Agent already supports per-agent overrides for stt, llm, tts, and vad (used heavily in handoff patterns), so tts_text_transforms feels like a gap.

Solution

Support tts_text_transforms as a constructor option on Agent (Python) / voice.Agent (Node.js), mirroring the existing per-agent stt/llm/tts override pattern. Suggested behavior:

  • If an Agent sets tts_text_transforms, use it in place of the session-level transforms for that agent's turns.
  • If unset, fall back to AgentSession's tts_text_transforms (current behavior), preserving backward compatibility.
  • Optionally support merging/extending session-level transforms rather than only full override, similar to how instructions can be composed.

Workarounds / Alternatives

Overriding tts_node/transcription_node per agent to reapply text_transforms.replace() manually — works, but duplicates built-in logic and loses the "applied in order" composition the session-level API already provides.

Additional Context

Docs reference: https://docs.livekit.io/agents/multimodality/text/#built-in-replace-transform

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions