# GLPI AI

## Requirements (self-hosted)

| GLPI Version | Minimum PHP | Recommended |
| ------------ | ----------- | ----------- |
| 10.0.x       | 8.1         | 8.2         |
| 11.0.x       | 8.2         | 8.4         |

* Open AI API key (free or paid plan) (<https://platform.openai.com/api-keys>)
* Open AI organization ID (<https://platform.openai.com/account/organization>)

{% hint style="info" %}
A [GLPI Network BASIC](https://services.glpi-network.com/#offers) subscription (or higher) is required. This plugin is also available for all GLPI Network [Cloud instances](https://glpi-network.cloud).
{% endhint %}

***

## Install the plugin

* Go to the marketplace. Download and install the **GLPI AI** plugin.

<div align="left"><figure><img src="/files/GyhmHebu15oqcbSvlrIK" alt="images/glpiai-1.png"><figcaption></figcaption></figure></div>

***

## Create an organization

After creating an OpenAI account, your can create an organization from your account settings under the **Organization** tab or by accessing the page directly at <https://platform.openai.com/account/organization>.

Keep the **Organization ID** value, as you will need to insert it in the GLPI AI plugin configuration.

<figure><img src="/files/BDwIdxaJ8gj0VAOLsNCn" alt="images/glpiai-2.png"><figcaption></figcaption></figure>

***

## Create a secret

* From this URL <https://platform.openai.com/api-keys>
* Click on **Create a new key**

<figure><img src="/files/9SsKUnZrmyEqfMqm3ozk" alt="images/glpiai-3.png"><figcaption></figcaption></figure>

* Give a name to your secret
* Click on **Create secret key**

<div align="left"><figure><img src="/files/70RXPN3GuyOeFJTBxfwm" alt="images/glpiai-4.png"><figcaption></figcaption></figure></div>

Copy the secret value that is generated as you will need it later to configure the plugin.

<div align="left"><figure><img src="/files/Xu4l4544SbrlgjWVdUJw" alt="images/glpiai-5.png"><figcaption></figcaption></figure></div>

***

## Set up GLPI

* In GLPI, go to **Setup > General > GLPI AI**
* Fill in the fields with the values copied previously

<figure><img src="/files/GO6yYELZhVbFKGfj4QXz" alt="images/glpiai-6.png"><figcaption></figcaption></figure>

* If your configuration is correct, you will be able to see your account entries, your consumption and your preferences.

<figure><img src="/files/kIvuVcadgmlaPJk3SF4D" alt="images/glpiai-7.png"><figcaption></figcaption></figure>

***

## Consumption

It is possible to limit the use of the API by specifying a limit that must not be exceeded. This plugin tracks usage based on each response from OpenAI. Therefore, you may need to utilize the "Custom usage" field in the configuration to account for usage outside of the plugin if you want the plugin to account for that in its usage limitation.

<div align="left"><figure><img src="/files/AfYbVaCkG4cVz3kRxwGz" alt="images/glpiai-8.png"><figcaption></figcaption></figure></div>

1. To limit usage and avoid overruns, specify a value that must not be exceeded. If this limit is exceeded, the plugin will no longer function until this value is increased.
2. Enter the custom usage if you want to account for previous usage outside of the plugin.

<div align="left"><figure><img src="/files/RiqhjLqLDhECYO9qQSBF" alt="images/glpiai-9.png"><figcaption></figcaption></figure></div>

***

## Preferences

In preferences, you can set up the response model. In Free mode, you can use the GPT-3.5 Turbo 16K model.

<div align="left"><figure><img src="/files/YiIxi826hRv5VGbYp52g" alt="images/glpiai-10.png"><figcaption></figcaption></figure></div>

You can find information regarding the other plans and plan limits [here](https://platform.openai.com/account/limits)

By clicking on **Configure preferences**, you can setup a context and a role.

* The **Context** can be a description of your company, your mission, your job in the company. AI needs to understand your context if it is to respond as pertinently as possible (there is a context by default that you can change).
* The **Role** is how the AI should respond. Does it have a teaching, advisory or expert role? The role can influence the tone and level of detail of the response (there is a role by default that you can change).

<figure><img src="/files/6ZgexUhfruoqZSvy4e0z" alt="images/glpiai-11.png"><figcaption></figcaption></figure>

***

## Example

You can see an example of what can be achieved with an exchange that includes a lot of followups. The GLPI AI plugin summarizes all of the followups to highlight the main information.

<figure><img src="/files/vqo1syD7X8PPAKLluz9x" alt="images/glpiai-12.gif"><figcaption></figcaption></figure>

If you want another result, you can click on **Refresh**.

***

## FAQ

If you have any questions about using the plugin, please consult our FAQ

<a href="/spaces/SvoJ3lioglS2UZLcWWyP/pages/xxUIvxhWnYy7AE6koIBN" class="button secondary">Go to FAQ</a>


---

# 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://help.glpi-project.org/doc-plugins/plugin-glpi-network/glpiai.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.
