|

|  How to Integrate Google Dialogflow with Google Slides

How to Integrate Google Dialogflow with Google Slides

January 24, 2025

Learn to seamlessly integrate Google Dialogflow with Google Slides, enhancing interactivity and automation in your presentations through this comprehensive guide.

How to Connect Google Dialogflow to Google Slides: a Simple Guide

 

Setting Up Dialogflow

 

  • Create a new Dialogflow agent by logging into your Dialogflow console and clicking on "Create Agent". Fill in necessary details like agent name, timezone, and Google Project.
  •  

  • Under "Intents", create various intents which will be responsible for responding to specific user inputs. For each intent, define training phrases and the appropriate responses.
  •  

  • Enable the Dialogflow API via the Google Cloud Console to allow proper functionality of your agent.

 

Google Cloud Platform Setup

 

  • Open your project in the Google Cloud Console and ensure that Dialogflow API is enabled in the APIs & services section.
  •  

  • Navigate to IAM & Admin > Service Accounts. Create a new service account, providing it with necessary roles such as Dialogflow API Client.
  •  

  • Create and download a private key in JSON format for your service account. This key will be used to authenticate Dialogflow requests through your application.

 

Setting Up Google Slides

 

  • Go to the Google Slides API in the Google Cloud Console. Enable the API for your project to allow programmatic access to your slides.
  •  

  • Create OAuth 2.0 credentials in the Credentials page and set up OAuth consent screen as needed. Note the client ID and client secret which will be needed later.
  •  

  • Share the Google Slides presentation you want to manipulate with your service account's email to grant it access.

 

Integrating with Node.js

 

  • Initialize a Node.js project and install required packages:

     

    npm init -y
    npm install dialogflow googleapis google-auth-library
    

     

  • Write a script to authenticate using the service account JSON and manipulate Google Slides based on Dialogflow responses:

     

    const { google } = require('googleapis');
    const dialogflow = require('@google-cloud/dialogflow');
    const { GoogleAuth } = require('google-auth-library');
    const path = require('path');
    
    // Path to your service account JSON
    const serviceAccountPath = path.join(__dirname, 'service-account.json');
    
    // Set up Dialogflow session client
    const sessionClient = new dialogflow.SessionsClient({ keyFile: serviceAccountPath });
    
    // Set up Google Slides API
    const auth = new GoogleAuth({
      keyFile: serviceAccountPath,
      scopes: ['https://www.googleapis.com/auth/presentations']
    });
    
    // Function to update slides based on Dialogflow conversation
    async function updateSlides(sessionId, text) {
      const sessionPath = sessionClient.projectAgentSessionPath('YOUR_PROJECT_ID', sessionId);
      
      const request = {
        session: sessionPath,
        queryInput: {
          text: {
            text: text,
            languageCode: 'en-US',
          },
        },
      };
      
      const responses = await sessionClient.detectIntent(request);
    
      const result = responses[0].queryResult;
      if (result && result.fulfillmentText) {
        console.log(`Detected intent: ${result.fulfillmentText}`);
    
        // Auth and create slides API client
        const authClient = await auth.getClient();
        const slides = google.slides({ version: 'v1', auth: authClient });
    
        const presentationId = 'YOUR_PRESENTATION_ID';
    
        // Generate a sample request to update slides
        const requests = [
          {
            insertText: {
              objectId: 'TEXT_BOX_OBJECT_ID', // ID of textbox to update
              text: result.fulfillmentText,
              insertionIndex: 0
            }
          }
        ];
    
        await slides.presentations.batchUpdate({
          presentationId: presentationId,
          resource: { requests }
        });
      }
    }
    
    // Example to test the integration
    updateSlides('sample-session-id', 'Hello, world!');
    

     

 

Testing the Integration

 

  • Run the Node.js script to test the integration. Send different sample queries and verify that the Dialogflow intents are correctly interpreted and that the slides are updated accordingly.
  •  

  • Inspect the Google Slides to ensure that the expected changes appear as results from Dialogflow conversations.

 

Omi Necklace

The #1 Open Source AI necklace: Experiment with how you capture and manage conversations.

Build and test with your own Omi.

How to Use Google Dialogflow with Google Slides: Usecases

 

Automated Presentation Creation with Google Dialogflow and Google Slides

 

  • Integrate Google Dialogflow with Google Slides to enable voice-activated presentation creation and editing. This integration can streamline workflow, saving time and reducing the manual effort involved in creating presentations.
  •  

  • Use Dialogflow's natural language processing capabilities to parse user commands and dynamically update or create slides based on user input.

 

Setting Up Dialogflow

 

  • Create an agent in Google Dialogflow that will understand commands related to presentation creation, such as adding new slides, inserting images, or modifying text.
  •  

  • Design intents in Dialogflow for specific functions like creating a title slide, adding bullet points, or integrating graphs and charts. Train these intents with sufficient phrases to handle varied user input.

 

Integrating with Google Slides API

 

  • Set up Google Slides API credentials and connect them with Dialogflow so that commands can be translated into API calls for slide modification.
  •  

  • Develop a backend service that handles Dialogflow's webhook requests to perform operations in Google Slides, automating the presentation creation process based on user commands.

 

Using the Integration

 

  • Start by speaking to Dialogflow through the preferred interface (e.g., a website or a mobile app), issuing commands like "Create a new presentation for quarterly sales." The agent interprets this and sets up a basic template in Google Slides.
  •  

  • Continue adding individual slides or modifying content using further voice commands such as "Add a data slide with 2021 sales figures" or "Insert an image of the company logo on the first slide."
  •  

  • Enhance presentations by dynamically adding charts, videos, or live data feeds based on real-time input recognized by Dialogflow and executed via the Google Slides API.

 

Conclusion

 

  • The synergy between Google Dialogflow and Google Slides provides a highly efficient way to create and manage presentations without manual intervention. This solution is particularly useful for business professionals or educators who frequently need to generate presentations and prefer a hands-free, efficient method of doing so.

 

 

Interactive Voice-Activated Team Briefings with Google Dialogflow and Google Slides

 

  • Leverage Google Dialogflow to transform voice commands into interactive team briefings using Google Slides. This integration reduces time spent on slide creation and allows team members to focus on content delivery.
  •  

  • Utilize Dialogflow's language understanding to interpret spoken instructions, enabling the dynamic generation and updating of briefing slides based on user requests.

 

Configuring Dialogflow

 

  • Set up a Google Dialogflow agent to detect commands related to team briefings, such as adding agenda items, including slide notes, or listing action points.
  •  

  • Create intents in Dialogflow to handle specific tasks like generating overview slides, integrating feedback points, or updating deadlines. Train these intents with varied expressions to ensure robust command recognition.

 

Linking with Google Slides API

 

  • Create credentials for the Google Slides API and associate them with Dialogflow to enable conversion of spoken commands into slide editing API requests.
  •  

  • Develop a server-side application to manage Dialogflow webhook requests, which will trigger appropriate actions in Google Slides for seamless slide construction based on user voice commands.

 

Operational Usage

 

  • Initiate the interactive session by voicing commands via preferred channels such as a desktop application or smart device, e.g., "Generate a new team briefing for the marketing launch." The agent intuitively crafts a base structure in Google Slides.
  •  

  • Continue customizing the briefing by issuing commands like "Add a slide with key objectives" or "Update the timeline slide with new product launch dates."
  •  

  • Enhance engagement by incorporating media elements, such as company promotional videos or live product demos, triggered by Dialogflow and executed through the Google Slides API.

 

Final Thoughts

 

  • Integrative technology utilizing Google Dialogflow and Google Slides enables an interactive, streamlined approach to team briefings, favoring business leaders and project managers who require dynamic, rapid slide construction while focusing on effective communication.

 

Omi App

Fully Open-Source AI wearable app: build and use reminders, meeting summaries, task suggestions and more. All in one simple app.

Github →

OMI NECKLACE + OMI APP
First & only open-source AI wearable platform

a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded
a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded
online meeting with AI Wearable, showcasing how it works and helps online meeting with AI Wearable, showcasing how it works and helps
online meeting with AI Wearable, showcasing how it works and helps online meeting with AI Wearable, showcasing how it works and helps
App for Friend AI Necklace, showing notes and topics AI Necklace recorded App for Friend AI Necklace, showing notes and topics AI Necklace recorded
App for Friend AI Necklace, showing notes and topics AI Necklace recorded App for Friend AI Necklace, showing notes and topics AI Necklace recorded