AppsScriptPulse

Answer questions based on Google Chat conversations with a Gemini API powered Chat app

This tutorial shows how to make a Google Chat app that answers questions based on conversations in Chat spaces with generative AI powered by Vertex AI with Gemini. The Chat app uses the Google Workspace Events API plus Pub/Sub to recognize and answer questions posted in Chat spaces in real time, even when it isn’t mentioned.

Here is another great tutorial from the Google Chat DevRel team, this time showcasing how the Google Workspace Events API and some new Google Chat UI elements can be used to turn a Chat space into a Gemini Pro powered knowledge base.

The sample solution will let you consume your Chat space message history into a Firestore database. The Chat app is an intelligent agent that can then monitor for new questions and make suggestions using Gemini to generate content based on the previous messages.

There is quite a bit of setup required as part of this tutorial, but it provides a solid foundation for quickly scaling this to your needs.  A demonstration and explanation of the sample app was given as part of the Google Chat apps and APIs: Build connected workflows for the hybrid workplace session at Google Cloud Next and a recording might be available soon!

Source: Answer questions based on Chat conversations with a Gemini AI Chat app  |  Google Chat  |  Google for Developers

How to access secrets from Google Secret Manager using Google Apps Script

This detailed guide explains how you access your passwords, API keys and other sensitive data stored in the Google Secret Manager with Google Apps Script.

API keys and other credentials are your digital passports to access valuable data and services from various online platforms. When you’re developing Google Apps Script projects that connect to using keys, it’s of paramount importance to handle these keys with care and prevent them from falling into the wrong hands. Mishandled API keys can lead to unauthorized access, data breaches, and potentially even financial consequences.

One way to store API keys in Google Apps Script is the built-in Properties Service. This service offers a mechanism to store key-value pairs attached to your Apps Script project. While the Properties Service offers a convenient way to store sensitive data, it comes with limitations:

  • Not True Encryption: The Properties Service stores data in a readable format. Anyone with sufficient access to your Apps Script project might be able to view the API keys.
  • Limited Access Control: It’s challenging to implement fine-grained access restrictions over who can see the stored keys within the Properties Service.

For a more secure and scalable approach you might consider using Google Cloud’s Secret Manager. As described by Amit Agarwal in this source post:

Google Secret Manager is a cloud service where you can store sensitive data such as passwords, database credentials, encryption keys or any other confidential information that you don’t want to hardcode in your application’s source code. You can also set up an expiration time for the secret and the Google Secret Manager will automatically delete the secret after the specified time.

You can read more about using the Google Cloud Secret Manager in Amit post, which also includes the setup and Apps Script code snippets to make it work. For some general best practices on key management, Google provide this support article.

Source: How to Access Secrets from Google Secret Manager using Apps Script – Digital Inspiration

We’re bringing new generative AI and security innovations to businesses of all sizes to Google Workspace | Google Workspace Blog

we’re making it easy for organizations to extend the power of their data and custom AI models by using Vertex AI with Workspace as a platform, enabling next-generation workflows that are built right into Docs, Gmail, and other Workspace apps

Google Cloud Next ’24 has just started but already a number of exciting product updates have been announced, including the indications of a possible deeper integration of Vertex AI into Google Workspace.

In one of our recent Pulse updates we highlighted Dialogflow CX and Google Chat API integration is now in Developer Preview. The reason I feel this is an important development is Dialogflow CX lies at the heart of Vertex AI Agent Builder (formerly Vertex AI Search and Conversation … formerly Gen App Builder).

Vertex AI Agent Builder lets developers easily build and deploy enterprise-ready gen AI experiences via a range of tools for different developer needs and levels of expertise — from a no-code console for building AI agents using natural language

This integration is significant because it addresses a key challenge I’ve experienced as a Vertex AI Agent Builder trusted tester. Previously, using Google Workspace data in your agents required moving it to a Cloud Storage bucket. The new integration potentially streamlines this process, allowing seamless access to your Workspace data.

This aligns with a broader trend I’m seeing at Google Cloud Next: the emphasis on custom Generative AI-powered agents. Gabe Weiss’s demo in  this morning’s keynote showcased the potential of such agents to intelligently support users. Though details about the underlying technology were limited to Vertex AI Agent, the UI does hint at a gemini.google.com integration. You can see for yourself at the queued clip (this may change if Google trims the video).

#GoogleCloudNext

Source: We’re bringing new generative AI and security innovations to businesses of all sizes | Google Workspace | Google Workspace Blog

Google Workspace Developer News: Dialogflow CX and Google Chat API integration, Chat app updates, and more

Episode 5: Welcome to the Google Workspace Developer News! Find out what’s new on the Google Workspace Platform.

Here are the latest Google Workspace developer updates compiled by Chanel Greco. The standout feature is the integration of Google’s Dialogflow CX (a powerful natural language understanding platform) with the Google Chat API. This lets developers build chat apps that truly converse with users. Access is currently available through the Google Workspace Developer Preview Program.

The video spotlights more exciting updates to the Google Chat API. Interactive widgets (like thumbs up/down icons) can now be placed at the bottom of messages, boosting user interaction. Additionally, the formattedText field supports bulleted list markup, making it easier for apps to organize information.

Finally, Google Apps Script gets a boost too! The new LinkPreview Class in the Card Service grants control over link titles, visuals, and how they’re displayed within smart chips.

Click the source link for a deeper dive into these updates and find helpful resources in the video description!

Source: Dialogflow CX and Google Chat API integration, Chat app updates, and more

Totally Unscripted: API Mastery in Action: Creating powerful Google Workspace 3P solutions with guest Comeen 03 April, 2024 at 1200 PDT / 1500 EDT / 1900UTC / 2000 BST

Totally Unscripted* returns live on 03 April, 2024 at 1200 PDT / 1500 EDT / 1900UTC / 2000 BST!

The shift to hybrid work models presents unique challenges for businesses.  How do you create a seamless, productive experience for employees in this new environment?

These challenges also create opportunities for third parties like Comeen to develop solutions that surface new functionality for Google Workspace customers with deep integrations into services like Google Meet and Google Chat, as well as other platforms like Slack.

Join this exclusive session with Comeen’s CTO, Simon Cleriot, to discover the potential of Google Workspace APIs. He’ll share insights into Comeen’s philosophy toward API integrations and how they build solutions that transform the hybrid workplace.

Watch LIVE 03 April, 2024 at  1200 PDT / 1500 EDT / 1900UTC / 2000 BST 

*Totally Unscripted is an independent Google Workspace developer show co-hosted by Martin Hawksey, Charles Maxson, Alice Keeler and Kara Ireland

Find out who has access to your Google Drive files using Google Apps Script

In this blog we are going to find out who exactly has access to my Google Drive files, be it a Google Sheet, Google Doc, Form and more. To do this we are going to be using the DriveApp and Google Apps Script.

Recently Aryan Irani shared this post which shows how you can get the file permissions on a Google Drive file using DriveApp. This uses the DriveApp methods for .getEditors() and .getViewers(), which left me wondering about commenters???

The answer is file commenters are included in the .getViewers() response and as pointed out by TheMaster you can filter out commenters with .getAccess().

Another approach is to use the Advanced Drive Service:

The advanced Drive service lets you use the Google Drive API in Apps Script. Much like Apps Script’s built-in Drive service, this API allows scripts to create, find, and modify files and folders in Google Drive. In most cases, the built-in service is easier to use, but this advanced service provides a few extra features, including access to custom file properties as well as revisions for files and folders.

Learning about the Advanced Drive Service can be useful as it open up more opportunities to interact with Google Drive content and can also help you get file properties.

In the case of permissions there is a dedicated Permissions Resource that allows access to all the file permissions. For example, if I wanted to see what accounts had access to a file in MyDrive you can use:

// Requires Drive Advanced Service v3
const fileP = Drive.Permissions.list(fileId, {
  fields: "*" // all fields
});

fileP.permissions.map(perm => {
  console.log(`${perm.role} - ${perm.emailAddress}`)
});

Using the Advanced Drive Service does require a step up in understanding how to call the Drive API and the response you get but once you begin understanding it can come with huge benefits with more efficient code.

Source: Find out who has access to your Google Drive Files using Google Apps Script

Boost your presentations with AI: A Google Apps Script tutorial for a Google Slides reviewer assistant

The Slides Advisor project is an open source, Google Workspace Add-On that uses artificial intelligence (AI) technology to review and give feedback on your presentations, whenever you need it. The project uses Google’s Gemini API image and text processing features to analyze your Google Slides against a set of guidelines and lets you know how you are doing against those guidelines. Even better, you can customize those guidelines to follow your organization’s recommendations, or remind you to improve your presentations based on rules you define for yourself.

We’ve all been there: scrambling to cram too much information onto a single slide. But what if you had an AI assistant to give your presentations a once-over?

The Slides Advisor is a free, open-source Google Workspace Add-on for Google Slides that uses the power of AI to analyze your presentations. It checks your slides against customisable guidelines, helping you ensure they’re clear, concise, and visually appealing.

Everything you need to get started is covered in the source post by Joe Fernandez and Steve Bazyl. One of the highlights for me is seeing how you can setup a service account to access the Gemini AI API with Google Apps Script. The post also covers how you can modify the prompt you use to get different responses from Gemini.

Source: Build an AI Slides Reviewer with Gemini  |  Google AI for Developers

Essential Apps Script: a Practical Guide from the University of York

Welcome to the Essential Apps Script course. This guide is designed so you can work through an introductory course in Google Apps Script, designed so you do not need any knowledge of coding to get started.

As part of our latest episode of Totally Unscripted we chatted to Phil Bainbridge about the work he does at the University of York supporting and creating Google Apps Script projects.

One of the resources the University has developed is the Essential Apps Script course which is designed to lead beginners through the first steps in learning Google Apps Script. The guide is shared under a Creative Commons CC-BY-NC-SA which allows anyone to reuse course materials for non-commercial use if shared with the same licence and attributing the University of York.

This course is a perfect starting point for both beginners and those tasked with helping others learn Google Apps Script. Its step-by-step approach and beginner-friendly language make it easy for anyone with no prior coding experience to grasp the fundamentals. For those supporting others, the course provides a clear and structured resource to guide colleagues through the process, saving valuable time and ensuring everyone is on the same page from the beginning.

Source: Subject Guides: Essential Apps Script: a Practical Guide: Essential Apps Script

Totally Unscripted: Level Up Your Productivity: Unboxing the Gift of Apps Script 20 March 2024 at 1200 PST / 1500 EST / 1900 GMT

Totally Unscripted* returns live on 20 March 2024 at 1200 PST / 1500 EST and because of the crazy daylight saving time in the United States will be for many non-US viewers the earlier time of 1900 UTC/GMT.

Join us as we explore how Google Apps Script is being used to make a real impact in productivity. Our guest speaker, Phil Bainbridge, is an experienced IT specialist at the University of York and author of ‘The Gift of Script’ and regular contributor to AppScriptPulse.

Phil will share his insights on how Google Apps Script can be used to automate tasks, create custom solutions, and enhance your workflow. As part of this episode we will also discover how Phil and other members of York’s Digital Inclusion, Skills & Creativity team support digital literacy development in Google Workspace and Apps Script as well as the solutions they have created to improve productivity.

So if you are asking yourself how can you supercharge your productivity with Google Apps Script? Then this episode of Totally Unscripted is hopefully for you!

Show Live/Recording link – https://www.youtube.com/watch?v=-JrJpK4ezjg

*Totally Unscripted is an independent Google Workspace developer show co-hosted by Martin Hawksey, Charles Maxson, Alice Keeler and Kara Ireland

Google Cloud Next 24 agenda builder is LIVE! Reserve your sessions NOW and spotlight on Google Workspace related topics 


Google Next is only a few short weeks away and as of this morning, the Agenda builder is live. In this video I walk through how I choose which sessions to attend, and my recommended Google Workspace sessions.

Jesse Nowlin, tabGeeks founder and Google Workspace Admin expert, has complied this great video with tips on how to get the most out of Google Cloud Next ’24. Jesse has highlighted a number of Google Workspace related sessions which are linked from the video description.

Jesse has included the session Charles Maxson, Kara Ireland and myself (Martin Hawksey) will be doing on Day 3 April 11, 2024 at 11:00 AM – 11:45 AM PDT on Apps Script and Gemini: Build custom AI-powered Google Workspace solutions. Kara and I have already started discussing tactics for getting the mic off of Charles. The session is demo packed and hopefully full takeaways that can help with your own Gemini API powered Google Workspace solutions.

The entire Totally Unscripted crew will actually be at Next ’24 with Alice Keeler giving a Lightning Talk on Duet Your Data. If you are one of the anticipated 40K attendees (⊙_⊙’) please come and say hello. Finally, if you haven’t registered yet Jesse has a referral link in his video description.

Source: Google Cloud NEXT 24 Agenda Builder is LIVE! Reserve Your Sessions NOW