Skip to main content

Variant attributes provide per-variant configuration so prompts and behavior can change by location, environment, or tenant without separate code or deployments.

At runtime, the platform selects a variant, and the agent reads the attributes associated with that variant.

Location

Variant attributes are defined in:

What the file contains

The file has two top-level keys:
  • variants
  • attributes

Variants

The variants section defines the available variants. Each variant includes:

Attributes

The attributes section defines the values that vary by variant. Each attribute includes: Every attribute must provide a value for every defined variant, even if that value is blank.

Attribute types

An attribute with no kind is a string attribute, which is how every attribute behaved before types existed — existing files need no change. Declaring a kind does two things: values are checked against it when you push, so a typo is caught at authoring time rather than on a live call, and the agent receives the value in its real type. A number attribute arrives as 3, not "3", and a boolean as true, not "True". Values are written in their declared type. A quoted value is still read correctly — max_retries: 3 and max_retries: "3" are the same attribute, and neither shows as a change against the other — but poly pull writes the native form. A blank value is allowed for every kind and means the attribute is not set for that variant yet.
config is per-kindOnly enum takes a config today. It is nested rather than a top-level enum_values so a future kind can carry its own settings without every other kind growing a field it ignores — and because values at the top level is already the per-variant value map.
Changing an attribute’s kind does not convert its existing values. Update the values in the same change, or the push is rejected with the variants whose values no longer fit.

Blank values at runtime

A blank value behaves differently depending on the kind, and the difference only shows up on a live call:
  • A blank string attribute substitutes an empty string, so {{attr:name}} resolves to nothing.
  • A blank attribute of any other kind is left out of the deployed agent entirely, so {{attr:name}} stays unresolved and is reported as a configuration gap.
If a prompt depends on a typed attribute, give it a value for every variant rather than leaving one blank.

Types that Agent Studio shows but does not store

Agent Studio’s type picker offers three types that have no equivalent here, because the platform stores them as one of the five kinds above: They are editor choices, not stored types. Agent Studio re-detects “Date & time” and “Opening hours” by matching the value’s exact shape, so editing one of those values here into a different shape silently drops the attribute back to a plain text editor in the UI. The value itself still works. “Voice” is indistinguishable from any other enum once saved.

Example

Why variants are useful

Variants let one agent behave differently in different contexts without duplicating the whole project.

Branding

Change names, labels, or brand-specific wording.

Contact details

Swap phone numbers, addresses, and office hours.

Environment-specific behavior

Store values such as region codes, timezones, or flags.

Multi-tenant setups

Reuse the same logic with tenant-specific values.

Using variant attributes in prompts and resource files

Use {{attr:attribute_name}} in supported text fields such as:
  • flow step prompts
  • topic actions (not in content or example_queries)
  • rules (rules.txt)
  • persona (persona.txt)
  • greeting (welcome_message)
  • disclaimer message

Example

Using variant attributes in Python

In code, variant values are read from conv.variant:
Use the same attribute names that are defined in variant_attributes.yaml. To switch the active variant at runtime, call:

Typical attribute types

Common uses include:

Important formatting notes

  • variant names with special characters should be quoted
  • multi-line values should use |-

Validation

  • Exactly one variant must have is_default: true — validation fails if zero or more than one variant is marked default.
  • Every variant must have a value in every attribute’s values map — a missing variant fails validation.
  • Each variant name and each attribute name must be unique.
  • Every attribute name must be a valid Python identifier — a letter or underscore followed by letters, digits or underscores — and not a Python reserved word. customer-name and class both fail.
  • Every value must match its attribute’s declared kind — a value of the wrong type fails validation, naming the variant it came from.
  • An enum attribute must declare a non-empty config.values list, with no duplicates.

Best practices

  • keep variant names stable over time
  • set exactly one default variant
  • provide a value, or a blank one, for every variant in every attribute
  • declare a kind whenever the value is not text, so mistakes surface at push time
  • prefer {{attr:...}} over hard-coded strings when values vary by location or environment
  • use multi-line YAML for disclaimers, instructions, or longer text values

Topics

See how variant attributes are used in topic actions.

Voice settings

Use variant attributes in greetings and disclaimers.

Variant management (platform)

How variants are routed at runtime — SIP header routing, default selection, and conv.variant access.
Last modified on November 27, 2026