In this simple guide, we'll automatically generate company descriptions in Airtable using a GPT-3 Airtable integration. GPT-3 is deep learning technology which produces human-like text. We'll use this AI to produce the descriptions.
In your Airtable base, create a table called 'Companies'.
In the primary 'Name' field, enter the names of the companies you would like GPT-3 to create AI descriptions for. You can enter the following companies or choose your own:
Next, create a field called 'Description' (with type 'Long text').
Next, create a field with type 'Formula' called 'Prompt' and copy and paste this line for the formula:
CONCATENATE('user:Write a single-sentence description of the podcast ', Name)
This formula contains our 'Prompt', which we'll reference later.
Please note: The exact words you use for the prompt are very important for ensuring you achieve your desired results. Please read these basic tips and instructions for writing good prompts for OpenAI. You can also learn how to control the length of GPT-3 completions here.
Create a new Grid view called 'Needs Info' and add the following conditions (conditions are created using the 'Filter' menu option);
The 'Name' field is not empty.
The 'Description' field is empty.
Add Data Fetcher to your Airtable base via the Airtable marketplace. Sign up for a Data Fetcher account by entering a password and clicking 'Sign up for free'. Alternatively, you can use your Google login to create a new account. If you already have a Data Fetcher account use the 'Have an account?' text in the bottom left of the screen to log in.
Data Fetcher can be used to import many different types of data from many APIs or websites into Airtable.
Creating requests in Data Fetcher enables you to import data into your Airtable base. To begin, click 'Create your first request' on the home screen of the Data Fetcher extension.
For Application, select 'OpenAI' to use the GPT-3 Airtable integration.
With every new OpenAI account, you receive $5 worth of credit. This is plenty for now, but if you plan to use OpenAI once this has run out, you will need to upgrade your account for more credit.
For Authorization, copy and paste your OpenAI API key.
For Endpoint, choose 'Create chat message completion'.
Give your request a name such as 'Generate Company Descriptions' and click 'Save and Continue.'
On the next screen, for Model use 'gpt-3.5-turbo' (the default).
For Messages we want to add a reference to the 'Prompt' field we created earlier. To do this, click the + button.
Then on the modal that opens, select the 'Companies' table. Then select 'Prompt' for Field and 'Needs Info' for Run for every record in view.
The Messages field should now contain a reference to our 'Prompt' field.
For Max tokens, enter 50 (this will ensure the description created is long enough.)
Click 'Save & Run'.
The Data Fetcher request will run, and the Response field mapping modal will open. This is where you can specify which fields to import from the OpenAI API and how they map to fields in Airtable.
Set the 'Message' field to map to your existing 'Description' field and click 'Save & Run'.
Data Fetcher will now run the GPT-3 Airtable integration. In your output table, you'll see that short descriptions describing each company have been generated using AI and added to the 'Description' field.
You can automatically run the GPT-3 Airtable integration when a new record is created using Data Fetcher's Trigger feature.
Triggers automatically run a request whenever a change happens in the Airtable base. For example, when a new record is created in the 'Needs info' view.
Triggers are a paid Data Fetcher feature, so you'll first need to upgrade your account. Scroll to the Schedule / Trigger / Webhook URL tabs and click on the Upgrade button underneath.
Select a plan to suit you and enter your payment details.
In Data Fetcher, click "I've done this".
Next, select the Trigger tab and underneath, click '+ Authorize'.
Accept the prompt 'I understand, let's Authorize'.
Click "+ Add a base".
By selecting 'All current and future bases in all current and future workspaces', we'll avoid the need to re-authorize access for individual bases in the future.
Click on 'Grant access'.
Back in Data Fetcher, ensure the Trigger tab is selected. For this tutorial, we'll use the trigger type of 'Record created'. Also select the 'Companies' table and the 'Needs info' view.
Finally, click 'Save'. The request will now run automatically whenever a record is created in the 'Needs info' view and create a description for the company.