# Language Same

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()
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.raga.ai/ragaai-catalyst/ragaai-metric-library/additional-metrics/guardrails/language-same.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
