Try Gemini in the Google Cloud console

Learn how to ask for AI-powered assistance by chatting with Gemini in the Google Cloud console.

Gemini doesn't use your prompts or its responses as data to train its models. For more information, see How Gemini for Google Cloud uses your data.

Before you begin

  1. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  2. In the Google Cloud console, ensure that the Cloud AI Companion API is enabled for your Google Cloud project.

    Enable the API

  3. Go to the Identity and Access Management (IAM) Roles page and check whether you have the Cloud AI Companion User role.

    Go to Roles

    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

  1. In the Google Cloud console, go to any page—for example, the Dashboard page.

    Go to Dashboard

  2. 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:

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  1. In the Google Cloud console, go to the Manage resources page.

    Go to Manage resources

  2. In the project list, select the project that you want to delete, and then click Delete.
  3. In the dialog, type the project ID, and then click Shut down to delete the project.

What's next