Tool steps - Get started
Analysis steps applied to the provided data
Tool steps are analysis components that are applied to the provided input in a Tool. For example,
- A LLM step to summarize an input text
- An PDF-to-Text step to extract the text from and uploaded PDF file
- A Javascript step to run a code snippet
Relevance support variety analysis steps with all the requirement all taken care of. All you need to do is to add the suitable step component to your Tool.
Creating a Tool and adding Tool steps
The easiest way to get started with creating a tool is to start at the
Tools page.
Once on the page, click on + Create tool
on the top right of the page.
You will be presented with an empty state where you can:
- add knowledge
- add inputs
- add Tool steps
- access some video tutorials
In the next pages, we will learn about all the supported Tool steps on Relevance.
Tips:
- Each step has a set of inputs, with some visible under “Advanced options”. These inputs are used to configure the step. You can either specify the value or switch to variable mode by pressing "" next to each input. This will instead set the value to the variable you reference.
- Each step will have a set of outputs. These are the values that will be passed on to the next step. You can configure the outputs by pressing “Configure output” and selecting the variable names you want to keep.
- Each step has a variable name, shown in green on the tool, which is used to reference the step and access the output in other steps. For example, you can use
{{steps.step_name.output.variable_name}}
to reference it. It can be changed just like the inputs. - The order of a step can be changed using the drag indicator or the up and down buttons. Steps can be ran individually, which is helpful for testing, by pressing the play icon.
General Tool step features
Run a step
Click on the run/play button on the top right of the step to execute it. Results will be displayed under the tool.
Note that there are two options available:
- Only run the step
- Rerun from the top including the current step
Delete a step
Click on the three dot menu located on the top right and select Delete from the menu.
This will remove the step completely from your Tool.
If you have used the output of a deleted step in any other steps as a variable, don't forget to remove the variable referral or it will cause a runtime error.
Output configuration
Click on the Output
button on the top right of the step and you can see what outputs have already been configured.
- Removal of an output can be done via the
x
on the bottom right of each output - Modification of the output name can be done via changing the output variable name shown under the box on the left
- Adding new output key can be done via clicking on the
+ Add new output key
located under the last output key - Access to variables are via
{{Name-of-the-available-variable}}
, for instance{{transformed}}
More details are available at Output Configuration.
Set default values
If you wish to set a default value for a component or change an existing default value, you need to
Saving the changes from the top right of your Tool will not change the default values! You need to explicitly configure the default values on a step.
- Type in the desired value
- Click on the setting wheel icon located on the bottom right of the step
- Click on "Set the current value
Move a step in a Tool
Move a step in a Tool
If you wish to relocate a step (i.e. moving it further to the top or bottom of your Tool), simply hover over to the right side of the tool and you will see the "Drag and Drop" icon appearing. Click and move the step to the desired location.
Move a step in a Tool
Duplicate an existing step
Click on the three dot menu located on the top right and select Duplicate from the menu.
This will create a copy of the existing step and add it to your Tool.
Run a step if a condition is met
If you wish to run a step, only when a condition is met, click on the three dot menu located on the top right and select Add conditions from the menu.
Conditions must follow JavaScript rules and be written in {{}}
. For instance,
{{text==="XYZ"}}
--> the variable calledtext
is equal toXYZ
{{text!=="XYZ"}}
--> the variable calledtext
is not equal toXYZ
{{clean.transformed===""}}
--> the output of a code step calledclean
is an empty string
More details are available at Conditions
Run a step multiple times in a loop
If you wish to run a step multiple times, click on the three dot menu located on the top right and select Enable foreach from the menu.
Imagine there is a list of movie names and you wish to run a large language model on each item to generate a summary.
After enabling Foreach, under Run this transformation multiple times
, provide the list of items on which the loop should work.
Next, use {{foreach.item}}
to access each of the elements in your input list.
Screenshot of the Loop input in a step
More details are available at Loops.
Was this page helpful?