Skip to content

Commit

Permalink
Added descriptions of Message and Keyword agent components (#4512)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

### Type of change


- [x] Documentation Update
  • Loading branch information
writinwaters authored Jan 16, 2025
1 parent 4946e43 commit c0799c5
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 6 deletions.
10 changes: 6 additions & 4 deletions docs/references/agent_component_reference/categorize.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ slug: /categorize_component

The component that classifies user inputs and applies strategies accordingly.

> The **Categorize** component is usually the downstream of the **Interact** component.
---

The **Categorize** component is usually the downstream of the **Interact** component.

## Scenarios

Expand Down Expand Up @@ -91,12 +93,12 @@ Additional examples that may help the LLM determine which inputs belong in this
Examples are more helpful than the description if you want the LLM to classify particular cases into this category.
:::

#### To
#### 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.*
- 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

Expand Down
79 changes: 79 additions & 0 deletions docs/references/agent_component_reference/keyword.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
sidebar_position: 6
slug: /keyword_component
---

# Keyword component

A component that extracts keywords from a user query.

---

A **Keyword** component uses the specified LLM to extract keywords from a user query.

## Scenarios

A **Keyword** component is essential where you need to prepare keywords for a potential keyword search.

## Configurations

### Input

The **Keyword** 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.


### Model

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.
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.
- 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*.
- Defaults to 0.3.
- **Presence penalty**: Encourages the model to include a more diverse range of tokens in the response.
- A higher **presence penalty** value results in the model being more likely to generate tokens not yet been included in the generated text.
- Defaults to 0.4.
- **Frequency penalty**: Discourages the model from repeating the same words or phrases too frequently in the generated text.
- A higher **frequency penalty** value results in the model being more conservative in its use of repeated tokens.
- Defaults to 0.7.
- **Max tokens**: Sets the maximum length of the model's output, measured in the number of tokens.
- Defaults to 512.
- If disabled, you lift the maximum token limit, allowing the model to determine the number of tokens in its responses.

:::tip NOTE
- It is not necessary to stick with the same model for all components. If a specific model is not performing well for a particular task, consider using a different one.
- If you are uncertain about the mechanism behind **Temperature**, **Top P**, **Presence penalty**, and **Frequency penalty**, you can simply choose one of the three options of **Freedom**.
:::


### Number of keywords

An integer specifying the number of keywords to extract from the user query. Defaults to 3. Please note that the number of extracted keywords depends on the LLM's capabilities and the token count in the user query, and may *not* match the integer you set.


## Examples

Explore our general-purpose chatbot agent template, where the **Keyword** component (component ID: **keywords**) is used to extract keywords from financial inputs for a potential stock search in the **akshare** component:

1. Click the **Agent** tab at the top center of the page to access the **Agent** page.
2. Click **+ Create agent** on the top right of the page to open the **agent template** page.
3. On the **agent template** page, hover over the **General-purpose chatbot** card and click **Use this template**.
4. Name your new agent and click **OK** to enter the workflow editor.
5. Click on the **Keyword** component to display its **Configuration** window.
30 changes: 30 additions & 0 deletions docs/references/agent_component_reference/message.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
sidebar_position: 7
slug: /message_component
---

# Message component

A component that sends out a static message.

---

A **Message** component sends out a static message. If multiple messages are supplied, it randomly selects one to send.

## Configurations

### Messages

The message to send out.

Click **+ Add message** to add message options. When multiple messages are supplied, the **Message** component randomly selects one to send.

## Examples

Explore our customer service agent template, where the **Message** component (component ID: **What else?**) randomly sends out a message to the user interface if the user inputs is related to personal contact information:

1. Click the **Agent** tab at the top center of the page to access the **Agent** page.
2. Click **+ Create agent** on the top right of the page to open the **agent template** page.
3. On the **agent template** page, hover over the **Customer service** card and click **Use this template**.
4. Name your new agent and click **OK** to enter the workflow editor.
5. Click on the **Message** component to display its **Configuration** window.
2 changes: 1 addition & 1 deletion docs/references/agent_component_reference/retrieval.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ Explore our customer service agent template, where the **Retrieval** component (

1. Click the **Agent** tab at the top center of the page to access the **Agent** page.
2. Click **+ Create agent** on the top right of the page to open the **agent template** page.
3. On the **agent template** page, hover over the **Interperter** card and click **Use this template**.
3. On the **agent template** page, hover over the **Customer service** card and click **Use this template**.
4. Name your new agent and click **OK** to enter the workflow editor.
5. Click on the **Retrieval** component to display its **Configuration** window.
2 changes: 1 addition & 1 deletion web/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ This procedure will improve precision of retrieval by adding more information to
relevantDescription: `A component that uses the LLM to assess whether the upstream output is relevant to the user's latest query. Ensure you specify the next component for each judge result.`,
rewriteQuestionDescription: `A component that refines a user query if it fails to retrieve relevant information from the knowledge base. It repeats this process until the predefined looping upper limit is reached.`,
messageDescription:
"A component that sends out a static message. If multiple messages are supplied, it randomly selects one to send. Ensure its downstream is 'Answer', the interface component.",
"A component that sends out a static message. If multiple messages are supplied, it randomly selects one to send. Ensure its downstream is 'Interact', the interface component.",
keywordDescription: `A component that retrieves top N search results from user's input. Ensure the TopN value is set properly before use.`,
switchDescription: `A component that evaluates conditions based on the output of previous components and directs the flow of execution accordingly. It allows for complex branching logic by defining cases and specifying actions for each case or default action if no conditions are met.`,
wikipediaDescription: `A component that searches from wikipedia.org, using TopN to specify the number of search results. It supplements the existing knowledge bases.`,
Expand Down

0 comments on commit c0799c5

Please sign in to comment.