Multimodal Prompting with Google Gemini

With our API key set up and working, we can send prompts to Gemini. Let’s rewind back to the cookie recipe example we used earlier in the What Are Generative AI Models? lesson. We mentioned that the model’s response will depend on the question we ask it. These questions are referred to as prompts. Prompts guide the model’s output and influence the type of response we can expect. For instance, a prompt asking for “a simple cookie recipe” will yield a basic set of instructions, whereas asking the model to “use the text from the recipe note, the audio description of the flavor, and the image of the cookie to give a chocolate chip cookie recipe that best fits the profile” will result in a more elaborate and specific response.

Sending a text prompt

Let’s try to generate some content. We’ll use Python and Google’s google-generativeai library to access Gemini.

Get hands-on with 1200+ tech skills courses.