How to Build A Content Editor with Gravity Forms OpenAI
By Gravity Wiz Published February 28, 2024Written by the Editorial team at Gravity Wiz…
Note: this article continues our series on exploring real things you can build with our free Gravity Forms OpenAI plugin!
Get up to speed on the other ways you can use AI right now:
- 5 ways you can use Gravity Forms OpenAI right now
- Sentiment analysis using Gravity Forms OpenAI
- How to use Gravity Forms OpenAI for content moderation
- Working with AI-generated content in Gravity Forms
If you, your team, or your website users are creating content, Gravity Forms and OpenAI can help you save time and improve quality.
What’s the benefit of using Gravity Forms? You’re about to make your own custom GPT. Fine-tuned to your business. Scalable with your users, or your customers. All the while, making it extremely easy to use by refining input to Gravity Forms fields to create prompts. It’s also going to provide premium GPT features at no cost to the user.
If you have people in your organization who aren’t super AI-friendly (or, as is often the case — website users and customers), these tools provide an excellent means of getting all the benefits of AI without having to spend time prompting models to get powerful output.
A good example is content writing. It’s easy to create a simple app and add articles or passages of text and get real time revisions, suggestions, and improvements. Tailored to you. With one click!
Let’s explore building one. Today, you’ll learn how to build a simple Gravity Forms based content optimizer that can improve any amount of writing, provide suggestions, and more — without writing code.
Worth noting: this is a simple implementation of the concept. The idea being, once you have the structure built, you can build something even more sophisticated and fine-tuned for your needs.
Let’s get started!
Building a content optimization tool using Gravity Forms OpenAI
Step 1: build a simple form.
- Add a Paragraph Text field where you will insert content. We’ve used the name “Insert Content” in this example.
- Add a Drop Down field to select what you’d like revisions on. A few ideas:
- Reduce Wordiness.
- Improve Clarity and readability.
- Improve Grammar.
- Provide suggestions.
- Create a second Paragraph Text field where the AI-generated output will appear. We’ve named ours “AI-Revised Content.”
Step 2: Set Up an OpenAI Feed
Ensure you have the newest version of the OpenAI plugin installed and activated, then create a new OpenAI feed from your form.
- Set the endpoint to Chat Completions.
- Set the OpenAI model. For this use case we’ve used the gpt-3.5-turbo model, but feel free to experiment with others. If you need more info, read about different OpenAI models with Gravity Forms.
- In the Message field, add a prompt. Consider what’s below a starting point — fine-tuning your prompt in accordance with your own brand and voice will yield better results.
Rewrite the following text, removing wordiness and any words that aren’t necessary while keeping the main structure and points of the content intact: {Insert Content:1}
In this case, {Insert Content:1} is the merge tag representing the field where we add our article content in step 1.3.
- To get AI-generated results to appear back in our form, we’re going to use Live Merge Tags. This Populate-Anything-powered feature allows you to pull dynamic, user-submitted information into Gravity Forms fields, labels, notifications — pretty much anywhere.
- Scroll down and ensure Enable Merge Tag is checked. More on this below.
- Under Map Results to Field, select the field you created in step 1.3. This will map your AI-generated output live within your form.
- Under the Conditional Logic section, ensure that this OpenAI feed is processed only when the user has chosen Reduce Wordiness in the Drop Down created in step 1.2.
Here’s what these final steps look like:
Step 3: Adding AI-generated Results to Your Forms
- The last step is to add the merge tags to your output field. This is the field you created in step 1.3.
- Select your AI-output field in the form editor.
- Go to Field Settings > Advanced and find Default Value.
- Add the Live Merge Tag generated in step 2.1 to the Default Value field. Be sure to pay attention to the instructions on replacing the field ID.
With this set up, your OpenAI feed will only process the prompt when you’ve chosen the Reduce Wordiness Drop Down field.
Step 4: Add Additional AI Feeds to Your Form
To create additional prompts for each Editor Mode option chosen in the Drop Down field you created in step 1.2 (i.e. Grammar, Provide Suggestions, etc.), repeat the steps above for each Drop Down option (and editing style you want assistance on) that you’ve created.
When creating feeds for additional options in your Drop Downs, a few notes. You’ll want to create separate prompts for each based on what you’re looking to improve.
Here are some example prompts for the Drop Down options we created. For grammar, you could use the following prompt:
Revise the following text to make it grammatically accurate with regards to American English grammar. Keep the main ideas within the text consistent and without changing the original message: {Insert Content:1}
If you’re looking to get suggestions on your article (in contrast with a rewrite), you would map the Provide Suggestions Drop Down option from step 1.2.
Read the following text. Provide suggestions in bullet form on how it can be improved with regards to readability, wordiness, and clarity. Each suggestion should not be longer than two sentences. Do not rewrite any of the text: {Insert Content:1}
Notes on Merge Tags
To use the same AI-results output field (created in step 1.3) for multiple OpenAI feeds, repeat step 2.4 and simply place all Live Merge Tags from each feed within it.
You’re Ready to Rock!
Your simple Gravity Forms powered app is now ready to optimize your content.
Want to send the results elsewhere? It’s easy to send your revised content to Gravity Forms notifications (emails), other forms, Post Excerpts, and more. Learn more about working with AI-generated content in Gravity Forms.
What makes this powerful is your ability to fine tune your prompts in-depth. Consider the above starter prompts. You can provide far more detail to get better results — add notes about your brand’s voice, exclusions, and editing style. The higher the quality the prompt, the better the results.
Lastly, if you haven’t yet, you can download Gravity Forms OpenAI for free. We have big things planned for this little plugin!