# AI Models

{% embed url="<https://www.youtube.com/watch?v=J7TKL4maKbI>" %}

### **Configuring PowerPilot (AI) in Power Embedded**

To have an assistant in the portal, you need to configure the following steps:

1. Validate the [prerequisites ](https://github.com/dirceuresende/docs-power-embedded-english/blob/main/administration-portal/power-pilot-ai/pre-requisitos.md)in the Power BI Admin Portal (you are here).
2. Contract the model on [Azure OpenAI](https://github.com/dirceuresende/docs-power-embedded-english/blob/main/administration-portal/power-pilot-ai/contratacao-de-uma-ia/azure-openai.md) or [OpenAI (ChatGPT)](https://github.com/dirceuresende/docs-power-embedded-english/blob/main/administration-portal/power-pilot-ai/contratacao-de-uma-ia/openai.md)
3. [Create a model ](https://github.com/dirceuresende/docs-power-embedded-english/blob/main/administration-portal/power-pilot-ai/assistentes-de-ia.md)on Power Embedded
4. [Create an assistant](https://github.com/dirceuresende/docs-power-embedded-english/blob/main/administration-portal/power-pilot-ai/assistentes-de-ia.md) on Power Embedded

### **How to Create an AI Model in Power Embedded**

Access the Power Pilot IA > Models page or [click here](https://admin.powerembedded.com.br/AiModels/Create).

Click on the **Create AI Model** button.

<div><figure><img src="/files/gKTwhGZ0UEgjx9V1peKO" alt=""><figcaption><p>Azure OpenAI</p></figcaption></figure> <figure><img src="/files/FDfcLUccxgpJv9GkirO1" alt=""><figcaption><p>OpenAI</p></figcaption></figure></div>

On this screen, you will be able to configure the following settings according to the AI API provider you will use:

* **Name**: This is the name your model will have (you can choose any name you prefer).

<details>

<summary>Azure OpenAI</summary>

**Model:** In this field, you must enter the name of the contracted model (for example: GPT-4o-mini, GPT-4, etc.). To make it easier to find the model name. [**click on this link**](https://oai.azure.com/portal/0ce7f057e4df4ba9bbc98993a2088133/deployment?tenantid=eaa0c55d-e848-4192-ad75-91deaadc01f4)**.**

<img src="/files/KWTS5z7L4x0ZSUzWud4C" alt="" data-size="original">

**Endpoint:** This field is filled in with the Endpoint value.

<img src="/files/DTviZLzQx6W9VzPo0ycF" alt="" data-size="original">

**Key:** Fill in this field with the value of the created key. Below, the path is indicated depending on where the assistant was created.

<img src="/files/tAKxtwrOcDaxEWCcIASh" alt="" data-size="original">

**Cost in USD per 1 million input tokens:** Fill in this field with the cost of tokens per question interaction, which varies according to the contracted model. Avoid using random values, as this may affect the Power Pilot audit. Check the pricing section in to find the exact value.

**Cost in USD per 1 million output tokens:** Fill in this field with the cost of tokens per response interaction, which varies according to the contracted model. Avoid using random values, as this may affect the Power Pilot audit. Check the pricing section in [Azure](https://azure.microsoft.com/pt-br/pricing/details/cognitive-services/openai-service/) to obtain the exact value

</details>

<details>

<summary>OpenAI</summary>

**Model:** Select the model you want to use from the drop-down menu.

**Key:** Fill in this field with the value of the created key.

<img src="/files/e7J6JXBtJJ4Syes9lXMC" alt="" data-size="original">

**Prompt tokens:** Fill in this field with the cost of tokens per question interaction, which varies according to the contracted model. Avoid using random values, as this may affect the Power Pilot audit. Check the pricing section on the a [OpenAI](https://openai.com/api/pricing/) website to find the exact value.

**Completion tokens:** Fill in this field with the cost of tokens per response interaction, which varies according to the contracted model. Avoid using random values, as this may affect the Power Pilot audit. Check the pricing section on the [OpenAI](https://openai.com/api/pricing/) website to obtain the exact value..

</details>

The model has been created. Now we need to create an assistant.


---

# 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.powerembedded.com/administration-portal/power-pilot-ai/ai-models.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.
