Build a reusable tool for converting collections of images to descriptive prompts
Agent
node from the menu and enter the following in the prompt:
Agent
node. There are several ways to import images into Runchat:
Inputs -> File or Image
nodesInputs -> Text
nodeContext
input of the Agent
node.
Context
input and click Each
to toggle the processing to Merge
. Now our prompt will be provided with the list of all images we have connected,
instead of one at a time.
Press play in the editor or node toolbar to run our Agent
node and see the resulting description.
Agent
node.
To publish a tool, we need to specify which inputs we want to receive data, and which outputs we want to return data.
When we publish an input or output, the UI for that input or output will be used to create a new node or app and all other inputs and outputs will be hidden.
Before publishing a tool, you should delete any nodes that will not be directly necessary to generate the output.
We will use a single Image input node as our tool input. This will mean that we can use the Image picker as our tool UI.
Keep one of your imported images and delete all of the rest. Hover over the input
parameter on the image and click the 🌞 Sun icon to publish it.
For language models (and people) to know what our tool does, we need to give this input a name and a description.
Hover over the input
parameter and double-click the black input
text to edit it. Change the name to images
.
Then click the edit button on the ‘images ✎’ label on the node and enter “Connect a collection of images to describe”.
Then hover over the Result
output parameter on our Agent
node and click the 🌞 Sun icon to publish the prompt output.
x
in the corner of the app view sidebar.
New Workflow
then choosing New Runchat
from the example grid.
Create a new Create -> Image
node with the Imagen 4 Fast model. Click on the variations button in the node settings and change this to 2.
Now double-click to show the node menu, and click the toggle to Show Tools.
Create a Describe Images
node from your My Tools library and connect the output to the prompt
input of your image node.
Drop in some images and connect them to your images
input to replace the default image that is referenced in the tool.
Press the Run button at the top of the editor toolbar to run our entire workflow using our new tool, describe our images and create a prompt,
and use this prompt to generate two new high quality images in a similar style.\
Describe Images
node to show all nodes in this tool and their inputs and
outputs during the last run.Context
of a Agent
node,
and then write a prompt that provides instructions for things to add. This is useful for controlling and directing the content.
Agent
node that can be run automatically by language models.
As an example, create a new Agent
node.
Click on the Tool icon in the node toolbar and search for “Describe Images” and find the tool we just created. Click on it to add it as a tool.
Now, if we connect some images to the context and just ask our prompt to “describe the images”, it will get used automatically!
Tools are especially useful for making requests to external resources like databases or third party APIs.
You can build tools in runchat for searching the web, reading and writing to spreadsheets, sending emails and just about anything else that you can think of.