Thursday, June 6, 2024

GenerativeAI as a thought partner


Couple of years back, during the Covid lockdown, I had worked on creating many short stories about Indian heroes with the purpose of spreading awareness about them. This was before the arrival of GenerativeAI age.

During a break recently, a thought came across on how can one use GenerativeAI to create something simple yet interesting using this already available data.

Thus begun the project of 'Indian Heroes Quiz', with ChatGPT as a new assistant!

Initial Data:
  • Stories about Indian heroes in simple language

Project:
  • Create a simple online quiz game to create awareness about these heroes.

Part 1 - The Quiz
It all started by creating a rough design on paper about the possible UI of the quiz. Purpose was to keep the UI and Tech Stack simple. 

The prompt was created with specific details and given to ChatGPT, which created fairly accurate version of the code. It's been many years since I have worked on Javascript, but it didn't take much time to understand and enhance the generated code.

The design did went through multiple iterations - 
  • flip cards for answer
  • randomization of cards and options
  • logo and image generation and placements
  • scoring calculations
  • dataset changes
  • making UI mobile/tablet compatible

There is an advantage of having a continued session in ChatGPT. It remembers the context and incremental additions/changes become easier.

Once the generated site was tested locally, like an able partner, ChatGPT provided options for hosting with complete set of instructions. The hosting on Netlify was easier than anticipated and the quiz was live!

Part 2 - The Questions

While the quiz was getting ready, it was important to get the content ready for the same. After all, this was the main part.

Summary was already available for each person. The task was to create hints, options and abstract from this summary. Manually it would have taken a long time and required repetitive effort.

Again, ChatGPT stepped up like an obedient intern. Once the prompt was finalized after few experiments, it generated required information for each individual. It also provided output in formatted JSON as was needed for the quiz.

The Final Result


Enjoy the quiz here and do share your feedback - https://indianheroesquiz.netlify.app/

Learnings

Understanding Prompt engineering is very important while working on GenerativeAI tools. It is imperative to find effective prompt for the specific requirement that contains -
  • Primary content
  • Specific instructions to set the context and what needs to be done
  • Cues (mainly for structured output)
  • Examples

ChatGPT works well when bulk data is provided in a text/word file. But there seems to be a size-limitation in the output as it generates output for only a few input mentioned the doc. Thus one may need to repeat this exercise if there are many input entries to be processed.

Was it possible to execute this project in pre-GenAI era?

Yes, of course. Someone with reasonable web/app building experience, could have done it easily, with the help of search as well.

The what new GenAI brings?

It allowed the developer to focus on the overall design by becoming a partner that helped in
  • Logic to code generation (without requiring to master the new language)
  • Incremental enhancements and optimizations
  • Come up with professional looking UI
  • Image/logo generation (Microsoft Designer)
  • Helping with deployment
Basically changing the focus from implementation to ideation.

At the end technology is as good as how we use it.











Unleashing the Power of AI Tools: From Learning Languages to Optimizing Code

In the last 18 months, my journey with AI tools like ChatGPT, Bing/GitHub Copilot, Microsoft Designer, and others has transformed from casua...