• Name: The name of the tool is used to reference it elsewhere in Console, including in prompts and agents, so you should pick something that’s easily identifiable. It shouldn’t contain any whitespace. Enter “search_dealerships” here.
  • Service: A service is a grouping of tools. You can select any available service here to add your new tool to that service. Select default.
  • Tool schema: A JSON object defining the behavior and capabilities of the tool. Paste in the JSON below.

Find Dealership

For this tool, you can paste the following:

{
  "type": "endpoint",
  "tool": {
    "type": "function",
    "function": {
      "name": "search_dealerships",
      "description": "Search Toyota dealership based on the zipcode",
      "parameters": {
        "type": "object",
        "required": [
          "question"
        ],
        "properties": {
          "question": {
            "type": "string",
            "description": "An inquiry about content in the agent's documents, e.g. What is the closest dealership to zip code 94040?"
          }
        }
      }
    }
  },
  "endpoint": {
    "url": "http://helix-app/v1/search",
    "method": "post",
    "argumentLocation": "body"
  },
  "defaults": null,
  "staticParameters": [
    {
      "name": "doc",
      "description": "Toyota dealerships in the US",
      "required": true,
      "type": "data_source_list",
      "default": ["toyota_dealerships"]
    }
  ],
  "result": null
}
  • This tool will query Helix, Syllable’s document management and search service, for an answer to the user’s question, using the ‘toyota_dealerships’ data source that we created as its knowledge base.
  • The “endpoint” object gives the agent details on what API endpoint to call and how to pass the parameters (in the body of a POST request).
  • The “tool” object includes a description of the tool, which should be written as instructions to the agent regarding what the tool does. It also includes a “parameters” object, which describes the various parameters that the agent should gather from the user’s input and send to the API endpoint in the “endpoint” object.
  • The “staticParameters” object also describes parameters that should be sent to the API, but are predetermined at configuration time, rather than gathered by the agent from the user’s input.
  • Click Save to save this tool.

Create tools for create_sheet_from_form and append_data_with_session by repeating the instructions above with new endpoints.

  • To use your own Google Sheet, create a service account and share access to the sheet. Follow Google’s guide to creating a service account and key , then enable the Sheets API, and share your sheet with the service account’s email. 
  • Then go to the agent’s configuration and under tool configuration, Sheet ID and Sheet Name to point to your Google Sheet. 
  • You also then should add your Google service credentials to the agent’s tool headers. Name the Tool Header X-Google-Service-Credentials and add google credentials to it for example:
{
  "type": "service_account",
  "project_id": "chart-agent-demo",
  "private_key_id": "abc123def456ghi789",
  "private_key": "-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BA...\\n-----END PRIVATE KEY-----\\n",
  "client_email": "chart-agent@chart-agent-demo.iam.gserviceaccount.com",
  "client_id": "123456789012345678901",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/chart-agent%40chart-agent-demo.iam.gserviceaccount.com"

Create Sheet from form tool

{
  "type": "endpoint",
  "tool": {
    "type": "function",
    "function": {
      "name": "create_sheet_from_form",
      "description": "Capture data with the `column_name` and `value`",
      "parameters": {
        "type": "object",
        "properties": {}
      }
    }
  },
  "endpoint": {
    "url": "http://gdrive-proxy-app/google/create-sheet-from-form",
    "method": "post",
    "argumentLocation": "body"
  },
  "defaults": {
    "sheet_title": "${vars.session.agent.id}"
  },
  "staticParameters": [
    {
      "name": "parent_folder_id",
      "description": "The parent folder id where google sheets are created in google drive",
      "required": true,
      "type": "string",
      "default": "18JT-JraPiNEHWTHrUBcUz0HF6mxBcPtW"
    },
    {
      "name": "form_id",
      "description": "The id of the google form",
      "required": true,
      "type": "string",
      "default": "1F_SnkJWlZIKyhZArjC6Uex-109YmjVQ7nchU2MWJ0nk"
    }
  ],
  "result": null
}

Append data with session

{
  "type": "endpoint",
  "tool": {
    "type": "function",
    "function": {
      "name": "append_data_with_session",
      "description": "Capture data with the `column_name` and `value`",
      "parameters": {
        "type": "object",
        "properties": {
          "column_name": {
            "type": "string",
            "description": "Type of data being captured i.e. name, title etc"
          },
          "value": {
            "type": "string",
            "description": "Value of data being captured i.e. mohit, james etc"
          },
          "sheet_id": {
            "type": "string",
            "description": "the id of the spreadsheet to be used"
          },
          "sheet_range": {
            "type": "string",
            "description": "the sheet range which is typically Sheet1"
          }
        },
        "required": [
          "column_name",
          "value",
          "sheet_id",
          "sheet_range"
        ]
      }
    }
  },
  "endpoint": {
    "url": "http://gdrive-proxy-app/google/append-data-with-session",
    "method": "post",
    "argumentLocation": "body"
  },
  "defaults": {
    "session_id": "${vars.session.channel.id}"
  },
  "staticParameters": [],
  "result": null
}

Updating prompt to access tools

Now that we have our new custom tools, we can make them available to the prompt that we created earlier, so that any agents using that prompt will have access to the tools. We can do this on the prompt edit screen.

Navigate back to the Prompts screen, select your prompt and click Edit.

In the “Tools” dropdown, search for and add your new search_dealerships, create_form_from_session , and append_data_with_session tools as shown above.

You also need to update the text of the prompt itself so that it informs the LLM when and how to use the new tools. Once you’re done, click Save to save the prompt.