> For the complete documentation index, see [llms.txt](https://docs.raga.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.raga.ai/ragaai-catalyst/ragaai-metric-library/additional-metrics/guardrails/language-same.md).

# Language Same

Guardrail ensuring language consistency across responses. Prevent mixed-language outputs and enforce clarity.

This scanner checks if the input and output are written in the same language.

**Required Parameters**: Prompt, Response

**Interpretation**: Result pass denotes that the prompt and response are in same language and vice-versa.

#### Code Example:

```python
# LanguageSame
prompt = """Hello, how are you today? I hope you're doing well"""
neg_response = """Bonjour, comment vas-tu aujourd'hui ? J'espère que tu vas bien"""
pos_response = """I am doing good, how are you?"""

evaluator.add_test(
    test_names=["language_same_guardrail"],
    data={
        "prompt": prompt,
        "response": pos_response,
    },
    arguments={"model": "gpt-3.5-turbo-1106", "threshold": 1.0},
).add_test(
    test_names=["language_same_guardrail"],
    data={
        "prompt": prompt,
        "response": neg_response,
    },
    arguments={"model": "gpt-3.5-turbo-1106", "threshold": 1.0},
).run()

evaluator.print_results()
```
