Tool Calling
Tool Calling is natively included into the following Model Providers: OpenAi. With Tool Calling your model will follow the ReACT Fraemwork and act as a resaosning agent calling the appropriate tool
Pre Configured Tools
- Rest API Template
- Webscraper Template
- Custom tool Template
Drafting your Tool Definition
- Name: Name you tool
- Description: Describe both what the function does, when it should be called, and what parameters are required to call the function
- 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**
- 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"]
- Only a single root function is allow
- Nested Functions are allowed
- Outputs from previous nodes or variables can be passed in using standard variable naming convention
<?REPLACE_WITH_REF_NODE_ID?>
- 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
-
- Built-In Python Functions
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.