# General Instructions

1. **Run an AI Model:**
   * You need an event runs the plugin action called "**Aicado AI Connector".** For example "when a button is clicked".
   * Select an AI model, enter required input data, and set a **webhook URL** for receiving the output.
2. **Save the `run_id` for getting the output response:**
   * Once the action has done, it returns a **`run_id`** as a state.
   * This value should be stored in your database as a new entry, so you can match it later with the run's output.
3. **Get output data with webhook:**
   * When the AI model finishes processing, **Aicado sends the result to your Bubble app via the webhook that you entered in the client-side plugin action**.
   * The webhook endpoint is a backend API workflow you’ve created (e.g., `/wf/get-response`).
4. **Update the Output Entry in the Database:**
   * The webhook sends:
     * `run_id` (to match with the database entry)
     * `output` (text)
     * `output_list` (list of text)
     * `expense` (the number of credits used for the operation)
   * You should search for the existing entry you've created using the `run_id`, and **updates it's fields**.


---

# 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.aicado.ai/aicado-ai-connector-bubble.io/setup-examples-by-models/general-instructions.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.
