Language detection
Overview
The language detection
system tool allows your Conversational AI agent to switch its output language to any the agent supports.
This system tool is not enabled automatically. Its description can be customized to accommodate your specific use case.
Where possible, we recommend enabling all languages for an agent and enabling the language detection system tool.
Our language detection tool triggers language switching in two cases, both based on the received audio’s detected language and content:
detection
if a user speaks a different language than the current output language, a switch will be triggeredcontent
if the user asks in the current language to change to a new language, a switch will be triggered
Custom LLM integration
Purpose: Automatically switch to the user’s detected language during conversations.
Trigger conditions: The LLM should call this tool when:
- User speaks in a different language than the current conversation language
- User explicitly requests to switch languages
- Multi-language support is needed for the conversation
Parameters:
reason
(string, required): The reason for the language switchlanguage
(string, required): The language code to switch to (must be in supported languages list)
Function call format:
Implementation: Configure supported languages in agent settings and add the language detection system tool. The agent will automatically switch voice and responses to match detected languages.
Enabling language detection
Configure supported languages
The languages that the agent can switch to must be defined in the Agent
settings tab.
API Implementation
When creating an agent via API, you can add the language detection
tool to your agent configuration. It should be defined as a system tool: