, , , ,

Create Your First AI Tool: Sales Comp Database ChatGPT Plugin

Traditionally in commercial real estate, each organization builds its own proprietary sales comp database and then gives its analysts access to that database in order to perform comp analysis. As AI becomes more and more important, pairing the analyst team with AI tools to speed/improve that real estate analysis is essential. Thus, at the individual level it becomes equally as important to our careers to demonstrate to the market (and/or to our respective organizations) that we each possess the skills necessary to compete in a generative AI world!

Over the past year, I’ve been honing my skills with generative AI and building AI tools with real-world applications for commercial real estate. One such tool is a Sales Comp Database ChatGPT Plugin I recently built, which essentially trains ChatGPT on any sales comp database stored in a Google Sheet. Recognizing the potential of this technology and the need for others to gain proficiency using it, I’ve decided to share this plugin. My goal is to empower you to master the skills necessary to leverage generative AI in meaningful and impactful ways.

This tutorial will guide you through the process of creating a Plugin that connects ChatGPT to your sales comp database. No coding skills are required. Upon completing the tutorial, you should have a working ChatGPT Plugin that pulls data directly into your ChatGPT conversations, thereby streamlining the comp analysis process and impressing your co-workers!

Important Note: While no coding skill or understanding of ChatGPT plugins is required to complete this tutorial, it’s important to have a technical mind in order to undertake this tutorial. That means you’re comfortable viewing code, troubleshooting technical issues on your own as they arise, and using trial-and-error to get technical tools like this working. I kindly ask that you refrain from reaching out immediately if you’re unable to get this to work. If after extensive troubleshooting, trial-and-error, asking ChatGPT for help, and reading online you’re unable to solve a given issue, feel free to reach out and we can offer additional ideas.

The Repl that you Fork as part of the tutorial to build your (first) ChatGPT Plugin

What is a ChatGPT Plugin?

Before diving into the tutorial, it’s crucial to understand what a ChatGPT plugin is and where to find additional information for building these plugins.

ChatGPT plugins are a feature currently in beta that allow developers to connect ChatGPT to third-party applications. These plugins enhance ChatGPT’s capabilities by enabling it to interact with APIs defined by developers, allowing it to perform a wide range of actions. For instance, a plugin could enable ChatGPT to retrieve real-time information like sports scores or recent rent comps, pull data from a knowledge base such as company databases or personal notes, or assist users with tasks like drafting LOIs or tracking tenant rent payments.

Developers who create plugins expose one or more API endpoints, accompanied by a standardized manifest file (ai-plugin.json) and an OpenAPI specification file (openapi.yaml). These elements define the plugin’s functionality, allowing ChatGPT to consume the files and make calls to the developer-defined APIs (e.g. a Google Sheet).

The AI model acts as an intelligent API caller. Given an API spec and a natural-language description of when to use the API, the model proactively calls the API to perform actions. For instance, if a user asks, “What multifamily properties built since 2010 have traded in Atlanta over the past year?”, the model may choose to query the Google Sheet database API, receive the API response, and generate a user-facing answer combining the API data and its natural language capabilities.

To build a plugin, developers need to understand the end-to-end flow, which involves creating a manifest file, registering the plugin in the ChatGPT UI, and having users activate the plugin. Once activated, the model can invoke an API call from the plugin when a user asks a relevant question, incorporate the API call results into its response to the user, and even format data from the API in markdown for automatic rendering in the ChatGPT UI.

The beauty of the following tutorial is that I’ve already completed all of the above steps. You will simply duplicate what I’ve already created, integrate parameters specific to you, and (hopefully) you’ll have a working ChatGPT plugin!

For more detailed information on ChatGPT plugins, refer to the OpenAI Plugin Documentation.

Tutorial for Creating Your First ChatGPT Plugin: Sales Comp Database Analyzer

As of August 2023, here are steps to take my Google Sheet Sales Comp Database Template and my Replit web application (Plugin) template and create your own ChatGPT Plugin.

  1. Register for ChatGPT Plugin Developer Access: Visit OpenAI’s Plugin Developer Access page and sign up. Note that approval may take several weeks. Also, ensure you’re a ChatGPT Plus member as only Plus members can use Plugins.
  2. Duplicate the Sales Comp Database Template: Make a copy of this Google Sheet template which includes App Script code that turns the Google Sheet into an API that ChatGPT can query.
  3. Deploy the Apps Script Code: Once you’ve made a copy of the Google Sheet, open the Google Sheet and navigate to Extensions > AppScript. Click ‘Deploy’ in the upper right, select ‘New deployment’, and follow the instructions, ensuring to deploy a ‘web app’. After deployment, copy the ‘web app URL’.
  4. Duplicate the Replit Application: Next, visit the Replit template I created and click ‘Fork’ in the upper-right corner to duplicate the application. If you don’t already have a Replit account, you’ll then be prompted to create a free Replit account. Mame your application and click ‘Fork Repl’ to create your own version.
  5. Update Secrets: After creating the application, a box should pop up asking to ‘Configure missing Secrets values’. Click ‘Manage secrets’. If the pop-up doesn’t appear, find ‘Secrets’ within the ‘Tools’ section on the left. With the Secrets window open, click to edit the ‘Google_Apps_Script_URL’ and paste the web app URL you copied in step 3.
  6. Get Your Repl URL: Click the ‘Run’ button at the top of the Replit screen. A ‘Webview’ should appear with a URL for your Repl (e.g., http://[repl name].[replit username].repl.co). Copy this URL.
  7. Update the ‘ai-plugin.json’ File: Select the ‘ai-plugin.json’ file from the ‘Files’ section on the left. Replace the two instances of [ENTER YOUR REPLIT URL HERE.co] with your Repl URL.
  8. Update the ‘openapi.yaml’ File: Select the ‘openapi.yaml’ file from the ‘Files’ section on the left. Replace the one instance of [ENTER YOUR REPLIT URL HERE.co] with your Repl URL.
  9. Install Your Plugin: Once you have ChatGPT Plugin developer privileges (OpenAI will notify you via email), and you’re a ChatGPT Plus member, go to chat.openai.com. Select ‘GPT-4’ and plugins. At the bottom of the Plugin list select ‘Plugin Store’, then click ‘Develop Your Own Plugin’ in the lower right corner. Enter your Repl URL when prompted to ‘Enter your website domain’. Follow the provided steps to install the plugin. If you’ve set up the code correctly, you should be able to complete this process without issues.
  10. Test the Plugin: With your new Sales Comp Analyzer plugin selected, enter a prompt into ChatGPT such as “pull multifamily sales comps in Atlanta”. The plugin will query your Google Sheet database and pull one or more of the placeholder comps that come with the Google Sheet template sales comp database.
  11. Replace Placeholder Comps in Google Sheets: After confirming that ChatGPT can query your Google Sheet template sales comp database, replace the placeholder comps in the Google Sheet with your own proprietary/real comps. Click the ‘Share’ button in the upper right hand corner of your Google Sheet and make sure it is only available to those you want to access to it. Note it’s important to NOT change the fields (i.e. the names, location, and quantity of columns). ONLY change the values within each column below the header row 1.

Note that the plugin you create is ONLY available on ChatGPT to you and to anyone you share your unique Repl URL with. Thus, this becomes a private ChatGPT Plugin you can use to analyze your private Google Sheet Sales Comp Database.

Bonus: Tips for Building AI Applications with No Coding Skill

Building applications without prior coding experience can seem daunting. However, with the right approach and thanks to the advent of generative AI, it’s now entirely achievable. Here are some tips to help you succeed:

  • Use ChatGPT as Your Coding Partner: ChatGPT (or other LLMs such as Bard or LLama Chat) are invaluable resources when creating applications with no coding skill. Prompt it with very specific instructions, let it know you have zero coding skill, and then regularly share the output asking for reviews and suggestions. If you find useful documentation or instructions online (like the OpenAI Plugin Documentation), share the text with ChatGPT and ask it to help you understand and apply the information.
  • Embrace Trial and Error: Creating code with no coding ability is a process of trial and error. If you encounter an issue or your code doesn’t work as expected, don’t be discouraged. Try different approaches, ask ChatGPT to tweak your code, and learn from the feedback you get. Persistence is key.
  • Understand File and Code Structure: While it’s possible to build AI applications with no coding skill, it’s nevertheless crucial to understand the structure of your files and code. Ask ChatGPT to explain what goes where and why. This foundational knowledge will help you navigate and modify your code more effectively.
  • Read as Much as You Can: The more you read and learn, the more you’ll understand. Dive into tutorials, articles, and documentation. Don’t hesitate to look up terms or concepts you’re unfamiliar with (or ask your LLM). Over time, you’ll build a solid understanding of coding principles and practices.
  • Practice Regularly: Like any new skill, regular practice is essential when learning to build applications with no coding skill. Try to practice a little bit every day, even if it’s just for a few minutes. Over time, you’ll become more comfortable with it and start to see progress.

About the Author: Born and raised in the Northwest United States, Spencer Burton has over 20 years of residential and commercial real estate experience. Over his career, he has underwritten $30+ billion of commercial real estate at some of the largest institutional real estate firms in the world. He is currently President and member of the founding team at Stablewood. Spencer holds a BS in International Affairs from Florida State University and a Masters in Real Estate Finance from Cornell University.