hangup: True. The function controls exactly what is said and when the call ends.
The problem
The solution
Return the utterance and hangup from the function itself. The function speaks the closing message and ends the call atomically — no LLM turn in between.Files involved
goodbye_and_hang_up.py
Goodbye.yaml
Variant attribute for site-specific closing messages
If different locations need different goodbyes, add aclosing_message attribute to config/variant_attributes.yaml. All variants and attributes are defined in this single file.
conv.variant.closing_message as shown above. Every variant must have a value for every attribute — leave it as an empty string if a variant has no custom closing.
is_default may be reassigned on pushThe platform controls which variant is the default. After a push and pull, the is_default assignment in your local file may differ from what you wrote — the server picks the canonical default. This does not affect runtime behavior, but expect the value to change on round-trip.Testing variants
Use the--variant flag with poly chat to verify that each variant produces the correct closing message:
conv.variant is None (for example, if no variants are pushed yet), the function falls back to the default string.
--variant resolves against the deployed environment--variant looks up the variant name in the environment you are chatting against (default: main in sandbox). If you pushed variant_attributes.yaml on a feature branch but have not merged it yet, the variant names will not exist in sandbox and the flag will have no effect. Merge the branch first — with poly branch merge or through Agent Studio — then run poly chat --variant <name>.Related pages
Functions reference
Return values, utterance, hangup, and control flow.
Variants
Per-site configuration using variant attributes.
Return values reference (platform)
All supported return shapes —
utterance, hangup, combined dicts, and transition objects.Variant management (platform)
How variant attributes are defined, routed, and accessed via
conv.variant.
