AI powered product reviews

MARCH 18, 2023  ·  536 WORDS

This post was generated with the help of ChatGPT 4.

I've always appreciated the effort that people put into leaving detailed and helpful product reviews. As a consumer, it's an essential aspect of online shopping that helps many of us make informed decisions. In fact, I often find myself more likely to buy a product with a higher number of reviews, even if the overall rating is slightly lower. So, I thought it'd be cool to create a Chrome extension that would make the review generation process easier, leveraging the power of artificial intelligence to assist users in writing nuanced reviews with ease.

The idea for this Chrome extension, which I named 'Aviser,' was to generate product reviews by gathering user input through a series of simple questions and then utilizing OpenAI's ChatGPT API to craft a well-structured review. Interestingly, ChatGPT-3 itself came up with the name 'Aviser,' which means 'reviews' in French.

Throughout the entire development process, there was a back-and-forth between me and ChatGPT, refining the idea, discussing technical aspects, and solving problems together. This dynamic interaction made the development process feel more approachable and enjoyable. In a way, using ChatGPT felt like pair programming with someone who has every answer on Stack Overflow at the top of their head. I had to drive the process and know what to ask, but several challenges were shortened with the help of AI.

For instance, when we first discussed how the extension should work, I suggested that it should recognize websites with review text boxes, display a popup anchored to the text box, and collect user input through a few multiple-choice questions. Additionally, we decided to include an optional free-form input text box for users to share specific details they wanted to include in the review.

One of the challenges we faced was the initial implementation of the popup. It wasn't quite meeting our expectations, as it appeared at the bottom of the page rather than as a tooltip next to the textbox. Our initial code looked like this:

// In content.js
// Create a div to hold the popup
const popupContainer = document.createElement("div");
popupContainer.innerHTML = popupHTML;
document.body.appendChild(popupContainer);

However, after discussing the issue together, we revised our approach, and ChatGPT suggested the following changes:

// Create a div to hold the popup
const popupContainer = document.createElement("div");
popupContainer.innerHTML = popupHTML;
document.body.appendChild(popupContainer);
// Position the popup next to the textarea
const textarea = document.querySelector("your-textarea-selector");
const textareaRect = textarea.getBoundingClientRect();
popupContainer.style.position = "fixed";
popupContainer.style.top = `${textareaRect.top}px`;
popupContainer.style.left = `${textareaRect.right + 10}px`;

This update ensured that the popup appeared as a tooltip next to the textbox when it was in focus, as we initially intended.

Throughout our conversation, we managed to build a functional and effective Chrome extension. While 'Aviser' might not be groundbreaking, it demonstrates how a friendly collaboration with AI can help us create practical solutions for everyday problems. The entire development process took only a couple of hours, and this efficiency is a testament to the power of AI-assisted development.

In conclusion, my experience in building 'Aviser' with ChatGPT showcases the potential of AI to streamline processes, enhance creativity, and drive innovation. As we continue to explore the possibilities of AI, it's essential to recognize its potential as a tool to empower us in achieving new heights in innovation and efficiency, all while making the process more approachable and enjoyable.