How to use Runchat workflows as tools
Agent
node.
Many language models are capable of structuring responses to match those required by external APIs or functions. This is called Function Calling.
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.
Agent
node to use as tools:
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.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.Google Maps Search
that uses the Google Maps
API to search for beaches nearby.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: