# OpenAI Assistant Detection

This action will forward any user text to an existing OpenAI assistant. The conversation will not hold and will continue with all other actions.

<figure><img src="https://content.gitbook.com/content/tZEstFBYh3uMutlup6ku/blobs/1z5BLiBJ5CwpwV1pWs7I/image.png" alt=""><figcaption></figcaption></figure>

### Settings

The action uses the following settings:

| Setting               | Description                                                                                   | [Parsed](https://docs.mylinkconnect.com/actions-and-operations/dynamic-parsing) |
| --------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| OpenAI API Key        | The API Key that you can generate in your OpenAI account                                      | :white\_check\_mark:                                                            |
| Assistant Id          | The unique id of the trained assistant you wish to use                                        | :white\_check\_mark:                                                            |
| Auto-Generate Content | If enabled, MyLINK Connect will generate the bubble with the content of the assistant reply   | :no\_entry:                                                                     |
| Split Paragraphs      | If enabled, MyLINK Connect will follow your assistant line break to generate multiple bubbles | :no\_entry:                                                                     |

### Remarks

The assistant reply is returned to the chat (or to a variable) directly without any intervention of MyLINK Connect on the content.

Conversation with the assistant will stay in thread, based on the openai\_assistant\_thread variale. If you wish to start a new thread just empty the variable before making a new request.

{% hint style="info" %}
Depending on the OpenAI model, request complexity and OpenAI account level, replies might take more than 20 seconds to be generated.
{% endhint %}

### Trigger

On Reply Received. This action will trigger any child operation as soon as the result is available. This trigger will not be executed if the "Auto-Generate Content" flag is enabled.

### Variables

This action produces the following variables after being triggered:

| Variable                              | Description                                              |
| ------------------------------------- | -------------------------------------------------------- |
| openai\_assistant\_thread             | The thread id of the current conversation                |
| openai\_assistant\_model              | The LLM model used by the assitant                       |
| openai\_assistant\_raw\_reply         | The raw JSON reply of the last assistant request         |
| openai\_assistant\_prompt\_tokens     | The number of prompt tokens used by the last request     |
| openai\_assistant\_completion\_tokens | The number of completion tokens used by the last request |
|                                       |                                                          |

### Availability

Channel specific availability follows the table below:

| Channel          | Availability                                                           |
| ---------------- | ---------------------------------------------------------------------- |
| Facebook         | Fully Available.                                                       |
| WhatsApp         | Fully Available.                                                       |
| Telegram         | Fully Available.                                                       |
| Web              | Fully Available.                                                       |
| Alexa            | **Not Available. Out of AI Detection is not supported inside skills.** |
| Google Assistant | Fully Available.                                                       |
| Slack            | Fully Available.                                                       |
| API              | Fully Available.                                                       |

This action can be used only at [Bot Global level](https://docs.mylinkconnect.com/execution#global-and-local-actions) or [Behavior level.](https://docs.mylinkconnect.com/execution#global-and-local-actions)&#x20;
