Use GPT-3 in Airtable to Automatically Write Company Descriptions

Jan 19, 2023Andy Cloke

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.

By using OpenAI and Data Fetcher, there's no need for code, and the GPT-3 Airtable integration can be used for free.

We can also use OpenAI and Data Fetcher to generate images using AI or create podcast descriptions with AI.

Create Company and Description Table

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:

  • Apple
  • ⁠Netflix
  • ⁠Microsoft
  • ⁠Disney

Next, create a field called 'Description' (with type 'Long text').

Generate Company Descriptions with GPT3

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 company ', Name)
airtable gpt3 prompt field.png

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.

Generate Company Descriptions with GPT3

Add Data Fetcher Extension

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.

Data Fetcher Sign Up

Generate AI Company Descriptions using GPT-3

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.

Create your first request in Data Fetcher

For Application, select 'OpenAI' to use the GPT-3 Airtable integration.

Generate Company Descriptions with GPT3

If you don't already have an account with OpenAI, you can sign up for one here and generate an OpenAI API here. (You'll need an API key from OpenAI to use GPT-3 with Airtable.)

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.

Generate Company Descriptions with GPT3

For Endpoint, choose 'Create chat message completion'.

ChatGPT-Airtable-Integration5.jpg

Give your request a name such as 'Generate Company Descriptions' and click 'Save and Continue.'

generate company descriptions save and continue.png

On the next screen, for Model use 'gpt-3.5-turbo' (the default).

ChatGPT-Airtable-Integration7.jpg

For Messages we want to add a reference to the 'Prompt' field we created earlier. To do this, click the + button.

gpt3 prompt field .png

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.

Click 'Confirm'.

Generate Company Descriptions with GPT3

The Messages field should now contain a reference to our 'Prompt' field.

message prompt reference.png

For Max tokens, enter 50 (this will ensure the description created is long enough.)

Generate Company Descriptions with GPT3

Click 'Save & Run'.

save and run gpt3.png

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'.

GPT3 screengrab

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.

Screen grab of table

Automatically Run the GPT-3 Airtable Integration

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.

upgrade.jpg

Select a plan to suit you and enter your payment details.

data fetcher upgrade pricing plans.png

In Data Fetcher, click "I've done this".

Schedule Data Fetcher

Next, select the Trigger tab and underneath, click '+ Authorize'.

Authorize.jpg

Accept the prompt 'I understand, let's Authorize'.

Authorize2.jpg

Click "+ Add a base".

Authorize3.jpg

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'.

Authorize4.jpg

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.

gpt3 companies trigger.png

Related Posts

How to Extract Data from Images in Airtable using AI

How to Extract Data from Images in Airtable using AI

Jul 25, 2024

Zayyad Muhammad Sani

OpenAI
Extract Data from PDFs to Airtable using OpenAI

Extract Data from PDFs to Airtable using OpenAI

Jul 18, 2024

Zayyad Muhammad Sani

OpenAIPDF
How to Use Airtable Generative AI

How to Use Airtable Generative AI

Jul 5, 2024

Andy Cloke

OpenAI