With OpenAI's ChatGPT, companies can create their own chatbots, so-called custom GPTs, which can then be shared with their own employees or used by the public.
These GPTs behave like the well-known ChatGPT, answer questions or create texts. However, these GPTs can be individually preconfigured and provided with documents which they can use as an additional source of knowledge.
They can also access external application programming interfaces (APIs) with so-called actions. In this article, we explain how you can give a GPT access to your Lexeri termbase. Your GPT will then be able to check and correct self-generated texts, for example, as shown in this video:
Create your own GPT
To be able to use the function described here, you first need your own GPT. You can create this yourself after registering with ChatGPT. You can find out more about GPTs and how you can create one in this article on OpenAi.com: https://openai.com/index/introducing-gpts/
Add a GPT action
After you have created your GPT and made the initial settings, you can teach the GPT to connect to the Lexeri API.
In the configuration tab of the GPT you will find a button "Create new action".
Click on this button to access the form for editing the GPT actions.
In the form for creating the action, we will mainly focus on two points: authentication using API tokens and the API schema. We can create both pieces of information in the termbase settings.
Create API token
An API token authenticates an external system such as the GPT to the Lexeri API. You can subsequently deactivate the API token and thus withdraw access from the external system.
To create an API token, go to the termbase settings and switch to the "API" tab. Here you will find the "Create API token" button:
After clicking on the button, a dialog for creating an API token opens. Here you can give the token a name and select a duration for the token. After this period, the token expires automatically and your GPT will no longer have access to the Lexeri API with this token. You can also select whether the API token should give the GPT write access to the termbase. This is only necessary if you want the GPT to be able to make changes to the terminology like a terminology manager.
Once you have created the token, the new token is displayed in the form of a long row of letters. Click on the "Copy" button to copy the token to your clipboard. You do not need the termbase ID for our example.
The token will no longer be displayed after you close the window, so be sure to copy it before you close the window.
We will now enter the copied token in the GPT configuration.
Enter API token in the GPT
Return to the configuration page of the GPT and click on the cogwheel symbol in the "Authentication" area:
A dialog opens in which we can tell the GPT the API token we have just created. The Lexeri API uses an API key for authentication, which is transmitted as a bearer token. Select these two points in the dialog:
Finally, copy the API token from the clipboard and paste it into the "API Key" text field and then click on "Save".
The GPT now has the necessary information to authenticate itself to the Lexeri API.
Add API schema
Next, we need to teach the GPT what it can use the Lexeri API for. We use machine-readable API documentation in OpenAPI YAML format for this purpose. You can obtain this schema for your termbase in the API tab of the termbase settings. To do this, click on the "OpenAPI YAML" button:
A dialog opens with the API documentation prepared for your termbase in OpenAPI YAML format. You can also copy the text to the clipboard using the copy button.
Then go back to the configuration of the GPT and copy the OpenAPI YAML documentation into the "Schema" input field.
Some available actions should then be listed automatically under the schema. The configuration of the GPT action is now complete:
Using the GPT Action
With the added GPT Action the GPT is able to carry out some of the Lexeri functions. These are for example:
- Querying information in the termbase
- Search for terms and query details of a term
- Checking a text for correct terminology
You can trigger these actions via a prompt. Before accessing the Lexeri API, you must ask the GPT for confirmation of access.
The video embedded above shows what a term check of a generated text with a Lexeri GPT Action can look like.
Caution when using GPTs
Even if the GPT's answers seem impressive or certain, the GPT is not omniscient. Please note therefore: By default, the GPT is not limited to the data from the Lexeri API. You must ensure that the GPT does not invent any additional information.