Duet Triple Threat

Simon Margolis
Google Cloud - Community
7 min readSep 28, 2023

Google Cloud Next 2023 kicked off a ton of buzz around generative AI. Some 161 announcements were enough to make anyone’s head spin! With all of this excitement, I wanted to focus on what these technologies can actually enable in the real world, namely by using Duet AI to automate tasks.

Since I recently moved and am planning a housewarming party, I wanted to see how the three forms of Google Cloud Duet AI (Duet AI for Google Workspace, Duet AI for Developers, and Duet AI for Google Cloud) could help me get everything sorted. Let’s walk through the steps Duet AI helped me take to automate tasks, save time, and make the planning process a breeze.

Creating a basic webpage with Google Cloud’s Vertex LLM “text-bison”

First, I needed to create a basic webpage with all my party’s details. I’ll send out paper invites, but they’ll point our guests to a webpage so that we can make changes if needed. I’m not the best writer, so I asked Google Cloud’s Vertex LLM “text-bison” to help me with the text for my invite.

It’s been a long time since I last wrote HTML from scratch, so I leaned on Vertex’s “code-bison” to help me out. I probably could have used Duet AI for this piece as well, but I opted to work with Vertex’s LLMs due to my familiarity with them.

Using Duet AI to determine the best fit for a use case

Once the HTML was generated, I needed to find a way to host my website. I decided to ask Duet AI for Google Cloud if Cloud Functions would be a good fit for my use case.

Cloud Functions turned out to be the way to go! Before I proceeded, I wanted to make sure it wouldn’t be too expensive. I used Duet AI to check.

Okay, $10/month was well within my budget so I decided to move forward.

Using Duet AI for Developers

It had been a long time since I’d written a web server from scratch, so I decided to lean on Duet AI for Developers to write my service. To make life even easier, I called Duet AI directly from my IDE so that I could stay focused.

I started by pasting my HTML as a Python variable. Note that there were a few variables in my HTML that needed to be filled in. I asked Duet AI to write my service function with the specific dates and times I wanted to fill in.

Using Duet AI to explain code

The function that Duet AI wrote looked good to me, so I simply hit tab and accepted it. Just to be sure I hadn’t gotten too rusty, I asked Duet AI via the chat window on the left the purpose of this code.

Duet AI confirmed that this code block was doing what I needed it to.

Using Duet AI to write a Google Cloud Function

Next, I needed to create a function to serve this HTML as a Google Cloud Function. I just wrote that in a code comment and asked Duet AI to write the relevant function for me.

Great! I hit tab again to accept this function.

Using Duet AI to determine how to host a Python file as a Google Cloud Function

Now I needed to figure out how to actually host this Python file as a Google Cloud Function. Once again, I asked Duet AI via the chat window.

This was great, but I didn’t remember the specific commands off the top of my head that were required to complete these steps. I continued my chat with Duet AI to get the specifics.

With those commands provided, I simply copied them into the terminal window. Once the last command was completed, it gave me my public URL and I was able to access my very basic site.

Using Duet AI to improve the site’s appearance

I also want this site to look nice, but I’m no front-end developer or designer, so I asked Duet AI to help me out.

Much better!

Using Duet AI in Google Sheets

This was great progress, but I still had a lot of work to do. I had to organize my guest list, which I’m always horrible at. I asked Duet AI for Google Workspace for a hand in Google Sheets.

Using Duet AI to help write an email

With the template created, I went ahead and added the specific details for my guests. As I did this, I realized I had completely lost Tony’s address. This was frustrating in the midst of planning all of the other parts of this party, so I asked Duet AI for Google Workspace to help me write Tony an email for his address. The first suggestion that Duet AI provided was too wordy for me–that isn’t how I’d normally email Tony–so I asked Duet AI to shorten it.

Using Duet AI to help write thank you notes

Okay, most of the hard parts of party planning were done. The last thing I wanted to check off my list was thank you notes. Once again, being the terrible writer I am, I knew I needed some help with the content of those notes. I asked Duet AI, this time in Google Docs, for some help with my thank you note.

Time to party, thanks to Duet AI

Now I had my invite web page, my guest list, and my thank you notes. All I needed was some cake and we were ready to party!

I was able to do all of this with the help of Duet AI’s three forms, in much less time than it would have taken me on my own. This saved me frustration and gave me the time back in my day to focus on the things that matter to me, like getting my house looking good before the big day!

This example of planning a party is just scraping the surface of what Duet AI can do. What will you do with Duet AI to unlock your potential?

Extra Credit: Create an RSVP form with Duet AI

Why stop at a simple web page? Let’s create an RSVP form on our site and write the results to a Google Sheet. I simply asked Duet AI to modify my existing HTML block with a form.

First, let’s update our HTML to include a form.

Next, I needed a new Google Cloud Function to collect the form responses and write them to a Google Sheet. Duet AI was aware of the rest of my code and built a processing function that took the variable names from the form we had created earlier in the HTML. All I had to do was paste in the sheet ID for my Google Sheet.

Let’s test it out!

…and it works!

Learn more about Duet AI with SADA

This is just the beginning of the ways we can integrate Duet AI into workflows. Don’t hesitate to reach out and schedule a workshop with a SADA AI expert to explore the ways you can integrate generative AI solutions like Duet AI into your organization. We’ll be happy to help you get started.

--

--