# Language Auto Switch

{% hint style="info" %}
Although this functionality in Leopard was created to showcase the ability to switch solutions based off the spoken language of the user it could just as well be applied in alternative scenarios.&#x20;

For instance maybe you have separate Teneo Solutions that handle different domains of knowledge. If a classifier in one solution knew that the user's question related to something in another solution then a switch could be triggered.
{% endhint %}

## Output Parameters

To tell Leopard that a switch needs to occur you must define a **couple** output parameters in the `Source Solution`.

```
langinput = User input text you want to send to the new Teneo Runtime URL
```

The language Input will usually be the captured user input that triggered a flow that looks for alternative languages spoken.&#x20;

```
langengineurl = the new target Teneo Interaction Engine URL
```

With both of these output parameters Leopard will automatically make a request to the new TIE url and it will pass the text found in the `langinput` output parameter as the user input.  For the remainder of the user's session, Leopard will continue to communicate with the new TIE server.&#x20;

If you want the Leopard UI to show labels in the respective language then you mush specify the following output parameter.

```
lang=en/es/de/nl/fr/ru
```

To have the Leopard UI load a different Iframe for the new language solution then specify the URL as an output parameter.

```
langurl=https://some-new-url.es/
```

If you have the **Amazon Polly voices** enabled you will need to send an output parameter that instructs Leopard to switch the voice.

```
voice=Ruben
```

{% hint style="info" %}
A list of available Amazon Polly voices can be found here: <https://docs.aws.amazon.com/polly/latest/dg/voicelist.html>
{% endhint %}

## Additional Output Parameters

You can control not just the new target iframe url and TIE url but also the Leopard Chat Title and locale for UI labels and ASR and TTS.

## Language Condition

```
%$RU.LANG:{lob.confidence>0.78}
```

### Screenshot

<div align="left"><img src="https://4062709520-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-La71Iy76rotlqbCOWoQ%2F-Lc3PSk9rRj3uPcKFL8l%2F-Lc3PuWr7uXYib1SOdKD%2Flanguage-handover.jpg?alt=media&#x26;token=af6b2b20-1c86-4e52-a0d7-4391d3200211" alt=""></div>


---

# 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://jolzee.gitbook.io/leopard/components/language-auto-switch.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.
