Skip to main content

Dynamic Configuration

You can store agent level configuration, as well as specify call level configuration to dynamically configure your agent’s behavior without the need to redeploy code. This is perfect for A/B testing, rapid iteration and per-call customization. You can modify system prompts, the voice and the introduction message.

Configuration Hierarchy

Dynamic Configuration will usually follow a three-tier priority system:
  1. Hardcoded Defaults (lowest priority) — Fallback values in your code
  2. Saved Configuration (middle priority) — Values saved via the Playground (CLI coming soon)
  3. Per-Call Overrides (highest priority) — Provided in the Start event of Agent Web Calls

Example

Here’s how the hierarchy works for a customer support agent’s system prompt:
# 1. Hardcoded default in main.py
SYSTEM_PROMPT = "You are a helpful customer support agent."

# 2. Saved in Playground → "You are a friendly customer support agent for Acme Corp..."

# 3. Per-call override via Start event
{
  "type": "start",
  "agent": {
    "system_prompt": "You are a VIP customer support agent for Acme Corp..."
  }
}

# Result: Per-call override is used → "You are a VIP customer support agent..."

Implementation

The merged configuration is available in call_request.agent.
from line import ChatNode

conversation_node = ChatNode(
    system_prompt=call_request.agent.system_prompt or SYSTEM_PROMPT,
    gemini_client=gemini_client,
)

await system.send_initial_message(
    call_request.agent.introduction or INITIAL_MESSAGE
)
Available configurable variables:
  • call_request.agent.introduction
  • call_request.agent.system_prompt
If your code uses call_request.agent, you can preview and test configurations in the Playground without reploying. View all configurable values here.

Use Cases

A/B test system prompts per call via the Start event without modifying deployed code.
Compare voices by overriding per call before committing to production. Voice previewing is available in the Playground.
Personalize introduction messages, prompts, or voices based on user context.
See the Basic Chat Configurable template for a complete example.

Voice

You can set your Agent’s voice directly in the playground. Note that if you make changes to your Agent’s voice settings in your code, this will override the settings from the playground when a call is made.
Voice Settings

Background Audio

You can set your Agent’s background audio directly in the playground. You can also use this page to upload, delete & preview your background sound files. Note that if you make changes to your Agent’s background sound settings in your code, this will override the settings from the playground when a call is made.
Background Sound Settings GIF

Audio Comparison

Listen to the difference between an agent with and without background sound:

With Background Sound

Without Background Sound

Environment Variables

Environment variables are securely added via the console per Agent so you don’t need to upload them in your code base.
Sample Environment Variables