Pre Configured Tools

  1. Rest API Template
  2. Webscraper Template
  3. Custom tool Template

Drafting your Tool Definition

  1. Name: Name you tool
  2. Description: Describe both what the function does, when it should be called, and what parameters are required to call the function
  3. Parameter Section: Define the JSON schema that should be outputted by the model when the model decides to make a function call.
    • The required properties will always provided by the model.

Drafting your Python Script**

  1. The arguments for your function should match up with the appropriate properties in your tool definition. These arguments should be listed in the requiered attribute under parameters
    • "required": ["url", "selector"]
  2. Only a single root function is allow
    • Nested Functions are allowed
  3. Outputs from previous nodes or variables can be passed in using standard variable naming convention
    • <?REPLACE_WITH_REF_NODE_ID?>
  4. Allowed functionality within Python Script:
    • Built-In Python Functions
      • int, str, isinstance, range, len, type, sum, round, ord, float, abs, min, max, all, any, sorted, enumerate, zip, filter, map, reversed, chr, divmod, pow, bin, hex, and oct
    • Supported Packages
      • json, requests, datetime, time, re, hashlib, bs4, typing, contextlib, decimal
      • NOTE: in order to use these packages, you will need to import them into your code i.e.
        • Code Example

          import requests
          from bs4 import BeautifulSoup
          
          def perform_web_scrape(url, selector, attribute=None):
              try:
                  response = requests.get(url)
                  soup = BeautifulSoup(response.text, 'html.parser')
                  element = soup.select_one(selector)
                  result = element.get(attribute) if attribute else element.text.strip()
                  return {
                      "status": "Success",
                      "data": result
                  }
          
              except Exception as e:
                  return {
                      "status": "Failure",
                      "error": str(e)
                  }
          
          

Sample Scenarios:

  • Enabling assistants to fetch data: an AI assistant needs to fetch the latest customer data from an internal system when a user asks “what are my recent orders?” before it can generate the response to the user
  • Enabling assistants to take actions: an AI assistant needs to schedule meetings based on user preferences and calendar availability.
  • Enabling assistants to perform computation: a math tutor assistant needs to perform a math computation.
  • Building rich workflows: a data extraction pipeline that fetches raw text, then converts it to structured data and saves it in a database.