Table of contents
Official Content
  • This documentation is valid for:

With the following Public Tools, you can create and edit Google Docs and upload images to Google Drive using OAuth authorization from your Google account.

  • com.globant.geai.gdrive.v2.create_docs: Creates a new Google Docs document with specified content.
  • com.globant.geai.gdrive.v2.upload_image: Uploads an image to Google Drive.
  • com.globant.geai.gdrive.v2.fill_blanks_google_docs: Fills out templates by replacing blank fields or marked keywords with given values.
  • com.globant.geai.gdrive.v2.read_google_docs: Reads and extracts text from an existing Google Docs document.

When you add any of these Tools to an Agent, each consumer will be asked to complete the Google OAuth 2.0 authorization.

Login occurs interactively during the interaction with the Agent and authorizes the operation on behalf of the logged-in user. The authorization is limited to the scopes configured in Google Cloud OAuth.

The Agent requests authentication to continue. Click on Login. GDrive_Public_Tools_LoginScreen
Google consent window to grant Globant Enterprise AI permissions on your Drive. GDrive_Public_Tools_LoginScreenPrompt

Before using these Tools, you must configure Google Cloud OAuth 2.0 and register the credentials as a Secret in your Project.

Configuration steps

  1. Go to https://console.cloud.google.com/ and sign in.
  2. Create a new project or select an existing one.
  3. Go to APIs & Services > Library, and activate the Google Drive API for that project.
  4. From the side menu, go to APIs & Services > OAuth consent screen.
  5. Click on the Get started button, and configure the following:
    • App Information: Fill App name, User support email. Click on Next.
    • Audience: Select External (or Internal for organization-only use). Click on Next.
    • Contact Information: Enter your email. Click on Next.
    • Finish: Accept the "Google API Services: User Data Policy". Click on Continue and then click on the Create button.
  6. From the side menu, go to APIs & Services > Credentials.
  7. Click on Create Credentials. Select OAuth client ID and configure the following:
    • Application type: Select Web application.
    • Name: Enter a descriptive name (for example, GoogleDrive OAuth 2.0 Web App - geai-app).
    • Authorized redirect URIs: Click on Add URI and paste the exact URL:
      • https://console.<your-domain>/oauth_tool_login_callback (for example, https://console.saia.ai/oauth_tool_login_callback).
    • Click on Create. Copy and securely save the Client ID and Client Secret; you will need them to create the Secret in your Project.
  8. If you have not done so already, publish your app from the OAuth consent screen in Google Cloud. This step is required for the credentials to work with external users.
  9. Go to the Console, open the Project where you will use this Tool and create a new Secret. Follow the steps in How to create a Secret.
    • In the Name field, enter a descriptive name (for example, gdrives). This name will be used later in the token parameter of the Tool.
    • In the Value field, paste the full content of the JSON:
       {
        "id": "globant-enterprise-ai-dev",
        "name": "Gmail OAuth 2.0 Web App - globant-enterprise-ai-dev",
        "type": "oauth2",
        "provider": "google",
        "oAuth": {
          "clientId": "<Client ID>",
          "clientSecret": "<Client Secret>",
          "authorizationUrl": "https://accounts.google.com/o/oauth2/auth",
          "redirectUri": "https://console.saia.ai/oauth_tool_login_callback",
          "tokenUrl": "https://oauth2.googleapis.com/token",
          "authorizationExtraParams": {      
            "prompt": "consent"
          },
          "scopes": ["https://www.googleapis.com/auth/drive.file" 
          ]
          }
         }
         
Note: Ensure that the value of redirectUri exactly matches the Authorized redirect URIs configured in Google Cloud OAuth 2.0. Additionally, the scope https://www.googleapis.com/auth/drive.file limits access only to files created by the app. If you want permissions for all of Google Drive, you can use https://www.googleapis.com/auth/drive.

 

Inside the Agent you are creating, go to the AI & Tools Tab, select the Tools and Agents section, and click on + Add. In the left pane, select the desired Tool. Then, select the Tool again in the left pane to view the required parameters, and complete the following:

Parameters

  • tools.credential_oauth: The name of the Secret that stores the Oauth Credential information (for example, gdrives).
  • email: The email address to share the generated Google Drive file with. The Tool creates the file and shares it with this address.

Availability

Since version 2025-07.

Last update: August 2025 | © GeneXus. All rights reserved. GeneXus Powered by Globant