Runchat is a tool building platform. Anything you publish to a library in Runchat can be used automatically as a tool by language models in the Agent node. Many language models are capable of structuring responses to match those required by external APIs or functions. This is called Function Calling.

Function Calling

To use Function Calling, developers need to provide descriptions of each of the input parameters to a function in order for the language model to determine how to call the function and get the expected result. In Runchat, people create workflows using the Agent, Create, Code and Fetch nodes (or other Runchat nodes). These workflows might have lots and lots of input and output parameters. Developers select which parameters they want users to be able to change, and which outputs they want users to see after running the tool. These parameters are “published” by clicking the sun (☀) next to the parameter name. They then provide labels and descriptions to input parameters so that users can understand how these parameters work in published apps, and add the tool to a library so it can be accessed from the Node menu.

Agentic Tool Use

These same descriptions also help language models understand how to use Runchats as tools autonomously. The process for using runchat workflows in automatically as tools is as follows:
  • User publishes input parameters on a Runchat and adds labels and descriptions.
  • User installs this Runchat as a library. This could be the author, or anyone else.
  • The user specifies any tools they want to make available to the language model during a request
  • The language model automatically determines if one or more tools should be used to respond to the request
  • If a tool is required, the language model returns a response that provides values for all input parameters
  • Runchat takes these inputs, runs the node required, and returns the response to the language model
  • The language model then responds to the user’s request

An example: Should I go for a surf today?

This is an example of where calling multiple tools would be useful to respond to the users request. The language model doesn’t have any intrinsic knowledge of:
  • what the date is
  • what the weather is
  • what the nearest surf breaks are
To respond to this request, we could create several runchats for the Agent node to use as tools:
  • We could create a Runchat called Get Date that uses the Code node and just runs return Date(); - we could publish the inputs and outputs, add descriptions, and add the node to a library.
  • We could create another Runchat called Get Weather that uses the Fetch node to make a request to a weather api to get the current weather forecast at the user’s location. Again, we publish all the inputs, add descriptions and add the node to a library.
  • Finally, we could create a Runchat called Google Maps Search that uses the Google Maps API to search for beaches nearby.
Or, in this particular case, there are APIs around specifically for getting surf data. Some surf forecast websites even have publicly accessible APIs.
Then we create a Agent node and add Get Date, Get Weather and Google Maps Search to the tools. We ask for “Should I go for a surf today? I live in x” and, with a bit of luck, the language model figures out what it can use these three tools to get the information it needs to respond yes or no. The advantage of building these three particular tools is that they can be used for plenty of other things besides basic surfing encouragement. Our language model could now suggest:
  • Where to go for a walk today
  • What to wear today
  • How to get to x given the weather today
And so on. This is the power of function calling.