From the course: Getting Started with the Google Gemini API

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Generating content

Generating content

- [Instructor] Now that we have mastered how to send requests to the API using well-crafted prompts, let's take a look at the process of generating a response and the types of responses. Depending on the model you're using, the Gemini API allows you to use both text and images in your prompts. As we learned earlier, the Gemini Pro model can take in only text as input, while the Gemini Pro-vision model is multimodal, meaning that it can take both text and images as input. To generate content, Gemini models use the generateContent method of the model's resource. Here we can see a Python code snippet of the Gemini Pro model generating content with a text input. And here is another code snippet of the gemini pro-vision model generating content by taking both text and an image as input. While both models currently only return text as response, you can also build what is known as a multi-turn conversation with the response. A multi-turn conversation is a chat conversational format, meaning…

Contents