> For the complete documentation index, see [llms.txt](https://docs.xenioo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xenioo.com/actions-and-operations/ai/ai-image-detection.md).

# AI Image Detection

This action will send an image and a prompt to a vision-capable AI model and store the resulting description in a conversation variable. Use it to understand what an image sent by the user contains and react accordingly.

<figure><img src="https://2532694803-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvGYwUmVjfELEiJzfmWLC%2Fuploads%2F7Mfzm2KxIXOaj9IHMv7R%2Fimage.png?alt=media&amp;token=1474d99d-ce49-4b46-be2b-9919160dd77d" alt=""><figcaption></figcaption></figure>

#### Settings

The action uses the following settings:

| Setting                | Description                                                                                                       | Parsed               |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------- | -------------------- |
| Image URL              | The public URL of the image to analyze                                                                            | :white\_check\_mark: |
| Prompt                 | What the AI should look for in the image, or how the description should be produced                               | :white\_check\_mark: |
| Use AI module settings | If enabled, the request uses the provider, model and API key configured in the AI module settings                 | :no\_entry:          |
| AI Provider            | The AI provider to use for this request. Only visible when Use AI module settings is disabled                     | :no\_entry:          |
| Model Version          | The model of the selected provider to use for this request. Only visible when Use AI module settings is disabled  | :no\_entry:          |
| API Key                | The API key used to authenticate with the selected provider. Only visible when Use AI module settings is disabled | :no\_entry:          |

#### Remarks

The most common source for the image is a picture sent by the user. Use a Media Attachment Action to collect the image, then reference the variable that holds its URL in the Image URL field.

The Prompt field drives the result. You can ask for a generic description or for something very specific, for example:

* *Describe this image in one sentence.*
* *Read the meter value shown in this photo. Reply with the number only.*
* *Is the product in this picture damaged? Reply yes or no.*
* *Extract the invoice number and the total amount from this document.*

Asking for a short, well defined answer makes it easy to use the result in a Variable Switch Action to branch the conversation.

The selected model must support image input. Most recent models from the major providers do; check your provider documentation if the request fails.

{% hint style="info" %}
The image must be reachable from the internet. Images behind authentication or on private networks cannot be read by the AI provider.
{% endhint %}

{% hint style="warning" %}
If the analysis fails, the trigger is still executed and **ai\_image\_detected** will be empty. The failure is reported in the conversation flow log.
{% endhint %}

#### Trigger

On Image Described. This action will trigger any child operation as soon as the analysis is completed.

#### Variables

This action produces the following variables after being triggered:

| Variable            | Description                                                      |
| ------------------- | ---------------------------------------------------------------- |
| ai\_image\_detected | The description produced by the AI. Empty if the analysis failed |

### Availability

Channel specific availability follows the table below:

| Channel          | Availability     |
| ---------------- | ---------------- |
| Facebook         | Fully Available. |
| WhatsApp         | Fully Available. |
| Telegram         | Fully Available. |
| Web              | Fully Available. |
| Alexa            | Fully Available. |
| Google Assistant | Fully Available. |
| Slack            | Fully Available. |
| API              | Fully Available. |

This action can be used only inside interactions and not as child of other actions.&#x20;
