說明你嘗試完成這項工作的理由。詳細說明您要完成的目標,有助於 Gemini Google Cloud 提供更實用的答案。舉例來說,如果您想向 Gemini for Google Cloud 說明「想設定一個簡單安全的網站來代管網誌」,比起只問「如何部署網站」,這麼做會提供更多實用的詳細資料。 Google Cloud 由於達成技術目標通常有許多正確方法,因此提供 Gemini for Google Cloud 充足的背景資訊,有助於確保良好的回應。
當您針對使用 Gemini for Google Cloud的對話體驗提供正面或負面意見回饋時,您便有助於我們改善提供回覆時所用的基礎服務。我們會根據您的意見回饋和明確的許可,改善 Gemini 的功能, Google Cloud 讓系統提供更準確的建議,減少錯誤,並確保系統能強化良好回覆。詳情請參閱「提供 Gemini 意見回饋」 Google Cloud 。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003eGemini for Google Cloud assists users in being more productive with Google Cloud products and services by providing responses to user prompts.\u003c/p\u003e\n"],["\u003cp\u003eTo get the best responses from Gemini, users should provide detailed context and specifics in their prompts, ideally keeping them under 4,000 characters, using a conversational tone, and breaking down complex tasks.\u003c/p\u003e\n"],["\u003cp\u003eGemini can provide various types of assistance, including information about Google Cloud products, analytical and operational suggestions, task guidance, and code generation.\u003c/p\u003e\n"],["\u003cp\u003eUsers can enhance Gemini's accuracy and helpfulness by giving positive or negative feedback on the responses they receive, to help improve future interactions and suggestions.\u003c/p\u003e\n"],["\u003cp\u003eGemini for Google Cloud can help users at any skill level by having the prompt request match the users expertise, and giving detailed instructions on the technologies and programming languages that they are using.\u003c/p\u003e\n"]]],[],null,["# Write better prompts for Gemini for Google Cloud\n\nThis document describes how to optimize the prompts that you send to\nGemini for Google Cloud and the type of assistance it provides so that you can be more\nproductive using Google Cloud products and services.\n\nYou can prompt Gemini for Google Cloud in different ways depending on which\nGoogle Cloud product you're using. For some products, you prompt\nGemini for Google Cloud in a conversational interface,\nwhile in others you prompt in code or query editors. For instructions on how to\nenter prompts, see the [documentation for your product](/gemini/docs/overview).\n\nFor more information about Gemini for Google Cloud, an\nAI-powered collaborator in Google Cloud, see\n[Gemini for Google Cloud overview](/gemini/docs/overview).\n\nProvide context and details in your prompts\n-------------------------------------------\n\nThe questions that you ask Gemini for Google Cloud,\nincluding any input information or code you want Gemini to\nanalyze or complete, are called *prompts* . The answers or code completions that\nyou receive from Gemini are called *responses*.\n\nWhen you ask Gemini for Google Cloud for help, you should\ninclude as much context and specific detail as possible. Because AI-generated\nresponses are based on a vast range of possibilities, it's important for you to\nbe precise. For the best results, your prompts shouldn't exceed 4,000 characters.\n\nHere are some ways to provide helpful context and detail in your prompts:\n\n- **Write your prompt like you're talking with a person.** Don't enter only\n keywords as you might when searching for a document online, but include the\n kind of detail you'd include when explaining a problem to someone. For\n example, instead of entering the terms \"workload GKE,\" ask a complete\n question: \"What kinds of workloads does GKE support?\"\n\n- **Describe why you're trying to accomplish a task.**\n Details about what you're trying to accomplish can help Gemini\n for Google Cloud provide a more useful answer. For example, telling\n Gemini for Google Cloud that you want to \"set up a\n simple, secure Google Cloud site for hosting a blog\" has more helpful\n details than only asking \"how to deploy a website.\" Because there are often\n multiple correct ways to accomplish a technical goal, providing\n Gemini for Google Cloud sufficient context can help\n ensure a good response.\n\n- **Ask to include all the parameters in a command.**\n For example, when you ask Gemini Code Assist to generate code\n functions, you are likely to produce a more useful and detailed response by\n telling it to \"make sure all methods use their required arguments.\"\n\n- **Include your level of expertise.** It's especially helpful to match your\n prompt request with your expertise level when you ask for a suggestion. Asking\n Gemini for Google Cloud to explain a concept or code as\n if you're an expert programmer--or a novice programmer--can give you different,\n and more appropriate, results.\n\n For example, to direct Gemini to respond from an expert\n context, you could prompt it with \"create Python code to list all\n Compute Engine instances. You are an expert software developer using\n Google Cloud.\" Similarly, you could ask Gemini for\n Google Cloud to \"explain Kubernetes and its benefits to me in the\n simplest terms possible.\"\n- **Include details about products and technologies.** If you're looking for\n answers about a specific product, technology, or technical capability, include\n that in your prompt. Similarly, specifying a programming language can help you get\n more relevant responses. If you're unsure about what technologies or products\n to consider, ask Gemini to compare different options for you.\n\n- **Break complex problems into multiple requests.** Writing separate prompts\n can help Gemini refine and focus the answers that it gives,\n helping you move progressively toward a solution.\n\nWhat types of assistance can Gemini give you?\n---------------------------------------------\n\nWhile there are many ways to use the language and code capabilities in\nGemini for Google Cloud, the following sections describe\nsome key areas where Gemini assistance can be most useful.\n\nRemember that Gemini for Google Cloud can produce\nunexpected, incomplete, or erroneous results when you ask for assistance.\nFor more information, see\n[Gemini for Google Cloud and responsible AI](/gemini/docs/discover/responsible-ai).\n\n### Information and reference prompts\n\nYou can ask Gemini for Google Cloud for information about\nGoogle Cloud products and services, general technologies, definitions, and\nhow those concepts and technologies relate to one another. For example, you can\nask the following:\n\n- \"What does \"serverless architecture\" mean in Google Cloud?\"\n- \"What Google Cloud products provide managed Kubernetes cluster support?\"\n- \"What are the key technical features of BigQuery?\"\n- \"When should I use Compute Engine instead of App Engine?\"\n- \"What kinds of model testing does Vertex AI support?\"\n- \"What vulnerability scanning does Google's Security Command Center offer?\"\n\n### Analytical and operational prompts\n\nYou can ask Gemini for Google Cloud to summarize and\nsimplify code functions, and give operational suggestions---for example:\n\n- \"Simplify the code I've selected\" (for example, after selecting Python code in an [IDE](/gemini/docs/codeassist/overview#ide)).\n- \"Summarize what this function does\" (for example, after selecting a C code function in an IDE).\n- \"How do I optimize IAM permissions?\"\n\n### Task prompts\n\nYou can ask Gemini for Google Cloud to help you accomplish\na specific task or set of tasks. For complex tasks, try breaking your prompts\ninto separate steps. For example, you can get procedures and task information\nwith questions like the following:\n\n- \"How do I set up a Google Cloud account?\"\n- \"How do I make a bucket public?\"\n- \"How can I pull messages from a Pub/Sub subscription?\"\n- \"How do I use Vertex AI to deploy a model?\"\n\n### Generative prompts\n\nGemini for Google Cloud can generate and complete code\nstructures as you enter a request from an\n[IDE](/gemini/docs/codeassist/overview#ide) or from the Google Cloud console.\nGemini for Google Cloud can also help you generate process\ndocumentation for code design and development.\n\nFor example, you can ask Gemini for Google Cloud to help\nyou do the following:\n\n- \"Create a function with specific variables in C.\"\n- \"Create a high-level plan for designing and building and deploying a web app in Google Cloud.\"\n- \"Create a bare metal kubernetes cluster YAML file with default IP addresses.\"\n- \"Create javascript code for a drop-down menu.\"\n- \"Create a brief, easy-to-understand user story about a data scientist named Kim designing a Vertex AI model.\"\n- \"Create a gcloud command to give the developer Google group access to view my Google Cloud project.\"\n\n### Application-related prompts\n\nIf you\n[set up Gemini Cloud Assist for a folder](/gemini/docs/cloud-assist/set-up-gemini)\nand are using the **Cloud Assist** panel at the folder level in the\nGoogle Cloud console, then assistance and responses are limited to\napplications related to the folder for products that support applications. The\nfollowing list includes Google Cloud products supported at the folder level:\n\n- [Application Design Center](/application-design-center/docs/overview)\n- [App Hub](/app-hub/docs/overview)\n- [Cloud Asset Inventory](/asset-inventory/docs/asset-inventory-overview)\n- [Cloud Monitoring](/monitoring/docs/monitoring-overview)\n- [Logs Explorer](/logging/docs/view/logs-explorer-interface)\n\nOnly prompts related to applications are supported in these Google Cloud\nproducts if you are scoped to a folder in the Google Cloud console. If you\nsubmit a question that doesn't relate to applications within this scope, then\nGemini Cloud Assist provides a generic response stating that folders\nare intended for application-related prompts. The following list shows example\napplication-related prompts:\n\n- \"How many applications are in production?\"\n- \"Help troubleshoot application example-application.\"\n\nTo get specific assistance on other products and resources, use project picker\nat the top of the Google Cloud console page to select a project resource.\n\nAdditionally, you must enable\n[application management](/app-hub/docs/overview#application-management) on the\nfolder to use the **Cloud Assist** panel at the folder level.\n\nProvide feedback\n----------------\n\nWhen you provide us with positive or negative feedback about your conversational\nexperience with Gemini for Google Cloud, you're helping us\nimprove the underlying services that we use to provide you with responses. With\nfeedback, [and your explicit permission](/gemini/docs/discover/data-governance),\nwe can improve Gemini for Google Cloud to make better\nsuggestions with fewer mistakes, as well as ensure that good responses are\nreinforced. For more information, see\n[Provide Gemini for Google Cloud feedback](/gemini/docs/support/feedback).\n\nWhat's next\n-----------\n\n- For more about large language model (LLM) prompt design, see [Introduction to prompt design](/vertex-ai/docs/generative-ai/learn/introduction-prompt-design).\n- To learn more about generative AI, see [Generative AI learning path](https://www.cloudskillsboost.google/journeys/118).\n- For more on Gemini and LLM models, see [Gemini for Google Cloud and responsible AI](/gemini/docs/discover/responsible-ai).\n- For more on how we only use your feedback data with your permission, see [How Gemini for Google Cloud uses your data](/gemini/docs/discover/data-governance)."]]