Optimizing your prompts helps you get more effective assistance from
Gemini in interactive chat panels---such as the Google Cloud console
chat panel---and in inline code generation in your IDE and query editors. If
you're designing prompts for agentic workflows, system instructions, or tool
calling, see
[Agentic AI prompt engineering](https://docs.cloud.google.com/gemini/docs/discover/engineer-agentic-prompts.md.txt).
For more information about available features, see the
[Google Cloud with Gemini overview](https://docs.cloud.google.com/gemini/docs/overview.md.txt).

## Provide context and details in your prompts

The questions and instructions that you give to Gemini in
Google Cloud, including any input information or code you want
Gemini to analyze or complete, are called *prompts* . The answers
or code completions that you receive from Gemini are called
*responses*.

When you ask Gemini in Google Cloud for help, you should
include as much context and specific detail as possible. Gemini models
support large context windows, allowing you to include extensive codebase
context, error logs, and detailed requirements in your prompts. Because
AI-generated responses are based on a vast range of possibilities, providing
clear context helps ensure precise responses.

Here are some ways to provide helpful context and detail in your prompts:

- **Write your prompt like you're talking with a person.** Don't enter only
  keywords as you might when searching for a document online, but include the
  kind of detail you'd include when explaining a problem to someone. For
  example, instead of entering the terms "workload GKE," ask a complete
  question: "What kinds of workloads does GKE support?"

- **Describe why you're trying to accomplish a task.**
  Details about what you're trying to accomplish can help Gemini
  provide a more useful answer. For example, telling
  Gemini in Google Cloud that you want to "set up a
  simple, secure Google Cloud site for hosting a blog" has more helpful
  details than only asking "how to deploy a website." Because there are often
  multiple correct ways to accomplish a technical goal, providing
  Gemini sufficient context can help ensure a good response.

- **Ask to include all the parameters in a command.**
  For example, when you ask Gemini Code Assist to generate code
  functions, you are likely to produce a more useful and detailed response by
  telling it to "make sure all methods use their required arguments."

- **Include your level of expertise.** It's especially helpful to match your
  prompt request with your expertise level when you ask for a suggestion. Asking
  Gemini in Google Cloud to explain a concept or code as
  if you're an expert programmer--or a novice programmer--can give you different,
  and more appropriate, results.

  For example, to direct Gemini to respond from an expert
  context, you could prompt it with "create Python code to list all
  Compute Engine instances. You are an expert software developer using
  Google Cloud." Similarly, you could ask Gemini
  to "explain Kubernetes and its benefits to me in the simplest terms possible."
- **Include details about products and technologies.** If you're looking for
  answers about a specific product, technology, or technical capability, include
  that in your prompt. Similarly, specifying a programming language can help you get
  more relevant responses. If you're unsure about what technologies or products
  to consider, ask Gemini to compare different options for you.

- **Break complex problems into multiple requests.** Writing separate prompts
  can help Gemini refine and focus the answers that it gives,
  helping you move progressively toward a solution.

## What types of assistance can Gemini give you?

While there are many ways to use the language and code capabilities of
Gemini in Google Cloud, the following sections describe
some key areas where Gemini assistance can be most useful.

Remember that Gemini can produce unexpected, incomplete, or
erroneous results when you ask for assistance. For more information, see
[Google Cloud with Gemini and responsible AI](https://docs.cloud.google.com/gemini/docs/discover/responsible-ai.md.txt).

### Information and reference prompts

You can ask Gemini in Google Cloud for information about
Google Cloud products and services, general technologies, definitions, and
how those concepts and technologies relate to one another. For example, you can
ask the following:

- "What does "serverless architecture" mean in Google Cloud?"
- "What Google Cloud products provide managed Kubernetes cluster support?"
- "What are the key technical features of BigQuery?"
- "When should I use Compute Engine instead of App Engine?"
- "What kinds of model testing does Vertex AI support?"

### Analytical and operational prompts

You can ask Gemini in Google Cloud to summarize and
simplify code functions, and give operational suggestions---for example:

- "Simplify the code I've selected" (for example, after selecting Python code in an [IDE](https://docs.cloud.google.com/gemini/docs/codeassist/overview.md.txt#ide)).
- "Summarize what this function does" (for example, after selecting a C code function in an IDE).
- "How do I optimize IAM permissions?"

### Task prompts

You can ask Gemini in Google Cloud to help you accomplish
a specific task or set of tasks. For complex tasks, try breaking your prompts
into separate steps. For example, you can get procedures and task information
with questions like the following:

- "How do I set up a Google Cloud account?"
- "How do I make a bucket public?"
- "How can I pull messages from a Pub/Sub subscription?"
- "How do I use Vertex AI to deploy a model?"

### Generative prompts

Gemini can generate and complete code
structures as you enter a request from an
[IDE](https://docs.cloud.google.com/gemini/docs/codeassist/overview.md.txt#ide) or from the Google Cloud console.
Gemini can also help you generate process
documentation for code design and development.

For example, you can ask Gemini to help you do the following:

- "Create a function with specific variables in C."
- "Create a high-level plan for designing and building and deploying a web app in Google Cloud."
- "Create a bare metal kubernetes cluster YAML file with default IP addresses."
- "Create javascript code for a drop-down menu."
- "Create a brief, easy-to-understand user story about a data scientist named Kim designing a Vertex AI model."
- "Create a gcloud command to give the developer Google group access to view my Google Cloud project."

### Application-related prompts

If you
[set up Gemini Cloud Assist for a folder](https://docs.cloud.google.com/cloud-assist/set-up-gemini.md.txt)
and are using the **Cloud Assist** panel at the folder level in the
Google Cloud console, then assistance and responses are limited to
applications related to the folder for products that support applications. The
following list includes Google Cloud products supported at the folder level:

- [Application Design Center](https://docs.cloud.google.com/application-design-center/docs/overview.md.txt)
- [App Hub](https://docs.cloud.google.com/app-hub/docs/overview.md.txt)
- [Cloud Asset Inventory](https://docs.cloud.google.com/asset-inventory/docs/asset-inventory-overview.md.txt)
- [Cloud Hub](https://docs.cloud.google.com/hub/docs/overview.md.txt)
- [Cloud Monitoring](https://docs.cloud.google.com/monitoring/docs/monitoring-overview.md.txt)
- [Logs Explorer](https://docs.cloud.google.com/logging/docs/view/logs-explorer-interface.md.txt)

Only prompts related to applications are supported in these Google Cloud
products if you are scoped to a folder in the Google Cloud console. If you
submit a question that doesn't relate to applications within this scope, then
Gemini Cloud Assist provides a generic response stating that folders
are intended for application-related prompts. The following list shows example
application-related prompts:

- "How many applications are in production?"
- "Help troubleshoot application example-application."

To get specific assistance on other products and resources, use project picker
at the top of the Google Cloud console page to select a project resource.

Additionally, you must enable
[application management](https://docs.cloud.google.com/app-hub/docs/overview.md.txt#application-management) on the
folder to use the **Cloud Assist** panel at the folder level.

## Provide feedback

When you provide us with positive or negative feedback about your conversational
experience with Gemini in Google Cloud, you're helping us
improve the underlying services that we use to provide you with responses. With
feedback, [and your explicit permission](https://docs.cloud.google.com/gemini/docs/discover/data-governance.md.txt),
we can improve Gemini in Google Cloud to make better
suggestions with fewer mistakes, as well as ensure that good responses are
reinforced. For more information, see
[Provide Gemini Code Assist feedback](https://docs.cloud.google.com/gemini/docs/support/feedback.md.txt).

## What's next

- For guidance on prompt engineering for agentic workflows, system instructions, and tool calling, see [Agentic AI prompt engineering](https://docs.cloud.google.com/gemini/docs/discover/engineer-agentic-prompts.md.txt).
- For more about large language model (LLM) prompt design, see [Introduction to prompt design](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/prompts/introduction-prompt-design.md.txt).
- To learn more about generative AI, see [Generative AI learning path](https://www.cloudskillsboost.google/journeys/118).
- For more on Gemini and LLM models, see [Google Cloud with Gemini and responsible AI](https://docs.cloud.google.com/gemini/docs/discover/responsible-ai.md.txt).
- For more on how we only use your feedback data with your permission, see [How Gemini products in Google Cloud use your data](https://docs.cloud.google.com/gemini/docs/discover/data-governance.md.txt).