Blog -

How to Build A Content Editor with Gravity Forms OpenAI

Gravity Wiz By Gravity Wiz Published February 28, 2024

GF_OpenAI_Blog_Series (1)

Written 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:

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.

Content-Optimization-gravity-forms-openai

Let’s get started!

Gravity Wiz is a third-party certified developer and its add-ons are not supported by Gravity Forms. As always, we recommend you extensively evaluate all plugins to ensure their suitability for your purpose before installation on your website.

Building a content optimization tool using Gravity Forms OpenAI

Step 1: build a simple form.

  1. Add a Paragraph Text field where you will insert content. We’ve used the name “Insert Content” in this example.
  2. Add a Drop Down field to select what you’d like revisions on. A few ideas:
    1. Reduce Wordiness.
    2. Improve Clarity and readability.
    3. Improve Grammar.
    4. Provide suggestions.
  3. Create a second Paragraph Text field where the AI-generated output will appear. We’ve named ours “AI-Revised Content.”

Form Build-Gravity-Forms-OpenAI

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.

  1. Set the endpoint to Chat Completions.
  2. 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.
  3. 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.

GF-OpenAI-Settings

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.

  1. 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.
    1. Scroll down and ensure Enable Merge Tag is checked. More on this below.
  2. 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.
  3. 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:

Reduce-Wordiness Conditional-Logic--gravity-forms-openai

Step 3: Adding AI-generated Results to Your Forms

  1. The last step is to add the merge tags to your output field. This is the field you created in step 1.3.
    1. Select your AI-output field in the form editor.
    2. Go to Field Settings > Advanced and find Default Value.
    3. 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.

adding-merge-tag-to-default-value-GW

With this set up, your OpenAI feed will only process the prompt when you’ve chosen the Reduce Wordiness Drop Down field.

Reduce-Wordiness-gravity-forms-openai

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}

Provide-Suggestions-gravity-forms-openai

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.

Same-output-multiple-feeds-GW

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!

Download Gravity Forms OpenAI