Overview
The language mismatch policy ensures that the responses provided by the LLM match the language of the user’s input. Its goal is to maintain coherent and understandable interactions by avoiding responses in a different language from the user’s prompt. The detector only checks for mismatches if both the prompt and response texts meet a minimal length, ensuring accurate language detection.User: “¿Cuál es el clima en Madrid hoy y puedes recomendarme un restaurante para cenar?” LLM Response: “The weather in Madrid is sunny today, and I recommend trying out the restaurant El Botín for dinner.” (Detected mismatch: Spanish question, English response)