Categorize
A component that classifies user inputs and applies strategies accordingly.
A Categorize component is usually the downstream of the Interact component.
Scenarios
Section titled “Scenarios”A Categorize component is essential when you need the LLM to help you identify user intentions and apply appropriate processing strategies.
Configurations
Section titled “Configurations”The Categorize component relies on input variables to specify its data inputs (queries). Click + Add variable in the Input section to add the desired input variables. There are two types of input variables: Reference and Text.
- Reference: Uses a component’s output or a user input as the data source. You are required to select from the dropdown menu:
- A component ID under Component Output, or
- A global variable under Begin input, which is defined in the Begin component.
- Text: Uses fixed text as the query. You are required to enter static text.
Click the dropdown menu of Model to show the model configuration window.
- Model: The chat model to use.
- Ensure you set the chat model correctly on the Model providers page.
- You can use different models for different components to increase flexibility or improve overall performance.
- Freedom: A shortcut to Temperature, Top P, Presence penalty, and Frequency penalty settings, indicating the freedom level of the model. From Improvise, Precise, to Balance, each preset configuration corresponds to a unique combination of Temperature, Top P, Presence penalty, and Frequency penalty.
This parameter has three options:
- Improvise: Produces more creative responses.
- Precise: (Default) Produces more conservative responses.
- Balance: A middle ground between Improvise and Precise.
- Temperature: The randomness level of the model’s output. Defaults to 0.1.
- Lower values lead to more deterministic and predictable outputs.
- Higher values lead to more creative and varied outputs.
- A temperature of zero results in the same output for the same prompt.
- Top P: Nucleus sampling. Defaults to 0.3.
- Reduces the likelihood of generating repetitive or unnatural text by setting a threshold P and restricting the sampling to tokens with a cumulative probability exceeding P.
- Presence penalty: Encourages the model to include a more diverse range of tokens in the response. Defaults to 0.4.
- A higher presence penalty value results in the model being more likely to generate tokens not yet included in the generated text.
- Frequency penalty: Discourages the model from repeating the same words or phrases too frequently. Defaults to 0.7.
- A higher frequency penalty value results in the model being more conservative in its use of repeated tokens.
Message window size
Section titled “Message window size”An integer specifying the number of previous dialogue rounds to input into the LLM. For example, if it is set to 12, the tokens from the last 12 dialogue rounds will be fed to the LLM. This feature consumes additional tokens.
Defaults to 1.
Category name
Section titled “Category name”A Categorize component must have at least two categories. This field sets the name of the category. Click + Add Item to include the intended categories.
Description
Section titled “Description”Description of this category. You can input criteria, situation, or information that may help the LLM determine which inputs belong in this category.
Examples
Section titled “Examples”Additional examples that may help the LLM determine which inputs belong in this category.
Next step
Section titled “Next step”Specifies the downstream component of this category.
- Once you specify the ID of the downstream component, a link is established between this category and the corresponding component.
- If you manually link this category to a downstream component on the canvas, the ID of that component is auto-populated.
Examples
Section titled “Examples”You can explore our customer service agent template, where a Categorize component (component ID: Question Categorize) has four defined categories and takes data inputs from an Interact component (component ID: Interface):
-
Click the Agent tab at the top center of the page to access the Agent page.
-
Click + Create agent on the top right of the page to open the agent template page.
-
On the agent template page, hover over the Customer service card and click Use this template.
-
Name your new agent and click OK to enter the workflow editor.