This section requires Python familiarity. If you are a non-technical operator, share this page with your developer. For no-code alternatives, see Managed Topics (actions) or no-code flows.
conv.log to write logs visible in Conversation review → Diagnosis.
For detailed guides, explore the subpages below:
Guides
Create a function
Set up a function with naming conventions, parameters, and Python code
Libraries
Standard and non-standard libraries available in your functions
Start function
Initialize conversation context before the greeting plays
End function
Run post-call processing after a conversation ends
Return values
Control agent behavior with string and dictionary returns
Variables
Define, update, and persist values across turns
Using tools in topics
Integrate functions into Managed Topics
Delay control
Add filler phrases to avoid silence during slow functions
Reference
conv object
Conversation states, flows, and telephony attributes
conv.log
Structured diagnostics and PII-scoped logging
conv.utils
Built-in helpers for addresses, cities, and structured data
conv.api
Call configured API integrations
ASR biasing
Dynamic speech recognition biasing from functions
History
Access conversation turn history
Voice
Configure TTS voices programmatically
Tool classes
VoiceWeighting, TTSVoice, and provider classes
Agent memory
Persistent data across conversations for repeat callers
Best practices
- Use descriptive names – Action-oriented names like
book_reservationorsend_notificationhelp the LLM understand when to call the function. - Write clear descriptions – Explain what the function does, its parameters, and when it should be triggered.
- Use meaningful parameter names –
reservation_dateis clearer thanr_date. - Control triggering – Define specific rules to prevent over-triggering or under-triggering.
- Test thoroughly – Use Test Cases and Test Sets to validate function behavior across scenarios.
Troubleshooting
- Function not triggering – Check Conversation review → Diagnosis to see if the function was considered. Refine your function description or add clearer rules.
- Wrong parameters – Review
conv.logentries to see what the LLM extracted. Adjust parameter descriptions or add validation. - Unexpected behavior – Simplify function logic and test in isolation before integrating with the agent.

