Search⌘ K
AI Features

Creating a Gemini-Powered Application

Explore how to create a Gemini-powered application by leveraging generative AI capabilities for text and image understanding. Learn to set up Gemini with Python, use its API for evaluating drawings, and build a fun AI-driven Pictionary game that guesses depicted words, even if you have no prior coding experience.

We'll cover the following...

AI has revolutionized programming, especially for tasks requiring human-like thinking. AI has enabled us to create applications that were previously very difficult to program. A prime example is the emergence of generative AI. Generative AI can produce realistic images, write different kinds of creative content, and even translate languages. Imagine trying to write an algorithm to capture the flow and rhythm of a poem or the subtle variations in a landscape painting—generative AI can do this and more. Furthermore, it is constantly learning and improving its abilities. We’ll showcase an interesting generative AI-powered application at the end of this lesson!

AI pictionary

Pictionary is a fun and classic charadesCharades is a party game that involves acting out words or phrases for others to guess.-inspired word-guessing game. It is typically played with teams, with each team having multiple players. During each round, a nominated person from the team is given a chosen word that they must draw on a board, with the objective being to have the team guess the chosen word in the shortest amount of time. That would be a typical game of pictionary. Now, let’s put our own twist on it.

In our AI pictionary, we will be given a random word, and our goal will be to draw it in a way such that the AI (Gemini) is able to guess it. The objective is to get Gemini to guess correctly in the shortest possible time.

The rundown

We will tackle this step by step. Let’s list down a few fundamentals for our application.

  • We need a list of words that are easy to draw and guess.

  • We would need to set up Gemini to be able to evaluate if the image drawn by the participant closely matches the word.

  • We would use Gemini to generate the code that will help us piece together our logic to create a functioning application.

For now, let’s focus on these three sections. We can then brainstorm more ideas to build up the application.

Sneak peek

By the end of this chapter, we will have used Gemini and Python to create a fun application similar to the one shown below. As mentioned earlier, you do not need to know how to create Python applications; Gemini will assist us along the way.

For this application to work, you will need to add your Gemini API key. If you have added it earlier in the course, you can copy it from the widget below.

C++
{{API_KEY}}
Please login to launch live app!