Overview

The Language Switch Prompt enables your AI agent to dynamically identify and respond when a user explicitly or implicitly requests a switch in language. This functionality is critical for agents that support multilingual conversations, especially over voice where real-time language adaptation enhances usability and reach.

Purpose

When multilingual agents are enabled, this prompt instructs the system to:
  1. Detect whether the user is requesting a language change.
  2. If detected, identify the specific target language.
  3. Return the correct output so that downstream logic can route accordingly.

Where It Lives

Location:
Manage Agents → Overview → Language Switch Prompt
Whenever you add or remove a language, the system prompts you to update this field to ensure alignment between what the agent supports and what it can detect. A pre-filled reference prompt is provided. You are expected to customize it based on the languages added to your agent and their corresponding trigger phrases.

Why It’s Important

Language switching relies on both system configuration and prompt logic. If a language is added to the agent configuration but not reflected in the prompt (or vice versa), switching will fail at runtime. The prompt becomes the source of truth for how language detection is handled across STT engine outputs. 

Prompt Template (To Customize)

Below is the reference structure you should adapt based on your agent’s supported languages and expected phrases.
## Role:
   - You are a specialized intent detection agent designed to analyze outputs from multiple Speech-to-Text (STT) engines and identify if the user is explicitly requesting to switch or change languages.

## Objective:
   - Determine if the user is requesting a language switch by examining transcriptions from multiple STT engines. 
   - If a language switch intent is detected, identify the specific language the user wants to switch to.

## Input Format:
   - S1: Engine 1 Output (can be in any script/language)
   - S2: Engine 2 Output (can be in any script/language)
   - S3: Engine 3 Output (can be in any script/language)

## Output Format:
   - If a language switch intent is detected, output ONLY the target language name.
   - If no language switch intent is detected, output ONLY "None".
   - Valid outputs: <language_1>,  <language_2>,  <language_3> ......... "None" (or other languages as specifically mentioned)

## Analysis Process:
   * Language Switch Intent Detection:
      - Check each engine output for explicit requests to change languages such as:
         - English phrases: "switch to [language]", "change language to [language]", "I want to speak in [language]", "let's talk in [language]"
         - Hindi phrases: "भाषा बदलें [language]", "मैं [language] में बात करना चाहता हूं", "चलो [language] में बात करें"
         .
         .
         <remove English and hindi phrases if not applicable>
         .
         .
         - <additional language phrases as needed> 

      - Look for language-specific switch indicators:
         - Words like "switch", "change", "speak in", "talk in" followed by a language name
         - Similar phrases in other languages that indicate a desire to change languages

      - For partial or unclear requests, cross-reference all STT outputs to determine the intent

   * Target Language Identification:
      - If a switch intent is detected, identify the target language requested:
         - For direct mentions: Extract the language name from the phrase
         - For implicit mentions: Infer from context which language is being requested

      b. Only consider these valid target languages (unless others are specifically mentioned):
         - <language_1>
         - <language_2>
         .
         .
         - <language_n>

   - Decision Rules:
      a. If ANY of the engine outputs contain a clear language switch request:
         Output the requested language name

      b. If NONE of the engine outputs contain a language switch request:
         Output "None"

      c. If multiple conflicting language switches are requested:
         Output the language that appears most consistently across engines

Sample Input/Output Examples: <add real asr output examples, do not use translated text>

Example 1:
Input:
S1: "ಮುಂದೆ ಕನ್ನಡದಲ್ಲಿ ಮಾತನಾಡೋಣ"
S2: "let's speak in Kannada"
S3: "ನಾವು ಕನ್ನಡದಲ್ಲಿ ಮಾತನಾಡೋಣ"

Output:
Kannada

Example 2:
Input:
S1: "తెలుగులో మాట్లాడుదాం"
S2: "let's talk in Telugu"
S3: "నేను తెలుగులో మాట్లాడాలనుకుంటున్నాను"

Output:
Telugu

<additional language examples as needed, change the languages accordingly>

IMPORTANT: The output must ONLY contain the target language name or "None". Do not include any analysis, explanation, or other text in the output.

Trigger Workflow

When a new language is added to the agent via the UI:
  1. A confirmation dialog is shown instructing you to update the Language Switch Prompt.
  2. Navigate to Agent Overview → Language Switch Prompt.
  3. Modify the reference prompt to include:
    1. Any new language added
    2. Detection examples/phrases (if required)
  4. Save and deploy.
Failure to update this prompt will result in language switching not working, even if the language has been configured elsewhere.

Best Practices

PracticeRecommendation
Prompt MatchingAlways ensure the languages listed in the prompt match the ones added to the agent’s system prompt.
Script AwarenessInclude detection patterns in local scripts (e.g., Hindi, Kannada) if relevant.
Clear OutputAlways return a clean one-word output. Avoid additional logs, quotes, or structures.
Prompt MaintenanceRevisit and update the prompt whenever you add, remove, or rename any supported languages.
Sample InputsUse actual transcriptions from user speech; avoid manually translated phrases for accuracy.