Home
Developer documentation

Create a Google service account

Syllable’s samples are fine for testing, but to write to your own Google Drive you'll need a few things:

  • A Google Drive account.
  • A Google Service Account that your agent can use to write to your Google Drive.
  • Folders and permissions configured as described in the following steps.

Step 1: Prepare Your Google Drive Assets

  • Log into your Google Drive.
  • Set up folder structure with a parent folder named "Syllable Demo" or whatever name you choose.
  • Under that, create two folders named "Forms" and "Sheets".
  • In the Forms folder create a Google Form and populate it with the questions you want your agent to ask (e.g., vehicle type, preferred test drive date, ZIP code, etc.).
  • Save the ID Number of that parent folder and the ID Number of the Form, you’ll need both for your Tool configuration.
  • IDs can be found at the end of the URL. E.g., _https://drive.google.com/u/1/folders/_ _ID-NUMBER-HERE_

Step 2: Enable the IAM API

  • Select a project (the default is My First Project). If it’s not listed, create one.
  • Then click "next" in Confirm Project and then click "enable."
  • This gets you ready to configure your account in the Google Cloud Console.

Step 3: Enable and Configure APIs in Cloud Console.

  • In Google Cloud Console go to "APIs & Services."
    • Search for and Enable the Google Forms API, Google Sheets API, and Google Drive API.
  • Now you need to create your Service Account.
  • Click "Credentials", "Manage Service Accounts", and then "Create Service Account".
  • Give it a Name and Description.
  • Give it a role: (_Basic,_ Editor).
  • Click "Done."
  • Select your new Service Account, click the action menu (three vertical dots), "Manage keys", "Add key", "Create new key", select "JSON".
  • Download and open the file in a text editor. Keep this key secure.
  • You also need to copy your service account name. Go back to Service accounts and click the copy button.

Step 4: Share your Google Drive resources to your Google Service Account

Share the folders you created with the service account so it can read the form and create and edit files.

  • Go to your Google Drive.
  • Go to the parent folder ("Syllable Demo"), open the share option, and paste in your Google Service Account name, then give it Editor permissions.

Step 5: Add the Keys to your Agent Tool Configuration

Now you need to give your agent the new access keys that you've created.

  • Open the JSON file that you downloaded using a text editor and copy all of the text.
  • Go back to your agent in the Console and click "Edit".
  • Scroll down to Session variables. Under Tool Header, paste the entire JSON text from the file you downloaded into the value field with X-Google-Service-Credentials as the key field.
  • Locate the folder ID and form id that you saved from Step 1.
  • Scroll up to "Tools with configurations" and expand create_sheet_from_form
    • Parent Folder ID Number → paste the Sheets folder ID.
    • Form ID Number → paste the Google Form ID number.
  • Click "Save".

Step 6: Test your Agent

Congratulations, your agent is now ready to:

  • Read from your Google Form.
  • Create a new Google Sheet and update it as it talks to prospects.

Let's go test it out.

  • Select your Agent and click "Start Session".
  • Say "Yes" to the Agent and answer the first question.
  • In the inspector on the right, you should see the create_sheet_from_form tool being used.
  • You can then click the down arrow next to "results" to expand the results and you'll see your sheet ID, etc.
  • If you continue answering questions, you'll see other tools be used such as append_data_with_session.
  • Now, finish the questions and go verify that it captured your answers in a Google Sheet.
  • Go to your Google Drive, to the Sheets folder you created and there you can inspect your sheet and review your survey answers.

Next steps

Continue with the next guide, or explore another part of the documentation.

Overview

How to build and implement a Shopify Agent using the Syllable Console interface.

Explore further: