Editorial note: Whether you’re new to Google Cloud or an experienced user, read on to learn how Duet AI can help you learn about products and services, generate code and commands, and understand your environment.
In fast-moving organizations, engineers often work on large projects that utilize hundreds of cloud products and services, spanning multiple teams and functions. But the complexity of enterprise cloud environments can make it challenging for engineers to keep track of everything, understand how systems work together, troubleshoot issues, and write efficient code. This can lead to wasted time and resources, reduced security, and increased administrative toil.
Duet AI, a new AI-powered collaborator for Google Cloud, can help you reduce complexity and overcome obstacles by providing assistance with a variety of common tasks. If you are a cloud engineer, developer, operator, data practitioner, or someone who uses Google Cloud as a part of your day-to-day work, Duet AI can help you get things done fast via a natural language interface in the Google Cloud console. Let’s take a look at how it does this.
1. Get started and onboard to Google Cloud faster
Duet AI can answer common questions you might have when you get started with Google Cloud. For example, it can tell you more about different products and services, explain options and settings, and provide step-by-step instructions for completing common tasks.
Learn more about Google Cloud products
If you’re just getting started, you may want to learn more about different products. For example, you could ask Duet AI to explain the differences between Google Kubernetes Engine and Google App Engine. Duet AI could provide a comprehensive comparison, highlighting the key features and benefits of each.
Pro tip:Ask Duet AI to explain the comparison in a table format for a visual overview
Get step-by-step guidance on common tasks
As you gain more experience with Google Cloud, Duet AI can help you with specific tasks, such as how to migrate data from on-premises to Google Cloud. Duet AI could provide step-by-step instructions.
Pro tip:You can ask Duet AI for “step-by-step instructions” to receive explicit guidance on how to complete a task.
Understand options and settings
Duet AI can also help you understand the different options and parameters that are available for a particular Google Cloud product or service. For example, different options for creating a new Cloud Storage bucket, or the different parameters that can be used in a Cloud Functions trigger.
“Hallucinations” are a commonly known issue for systems that rely on generative AI models, where they may generate outputs that seem plausible but are in fact incorrect. To help you verify the accuracy of its outputs before you use them, Duet AI can include links to documentation, tutorials, and other materials relevant to your questions.
2. Generate scripts, gcloud commands, queries, and code
Duet AI can help you generate code in a variety of programming languages, SQL queries, gcloud commands, and scripts to interact with Google Cloud products.
Generate code in a variety of programming languages, including Python, Java, and Go
Whether you are new to coding and just want help with automating repetitive tasks, or an experienced developer trying to figure out how to integrate two different cloud services, Duet AI can help you generate code quickly and easily.
Generate gcloud commands, configuration and policy files
Command line syntax and configuration file syntax can be difficult to remember, so Duet AI can also help you figure out gcloud commands such as how to get a list of idle VMs or create configuration files such as policies granting permissions to certain users in your organization.
Pro tip:Please note that generated commands and other snippets may include generic variables such as PROJECT_ID or LOCATION that need to be substituted with actual values specific to your environment before you can run them.
Generate queries to help extract insights from your data
Writing SQL queries can be time-consuming and challenging, especially if you’re not an expert or haven’t written SQL queries for a while. Duet AI can generate queries based on your natural language descriptions, or update your existing queries to fit your needs. For example, you can ask Duet AI to select customers who fit certain criteria such as revenue thresholds and were active in a given time period. You can also ask follow-up questions or paste an existing query into the chat window and ask Duet AI to explain it or make updates.
Pro tip: Get contextual SQL completions and other advanced data analysis capabilities directly in the console with Duet AI in BigQuery.
In cases when generated snippets directly quote at length from a particular source, Duet AI can provide citations to help you understand the license requirements and comply with them.
3. Understand what’s happening in your Google Cloud environment
Duet AI can also help you understand your Google Cloud environment by summarizing and explaining code, queries, simulation results, logs and system errors. Please note that Duet AI isn’t yet able to access data specific to your environment, beyond what you provide as part of your prompt. For example, if you ask about cost-saving opportunities, Duet AI can provide generic guidance that is not tailored to your specific environment. However, Duet AI is still under development, and we are working on improving its ability to make it even more helpful.
Understand logs, simulation results, JSON payloads, and more
It can be difficult sometimes to comprehend and make sense of large amounts of data, especially when it’s presented in a complex format. To help, instead of trying to parse an API output that is meant to be machine-readable (e.g. Recommender, Security Command Center), you can try pasting it into Duet AI chat and ask for a natural language summary.
Understand root causes for common errors
Duet AI can provide suggestions for how to resolve common issues such as authentication, quota, and billing errors. For example, if you see an access denied error while trying to connect to your Cloud SQL database, you can paste the error code, along with any relevant context, to Duet AI chat to learn more about potential root causes and troubleshooting steps.
Understand code, Terraform scripts, queries, and more
Figuring out what is going on can be time-consuming, especially when you’ve inherited code written by someone else, or when you don’t deal with coding or automation tasks as a part of your day-to-day work and just need to make a small change in an existing script. Duet AI can help you interpret automation scripts, queries, and code written in a variety of programming languages (e.g. Google Cloud samples). For example, you can use Duet AI to help you understand a Terraform script that is used to deploy your infrastructure, or debug a query that isn’t returning the expected results.
Pro tip: Get autocomplete, code generation from comments, and other advanced code assistance capabilities directly in the IDEs such as Visual Studio Code with Duet AI in Cloud Code.
We are working to integrate Duet AI capabilities into more places across the Cloud console. For example, in Cloud Logging, you can use Duet AI to summarize log entries and ask follow-up questions about why a particular event happened and how to address the problem. You can also examine the details of the prompt passed to Duet AI, including the instructions, and apply similar principles in other contexts by constructing your own prompts and providing context manually.
Tips and tricks for getting the most out of Duet AI chat
- Validate Duet AI outputs before using them. As mentioned earlier, hallucinations are a common issue of generative AI systems, generating output that seems plausible but that is fact incorrect. We’re continuously working to improve Duet AI to ensure it provides accurate and helpful information, but it is important to verify its outputs before using them. You can do this by checking the links to documentation and citations that Duet AI provides, or by using your own knowledge and expertise to evaluate its responses.
- Be specific and provide context in your prompts. The more specific you are in your prompts, the better Duet AI will be able to understand what you are asking for. For example, instead of asking “How do I use Cloud Functions?” ask “How do I deploy a Cloud Function to trigger a workflow when a new file is uploaded to Cloud Storage?” By being specific and providing additional context in your prompts, you can help Duet AI to generate more accurate and helpful outputs.
- Ask follow-up questions to get better and more on-point responses. For example, you can ask for clarification, alternatives, or more information by saying “Can you explain that in more detail?” “Can you suggest another approach?” or “What are the pros and cons of each approach?”
- Help us improve Duet AI by providing feedback. If Duet AI does not provide the assistance that you need, or if you have any suggestions for how we can improve Duet AI, please let us know. Duet AI is still under development, and we’re always looking for ways to improve it. You can provide feedback by rating the answers to your prompts using the Thumbs up/down, and optionally sharing your prompt and the answer that you received. You can also fill out the survey (~5 minutes).
Get started with Duet AI chat in the console today
You can learn more about Duet AI in Google Cloud on our website. If you’re interested in trying out Duet AI chat in the console, you can request access to the Duet AI Preview program. Once you have been granted access, you can start using Duet AI chat by clicking the Open Duet AI button in the console toolbar.
We hope you enjoy using Duet AI chat to get help with your Google Cloud tasks!