Try Gemini in the Google Cloud console
Learn how to ask for AI-powered assistance by chatting with Gemini in the Google Cloud console.
Before you begin
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
In the Google Cloud console, ensure that the Gemini for Google Cloud API is enabled for your Google Cloud project.
Go to the Identity and Access Management (IAM) Roles page and check whether you have the Gemini for Google Cloud User role.
This IAM role contains the
cloudaicompanion.companions.generateChat
permission, which is required to chat with Gemini.
If you don't have the permissions to complete the preceding steps, contact your administrator.
Open Gemini
In the Google Cloud console, go to any page—for example, the Dashboard page.
In the console toolbar, click spark Open Gemini.
The Gemini pane opens and displays a few example prompts that you can click. The prompts vary depending on your current Google Cloud console page. You can also enter a prompt in the Enter a prompt here field.
Chat with Gemini
In the following steps, you learn how to enter a prompt along with a follow-up question:
In the Enter a prompt here field, enter the following prompt, and then click send Send prompt:
Create a gcloud command to give the developer Google group access to view my Google Cloud project.
Gemini displays its response after the prompt.
In the Enter a prompt here field, enter the following follow-up prompt, and then click send Send prompt:
Change that to editor access.
Gemini uses your conversational history for additional context when it responds to your prompts. For example, Gemini responds with an updated explanation and command.
Optional: If the Show related content link is visible, click the link to access more information.
The link is only displayed when more information is available.
Optional: To expand the Gemini pane to the full width of your browser window, in the Gemini pane, click open_in_new Open in full page.
The Gemini pane opens a new session in a new tab. Your current session remains open on its original tab.
More examples to try
In the following examples, you learn how to get information about various Google Cloud products by chatting with Gemini in the Gemini pane:
To learn about the differences between similar products, enter a prompt that is similar to the following:
Should I use GKE or Cloud Run for my application?
To learn how to get started with a new Google Cloud project, enter a prompt that is similar to the following:
I'm interested in developing a computer vision application. I have a lot of unlabelled training data sitting in my Google drive and I'm not sure how to get started. What are the first steps I should take to develop an image recognition service with this data?
This prompt returns step-by-step information about how to create a Google Cloud project.
To learn about a log entry in Logs Explorer, you can click a button on a log entry that opens Gemini chat with a bulleted summary of the events in the log. For more information, see Summarize log entries with Gemini assistance.
For information, see Write better prompts for Gemini for Google Cloud.
Reset chat history
Gemini resets the chat history automatically when you change projects or sign out of the Google Cloud console.
If your chat history is no longer relevant to what you're trying to do, then you can reset the chat history:
- In the Gemini pane, click delete Clear chat, and then click Reset chat.
Because your chat history is available only in the browser that you use to access Google Cloud and is not stored elsewhere, you can also remove your chat history by doing one of the following:
Close your browser or the tab in your browser that you're using to access Google Cloud.
Refresh the tab that you're using to access Google Cloud.
If you click minimize Minimize chat on the Gemini pane, your chat history isn't removed. To re-open a chat session that you minimized, click spark Open Gemini.
Save chat history
- To save your chat history, copy your conversation into a document, and then save the document.
Use Gemini chat outside the console
To use Gemini in an integrated development environment (IDE) instead of the Google Cloud console, you must first install the Cloud Code plugin in your IDE.
- To chat with Gemini in your IDE, click spark Gemini.
Chatting with Gemini in an IDE works the same way as chatting in the Google Cloud console.
Clean up
To avoid incurring charges to your Google Cloud account for the resources used on this page, follow these steps.
- In the Google Cloud console, go to the Manage resources page.
- In the project list, select the project that you want to delete, and then click Delete.
- In the dialog, type the project ID, and then click Shut down to delete the project.
What's next
For more example prompts and suggestions on creating your own prompts, see Write better prompts for Gemini for Google Cloud.
To discover other ways to get assistance in Gemini, see Gemini for Google Cloud overview.