> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexxible.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create with AI

Designing microservices using Artificial Intelligence (AI) allows for their automatic generation from requests expressed in natural language. This feature reduces the need for advanced technical knowledge and speeds up the development process by eliminating the need for manual programming.

The microservice code is generated according to the request made, but the creation process is completed in the [Designer](ms-designer) section, from where the microservice can be enabled so that it can be executed.

<img src="https://mintcdn.com/flexxible/x7fq2jBSZwhGz_Jn/images/features/ai_designer.png?fit=max&auto=format&n=x7fq2jBSZwhGz_Jn&q=85&s=4b0f080458a3c3676fba35694d3fe377" alt="ai_designer" width="1000" height="439" data-path="images/features/ai_designer.png" />

## Create a microservice

The steps to create a microservice through AI are as follows:

1. Go to **Microservices** → **Create with AI**.

2. In the central panel, write the request in natural language and with a maximum of 400 characters. At the bottom, **Try something like this** offers examples that can help create a request.

3. In the drop-down, choose in which scope it will run: *System Microservice* or *Session Microservice*.

   <img src="https://mintcdn.com/flexxible/x7fq2jBSZwhGz_Jn/images/features/choose-system-session-ms.png?fit=max&auto=format&n=x7fq2jBSZwhGz_Jn&q=85&s=d27d3e729c4718dc27ccbc3d1089bb9a" alt="choose-system-session-ms" width="1001" height="443" data-path="images/features/choose-system-session-ms.png" />

4. Click the arrow in the orange box to continue.

5. If there are similar microservices, they will be offered as available alternatives. The user can click on each of them to analyze their use in relation to the desired objective. When doing so, you will be redirected to the [Marketplace](ms-marketplace) section.

   If, after reviewing the alternatives, the user considers that a new microservice must be created, they must click **Create with AI**.

   <img src="https://mintcdn.com/flexxible/x7fq2jBSZwhGz_Jn/images/features/exist-ms.png?fit=max&auto=format&n=x7fq2jBSZwhGz_Jn&q=85&s=919a53d95c3ede5c8af15c73e75d3d59" alt="exist-ms" width="600" height="478" data-path="images/features/exist-ms.png" />

6. A few seconds later, the AI will design the microservice.

   <img src="https://mintcdn.com/flexxible/x7fq2jBSZwhGz_Jn/images/features/iadesign-panel.png?fit=max&auto=format&n=x7fq2jBSZwhGz_Jn&q=85&s=5bf08433f2d2f68e0a8dc948fdaf9946" alt="iadesign-panel" width="1001" height="440" data-path="images/features/iadesign-panel.png" />

   The **Copy code** button allows you to copy the generated code to the clipboard, facilitating its use in tests if required.

   <img src="https://mintcdn.com/flexxible/x7fq2jBSZwhGz_Jn/images/features/copy-script.png?fit=max&auto=format&n=x7fq2jBSZwhGz_Jn&q=85&s=97b318a67405b7c0a415b03c662ffe8f" alt="copy-script" width="650" height="218" data-path="images/features/copy-script.png" />

   <Note>
     This feature only generates microservices in PowerShell.
   </Note>

7. Review the microservice code.

   <img src="https://mintcdn.com/flexxible/x7fq2jBSZwhGz_Jn/images/features/expand-code.gif?s=f6076c5d8246013f310031f9873eaf69" alt="expand-code" width="1921" height="822" data-path="images/features/expand-code.gif" />

8. The **Improve the microservice** box, located at the bottom right of the screen, allows the user to add information to optimize the microservice. With each improvement, a new version of the code is generated, which can be viewed in the **Microservices created** column, located at the top.

9. Click **Create microservice**.

   <Info>
     If you click **Create microservice** again on an existing microservice request, you will be asked for confirmation to verify whether you want to create a new one. If so, another microservice will be generated whose name will include a number at the end to differentiate it from the original. **In no case will the code or configuration of an already created microservice be overwritten.**

     <img src="https://mintcdn.com/flexxible/9c-R-kCht3izjMOg/images/features/used_project.png?fit=max&auto=format&n=9c-R-kCht3izjMOg&q=85&s=4fe2c0aad98e98c70b3e99045f39ed5b" alt="used_project" width="400" height="350" data-path="images/features/used_project.png" />
   </Info>

10. Next, the user will be directed to the [Designer](ms-designer) section to edit the microservice's configuration, if desired.

    <img src="https://mintcdn.com/flexxible/9c-R-kCht3izjMOg/images/features/ia-ms-edit.png?fit=max&auto=format&n=9c-R-kCht3izjMOg&q=85&s=924756332cb65d6b66066738c2423318" alt="ia-ms-edit" width="999" height="426" data-path="images/features/ia-ms-edit.png" />

11. Click **Save**.

12. The microservice will appear in the list of the [Designer](ms-designer) and [Marketplace](ms-marketplace) sections.

<Info>
  By default, microservices generated with AI are created without any category and have the **Flexxible Microservices License** license. This configuration can be modified in Designer.
</Info>

<Warning>
  AI can also make mistakes. The execution of microservices designed with this method is the user's responsibility.
</Warning>

## Writing requests

The more detailed a request is, the more precise and useful the generated microservice will be.
To achieve this, it is recommended that messages meet the following guidelines:

**1. Concise**

* Avoid vague, redundant, or overly long phrases.
* Use direct language.
* Clarity should take priority over the number of words.

**2. Specific**

* Explain exactly what you want to obtain.
* Include details such as the output format, tools, objective, restrictions, etc.
* The more details provided, the better the result.

**3. Context**

* Indicate where the action will be applied.
* If context is missing, the AI could create generic results.
* Specify the purpose of the microservice.

**4. Verbs in the imperative mode**

* It is suggested to use verbs that clearly indicate what the AI should do.
* Examples: create, do, analyze, generate, search, compare, etc.

### Recommendations

In addition to writing clear requests, it is advisable to structure them so that the AI accurately understands what it should do and how to present the result. To achieve this, it is suggested to keep in mind the following recommendations:

* **Avoid ambiguity.** Each request should have only one possible interpretation.
* **Iterate and improve.** If the result is not optimal, the request can be adjusted by adding more context.
* **Use examples when possible.**  Showing an output model better guides the result.
* **Specify the concrete action.** Directly describe the task the AI should execute.
* **Include reference examples.** Show what the expected output should look like, to correctly guide the AI's interpretation.
* **Establish restrictions or rules.** Indicate the limits, conditions, or requirements that must be met during execution.
* **Define success criteria.** Explain what conditions the result must meet to be considered satisfactory.

### Examples of how to make a request

| :x:                                                                                                    | :white\_check\_mark:                                                                                                                                                                                                               |   |
| ------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
| Can you make a backup of the desktop and documents?                                                    | Make a backup of the desktop and the Documents folder. Copy these files as ZIP to \nas\backups\<username>. Also, I want to keep only the latest copy. Delete the rest of the files as soon as the copy has completed successfully. |   |
| Create a scheduled task on the computers that logs off the session after a certain time of inactivity. | Create a scheduled task on Windows 11. The task must log off the current user's session when 30 minutes of inactivity are detected.                                                                                                |   |

## My requests

The **My requests** column, located on the left side of the screen, shows the microservice requests that the user has made to the AI. Each user can only see their own; they are not shared with the rest of the organization.

<img src="https://mintcdn.com/flexxible/9c-R-kCht3izjMOg/images/features/my_request.png?fit=max&auto=format&n=9c-R-kCht3izjMOg&q=85&s=f7c93c433bcb41cd8cc44df6e1510e20" alt="my_request" width="450" height="354" data-path="images/features/my_request.png" />

This feature allows the request history to be visible at all times by the user who created it so that they can always return to them. It also allows you to provide feedback on the result; to do so, the user can click on the thumb-shaped buttons, located at the top right of the screen.

<img src="https://mintcdn.com/flexxible/9c-R-kCht3izjMOg/images/features/feedback_ms.png?fit=max&auto=format&n=9c-R-kCht3izjMOg&q=85&s=eff2000c9e4b803256191def310f2816" alt="feedback_ms" width="800" height="74" data-path="images/features/feedback_ms.png" />

### Delete a request

1. Go to the **My requests** column, located on the left side of the screen.

2. Click on a request from the list to enter the code detail.

3. Click the **Delete** icon, located at the top right of the screen.

4. Read the warning message.

   <img src="https://mintcdn.com/flexxible/9c-R-kCht3izjMOg/images/features/delete_project.png?fit=max&auto=format&n=9c-R-kCht3izjMOg&q=85&s=de58417924e486d9c9339759c8b74b4c" alt="delete_project" width="453" height="272" data-path="images/features/delete_project.png" />

5. Click **Cancel** or **Delete**, as appropriate.

<Info>
  Deleting a request does not mean deleting the microservice created from it.
</Info>

## Microservices created

On the right side of the screen, the **Microservices created** column presents the list of all microservices created from a request. This panel allows you to identify whether a request has resulted in one or several microservices, as well as access each one directly for review.

* When the AI designs the first version of a microservice, but it has not been created through the **Create microservice** button, the **Microservices created** column shows a message like the one in the following image:

  <img src="https://mintcdn.com/flexxible/5IAZJ8b_KGcEs0u-/images/features/ms_no_created.png?fit=max&auto=format&n=5IAZJ8b_KGcEs0u-&q=85&s=b45c14af452ec8104baf55484047e31e" alt="ms_no_created" width="412" height="222" data-path="images/features/ms_no_created.png" />

  The orange arrow located in the box of each version allows you to load the code of the previous version.

  <img src="https://mintcdn.com/flexxible/5IAZJ8b_KGcEs0u-/images/features/one_ms_created.png?fit=max&auto=format&n=5IAZJ8b_KGcEs0u-&q=85&s=ad2132834cf715572a8ea8a11ecbbe34" alt="one_ms_created" width="425" height="240" data-path="images/features/one_ms_created.png" />

* When the AI designs the first version and **Create microservice** is clicked, the **Microservices created** column shows the name of the microservice. If clicked, its detail view is accessed in the [Designer](ms-designer) section.

* When the AI designs and creates more than one version of a microservice, the **Microservices created** column shows the word *Multiple*.

  Clicking on *Multiple* opens a modal window with the list of microservices created from that request. Selecting one of them accesses its detail view in the [Designer](ms-designer) section.

  <img src="https://mintcdn.com/flexxible/miClNVYCneaBzp-1/images/features/ms_related.png?fit=max&auto=format&n=miClNVYCneaBzp-1&q=85&s=e032c850835bd3991f4d6d23b586c6e8" alt="ms_related" width="1000" height="503" data-path="images/features/ms_related.png" />

## Enable a microservice

The process to enable or disable an AI-generated microservice is the same as the one used to create microservices manually.

**Steps to enable a microservice from Designer:**

1. Go to **Microservices** → **Designer**.

2. Find the microservice in the list and click on it.

3. Click the **Enable** button, located at the top right of the screen.

   <img src="https://mintcdn.com/flexxible/5IAZJ8b_KGcEs0u-/images/features/enabled-ms.png?fit=max&auto=format&n=5IAZJ8b_KGcEs0u-&q=85&s=c1fcff7c9a2273a340181380752cc814" alt="enabled-ms" width="800" height="479" data-path="images/features/enabled-ms.png" />

4. The microservice will appear marked with a green dot (sign of being enabled) in the [Marketplace](ms-marketplace) section.

   <img src="https://mintcdn.com/flexxible/5IAZJ8b_KGcEs0u-/images/features/enabled-marketplace.png?fit=max&auto=format&n=5IAZJ8b_KGcEs0u-&q=85&s=782753fae1d7598ee69be407c501a78d" alt="enabled-marketplace" width="851" height="340" data-path="images/features/enabled-marketplace.png" />

**Steps to enable a microservice from Marketplace:**

1. Go to **Microservices** → **Marketplace**.
2. Find the microservice in the list and click on it.
3. Click the **Enable** button, located at the top right of the screen.
4. The microservice will appear marked with a green dot (sign of being enabled).

## Enable a microservice for the end user

The process of enabling a microservice created with AI for execution by the end user is the same as for microservices designed manually.

Please refer to the Enable microservices for the end user guide.

<Note>
  Flexxible recommends reviewing the `Privacy` and `Recipients` tabs in the [Designer](ms-designer) section before enabling a microservice to verify that they have the desired configuration.
</Note>
