This tool allows you to send prompts to the same engine that powers ChatGPT, by mixing static and dynamic values from your Airtable records.
Before you Begin
This tool is primarily intended to let you automate messages between OpenAI and Airtable, this is different than bulk processing.
Create your OpenAPI Key
To connect to the openai API you will need a key. A free trial account will give you some credit to use with the api, and a fairly slow rate limit. You can check your usage with the links below, add more credit and increase your rate limit too.
From our experience, short requests cost about $0.01 per record / call so the free credit can be used a lot before upgrading.
Setup your Connector
The user interface…
1 - Choose whether you want text or image url returned based on your prompt
2 - Your message for artificial intelligence
3 - Choose which record to use in your prompt.
4 - Redirects to AI's answer.
7 - Redirects to api endpoint AI's answer.
Api key
Make sure you have your api key specified. If no click ‘here’ and specify it there.
When you specified an open ai api key you can go back to editor page and choose mode
Modes:
Text - returns text as a response Image(not available now) - returns image as a response
Prompt
You can write your question here.
When you finished, click:
Preview(1) which redirects AI's answer.
Api endpoint(2) which redirects to enpoint with AI's answer.
Connect your Automations
Now from Airtable, Zapier or Make (or other systems) you can send a request to your endpoint with a script - and include the record id that you want to use in the prompt. The response will come back, and you can use it in any workflow you want.
Airtable
Create new automation.
Add two actions:
Run a script
Copy the script here into your automation…
let inputConfig = input.config();
let apiUrl = '[paste your sharing link here]' + inputConfig.recordid;
let apiResponse = await fetch(apiUrl);
let data = await apiResponse.text();
if (apiResponse.status == 200) output.set('openai', data)
else throw Error("No valid response. Aborting so no openai response is sent.")
Copy the Sharing Link for your project
Make sure you replace the ‘sharing link’ in the script with the one you copied in the previous step…
We also need to add an Input variable for the record id.
Give it the name recordid and for the value, click the [+] and then choose Airtable record ID
When you have done the steps above, click Test and you should see a successful result like this …
Update Record
Firstly enter a description for this action.
Select a table where is the field that you want to update.
In ‘Record ID’ section select ‘Airtable record ID’.
Finally select a field that you want to update and then ‘openai’ from ‘Run a script’
Now you can update fields with your automation
Setting up Open Ai tool to Respond by Webhook
There are times when Open Ai’s API response time can exceed Airtable’s max automation run time (30 seconds). As such, this incident causes automation to result to a timeout error. To remedy this, we introduce a new feature called Respond by Webhook where the text is generated on the background and is sent to an Airtable webhook therefore preventing the errors in the automation.
There are few limitations for this feature:
Limited only to text mode You will need two automations for this to work. Our system will only wait for the Open Ai API response for up to 1 minute. After that, the system will timeout.
To set this up, follow these steps:
Setting up the Prompt Automation
This automation will send the prompt to Open AI via Aeropage Tools Open AI Proxy. This is the first of 2 automations that you will setup for this feature.
In the automation dashboard, add a trigger and a “Run a Script” action. The trigger condition will be up to you.
In the Aeropage Tools editor, click the “Use in Airtable” button located at the lower right corner of the editor.
Once the popup appears, click the “Copy to Clipboard” button
Going back to the Automation dashboard, paste the code inside the “Run a Script” action editor.
Don’t forget to set the input name as recordid.
And you’re done setting it up! Now we move to the next automation.
Setting up the Webhook Automation
This automation will receive the data from our Aeropage Tools Open Ai API proxy and update a record.
Create new automation and set the trigger as “When webhook received” and add an “Update record” action.
Inside the “When webhook received” trigger, you will see a URL in the Configuration section. Copy this URL since it will be needed in the Aeropage Tools Open Ai Connector editor.
In the Aeropage Tools Open Ai Connector editor, enable Respond by Webhook and paste the URL that you copied from the “When webhook received” trigger in Airtable. Once copied, save the changes in the editor.
Moving on to the “Update a Record” action, you will set the table and the record data like as shown below. The Record ID and the field data will come from the webhook data.
The structure of the data received by the webhook looks like the screenshot below. The body contains the recordID and the data in text format.
Turn on both of the Automation that you set up and you’re done! The response from our system may take sometime to be received by the webhook since it depends on the response time of Open Ai’s API.
Once working, you will see the field getting populated with the Open Ai’s generated text. In the screenshot below, the generated text is saved in “Response” field.
✅ Respond By Webhook (new)
Due to the slow response of Open Ai API which can exceed 30 seconds, we added a feature that lets you generate text results via webhooks.
There a few limitations for this feature:
Limited only to text mode You will need two automations for this to work. Our system will only wait for the Open Ai API response for up to 1 minute. After that, the system will timeout To set this up, head over to the “Setting up Open Ai tool to Respond by Webhook” section.
✅ Bulk Processing (new)
We have now added a bulk export tool, which can continuously run to generate content from prompts in your Airtable data, and add the generated responses (text or images) to a specified field.
There are a few small limitations as you can see in the video.
due to rate limiting on openai, the free tier will be very slow (approx 10 seconds per request) if an image fails to generate, just remove it and run the tool again, it will only process the records without values.
Do not use external automations for bulk processing in large quantities or you may exceed the openai rate limits.
✅ Automations
Triggered one at a time to automatically send a prompt to the AI and recieve a response. Each request has some time inbetween, and so does not exceed the rate limit of the OpenAI system.