Configuring ChatGPT in Merlin Backoffice ® Flex
The aim of this article is to explain to everyone, whether or not they already use ChatGPT and its API, how to create an OpenAI account and obtain a secret key, then how to correctly configure Merlin Backoffice ® Flex so that it is able to dialogue with the robot in an optimized way.
Create a free or paying account on the OpenAI website
Nothing could be simpler: go to the OpenAi website and click on the Log in button in the top right-hand corner.
You can then create a new account using an email address and password, or from your Google account.
You'll need to choose between a free account and a paid account (currently €20 per month).
Note: if you have opted for a paid account, this is not entirely sufficient, as OpenAi specifies on this page that to be able to chat with ChatGPT4, you must also have purchased at least a few cents' worth of credits: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4
Request an API key for ChatGPT
Once the account has been created and logged in, you need to request an API key. To do this, proceed as follows:
- Click on your account name in the top right-hand corner.
- Then, in the menu that opens, click on "View API keys".
- Or click directly on "API Keys" in the menu on the left.
- Once in the key administration page, click on "Create new secret key".
Access to ChatGPT in the Merlin Backoffice ® Flex module for PrestaShop
The ChatGPT dialog interface has been integrated into MagicEdit, a widely-used tool that is undoubtedly one of your favorites. There are several reasons for this choice:
- Many people have already mastered the tool, so it's easy to relearn.
- Memory for re-use of settings per column.
- Preview and undo function.
- Quick and easy to use. No programming or technical skills required.
- Can now be automated before import to modify CSV or Excel file contents automatically.
How to :
- In any table - products, categories, translations, images (captions), even those displaying the contents of a file before import - select the rows to be modified, then right-click in the column to be filled.
- Click to launch MagicEdit, either limited to the selected lines, or applying to all lines displayed.
ChatGPT API connection configuration
- Open the IA ChatGPT section at the bottom of the features list. Three setting fields are mandatory, marked with a star:
- Choose an "Endpoint" from the list, one of the possible URLS for accessing the OpenAI API. If you don't know which one to choose, stick with the default choice. Not all URLS give access to all versions of the engine (next choice). Find out more on the OpenAI website. Note that you can also add new URLs to the list using the field and + button just below. The - button removes the selected line from the list.
- In the second list, choose the ChatGPT engine or version with which you'd like to chat. In the free version, this will probably be the default choice, gpt-3.5-turbo, and gpt-4 in the paid version. You can also add or remove lines.
- Copy and paste your Open AI API key into this field.
Setting ChatGPT limits
Whether you only have a free OpenAI account for ChatGPT 3.5 or a paid account giving access to GPT-4, there are certain limits to usage that you need to be aware of.
These concern the number of interactions per minute and per day, the volume of words exchanged per question and per day...
These limits have a generic value which you can find in the official API documentation and on your OpenAI account, but it is possible to purchase additional rights from OpenAI.
Merlin Backoffice automatically manages your rights in exchanges with ChatGPT, so that you never exceed one of the limits. If, for example, you are entitled to 3 requests per minute, and you've just sent 3 in 20 seconds, it will wait 40 seconds before sending the fourth on its list.
To do this, it needs to know the limits associated with your account. By default, it is configured with the standard values for ChatGPT 3.5 in the free version. It's up to you to change them if they don't suit your account. The tooltips in the configuration fields also indicate the standard values for ChatGPT4.
As this data is subject to change, please consult the official source: https://platform.openai.com/docs/guides/rate-limits/overview
These values are then stored in Merlin Backoffice Flex, but are not specific to each MagicEdit configuration. These settings therefore only need to be made once for the first use, and not for every use.
Flow rate limit
This is the maximum number of requests per minute allowed by ChatGTP.
For MagicEdit, this corresponds to the maximum number of prompts it can process per unit of time.
The limit forces MagicEdit to slow down to avoid refusal of processing by the robot.
In the free version, the default value is just 3 requests per minute.
In the paid version, the limit is 60 requests per minute for the first 48 hours, then 3,500 requests per minute, which is more than sufficient given the engine's response speed.
Note that GPT4 also has an additional limit, which is currently 50 requests every 3 hours.
Set to 0 or leave empty to avoid setting a limit.
Additional flow limit
This is a second limit on the maximum number of requests, introduced when GTP-4 was launched. Currently set at 50 requests per 3 hours (180 minutes).
Does not apply to GPT-3. If you don't use GTP-4, put 0 in this field or leave it empty so as not to impose this limit on Merlin Backoffice Flex.
Daily limit
This is the maximum number of requests per day allowed by ChatGTP.
For MagicEdit, this corresponds to the maximum number of prompts to be processed per calendar day. The counter is reset to zero at midnight.
The limit therefore forces MagicEdit to slow down, so as not to generate processing refusals by the robot.
In the free version, the default value is just 200 requests per day.
In the paid version, the limit is 2000 exchanges per minute for the first 48 hours, then unlimited.
Set to 0 or leave empty to set no limit.
Size limit
This is the maximum number of tokens per day allowed by ChatGTP.
As a reminder, a value of 1000 tokens gives approximately 700 words.
For MagicEdit, this corresponds to the maximum number of tokens it must process per day.
The limit forces MagicEdit to slow down so as not to generate processing refusals by the robot.
In the free version, the default value is only 40,000 tokens per day.
In the paid version, the limit is 120,000 tokens per day for the first 48 hours, then 180,000.
Set to 0 or leave empty to set no limit.
- Flow rate limit
- Additional flow limit
- Daily limit
- Size limit
Response length and temperature settings
These other two settings can either be made once and for all, or adjusted on a per-use basis, depending on whether or not you have many different usage scenarios. They are stored in MagicEdit's current configuration, along with all other window settings (with the exception of the limit settings described in the previous chapter).
Answer length
Defines the maximum size in "tokens" of the response requested from GPT. A value of 1000 tokens gives approximately 700 words.
500 tokens is a value requiring a short response and therefore consuming less credit.
Depending on your budget and the destination field (e.g. the long description), you can greatly increase this parameter.
Remember that you can also indicate in the prompt itself the length of the desired response, even though ChatGPT tends to make responses longer than requested.
Note: in the free version, the maximum number of tokens for a chat is 4096, but this includes questions (including your prompts and instructions, bearing in mind that prompts 2 to 4 themselves contain prompts and previous answers, so it goes up quickly).
So if you choose a value of 3000 for the answer, you're limited to 1096 tokens for all the instructions and prompts.
This means that with the free version, you'll often have to make do with just one prompt (see the following tutorial, which explains this concept).
Temperature
The sampling temperature, between 0 and 1, defines the randomness of the response provided.
Higher values such as 0.8 will make the output more random, while lower values such as 0.2 will make it more focused and deterministic.
The API help indicates that if set to 0, the model will use logarithmic probability to automatically increase the temperature until certain thresholds are reached.
With the maximum value of 1, you're almost guaranteed to always get a different answer every time the same question is put to ChatGPT.
- Response length.
- Temperature
That's all there is to it, you just need to learn how to interact with the AI. Go to the second tutorial in this section.
Category's other articles ChatGPT and PrestaShop
-
Using ChatGPT in Merlin Backoffice Flex for PrestaShop
Tuto
ChatGPT tutorial for PrestaShop mass product catalog management with Merlin Backoffice Flex
-
How to write a prompt
Guide
Tips and tricks for writing efficient prompts in Merlin Backoffice for PrestaShop
-
Optimisation SEO H2 des fiches produit avec Tchat GPT