Skip to main content

What Are Channel-aware Prompts?

Channel-aware prompts let you customize your agent’s persona and skill context based on whether the user is interacting via voice or text. This is rarely needed — the platform handles most channel-specific behavior automatically. But when you have genuinely different communication needs (e.g., conversational tone on voice, structured lists on text), this feature lets you optimize for each channel.

Rule of thumb:

If you need to ask “should I say this differently on voice vs text?”, you probably don’t need channel-aware prompts. Most agents should keep a simple string persona and context.

When to Use Channel-aware Prompts

Use the polymorphic form only if you have a measurably different need:

✅ Use it for:

  • Conversational tone on voice, structured formatting on text
  • Voice-specific instructions (e.g., “avoid markdown”)
  • Text-specific instructions (e.g., “use ::: list-item blocks”)

❌ Don't use it for:

  • Minor tweaks or polish
  • The same concept explained differently
  • Most agents (keep it simple)

Syntax

Both persona and skill context accept the polymorphic form:

Fields

  • base — Shared across all channels (optional)
  • voice — Voice-specific additions (optional, ignored on text)
  • text — Text-specific additions (optional, ignored on voice)
Strict semantics: If a channel-specific key isn’t set, it is not rendered. There is no fallback across channels.
Validation: The object must have at least one non-empty field. Empty objects ({}), empty strings (""), and objects whose only present fields are empty ({ base: "" }) are rejected at push time — pass undefined or omit the field entirely if you want no persona / context.

Examples

Example 1: Customer Support Agent

On voice, the agent hears:
“You are Alex… Speak naturally and conversationally. Use short, clear sentences…”
On text, the agent sees:
“You are Alex… For longer explanations, break them into ::: list-item blocks…”

Example 2: Hotel Booking Agent

Example 3: Analytics Report Skill

Migration: From String to Object

If you start with a simple string and later realize you need channel-specific behavior, the migration is straightforward: Before:
After:
All existing string personas continue to work unchanged.

Common Patterns

Pattern 1: Base + Voice Only

When you only need voice customization (text uses the base):
On voice: base + voice
On text: base (text field is not rendered)

Pattern 2: Base + Text Only

When you only need text customization (voice uses the base):
On voice: base (voice field is not rendered)
On text: base + text

Pattern 3: Base + Both Channels

Full customization for both channels:
On voice: base + voice
On text: base + text

Best Practices

1

Start simple

Write a single string persona first. Add channel-aware behavior only when you discover a real need.
2

Use base for shared content

Put the core agent personality and responsibilities in base. Use voice and text only for channel-specific nuances.
3

Voice: conversational

On voice, focus on natural language flow, short sentences, and oral clarity.
4

Text: structured

On text, leverage the ::: components (list-item, actions, links, etc.) for visual clarity.
5

Don't over-optimize

Remember: the platform handles 95% of channel-specific behavior for you (voice tone, text formatting rules, etc.). Only use this feature for cases where you genuinely need different core instructions.
6

Test both channels

When using channel-aware prompts, always test in both voice and text to ensure they work as intended.

API Reference

See the persona field in LuaAgent and context field in LuaSkill for complete type signatures and examples.

Next Steps

Persona Guide

Deep dive into creating effective personas

Skill Guide

Learn about skill design and context

Text Formatting

::: component syntax for text channels

Voice Channels

How voice calls work in Lua