mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-14 06:55:56 +08:00
Initial draft of the begin component reference (#4272)
### What problem does this PR solve? ### Type of change - [x] Documentation Update
This commit is contained in:
parent
7773afa561
commit
8cdf10148d
@ -85,7 +85,7 @@
|
||||
},
|
||||
"5. chitchatting": {
|
||||
"description": "Regarding the issues of small talk, companionship, sharing, and emotional intimacy.",
|
||||
"examples": "What's your name?\nAre you female o male.\nWhat a bad day!\nTerrible day.\nHow are you today?\nDo you have boy friend?",
|
||||
"examples": "What's your name?\nWhat a bad day!\nTerrible day.\nHow are you today?",
|
||||
"to": "Generate:FiveDragonsLay"
|
||||
}
|
||||
},
|
||||
@ -637,7 +637,7 @@
|
||||
},
|
||||
"5. chitchatting": {
|
||||
"description": "Regarding the issues of small talk, companionship, sharing, and emotional intimacy.",
|
||||
"examples": "What's your name?\nAre you female o male.\nWhat a bad day!\nTerrible day.\nHow are you today?\nDo you have boy friend?",
|
||||
"examples": "What's your name?\nWhat a bad day!\nTerrible day.\nHow are you today?",
|
||||
"to": "Generate:FiveDragonsLay"
|
||||
}
|
||||
},
|
||||
|
@ -4,8 +4,11 @@ slug: /text2sql_agent
|
||||
---
|
||||
|
||||
# Create a Text2SQL agent
|
||||
|
||||
Build a Text2SQL agent leverging RAGFlow's RAG capabilities. Contributed by @TeslaZY.
|
||||
|
||||
## Scenario
|
||||
|
||||
The Text2SQL agent is designed to bridge the gap between Natural Language Processing (NLP) and Structured Query Language (SQL). Its key advantages are as follows:
|
||||
|
||||
- **Assisting non-technical users with SQL**: Not all users have a background in SQL or understand the structure of the tables involved in queries. With a Text2SQL agent, users can pose questions or request data in natural language without needing an in-depth knowledge of the database structure or SQL syntax.
|
||||
@ -35,9 +38,11 @@ A list of components required:
|
||||
- ExeSQL
|
||||
|
||||
## Procedure
|
||||
|
||||
### Preparation of Data
|
||||
|
||||
#### Database Environment
|
||||
|
||||
Mysql-8.0.39
|
||||
|
||||
#### Database Table Creation Statements
|
||||
@ -261,7 +266,9 @@ CREATE TABLE OrderDetails (
|
||||

|
||||
|
||||
#### Configure DB_Description Knowledge Base
|
||||
|
||||
1. the content of the DB_Description text is as follows:
|
||||
2.
|
||||
```markdown
|
||||
### Customers (Customer Information Table)
|
||||
The Customers table records detailed information about different customers in the online store. Here is the meaning of each field within this table:
|
||||
@ -294,6 +301,7 @@ The OrderDetails table provides detailed information about each item in an order
|
||||
- Quantity: The number of units of the product ordered.
|
||||
- TotalPrice: The total price for this particular item in the order, calculated as UnitPrice * Quantity.
|
||||
```
|
||||
|
||||
2. set the chunk data for the DB_Description knowledge base
|
||||

|
||||
#### Configure Q->SQL Knowledge Base
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"label": "Agent Component Reference",
|
||||
"position": 1,
|
||||
"position": 3,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"description": "A complete reference for RAGFlow's agent components."
|
70
docs/references/agent_component_reference/begin.mdx
Normal file
70
docs/references/agent_component_reference/begin.mdx
Normal file
@ -0,0 +1,70 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
slug: /begin_component
|
||||
---
|
||||
|
||||
# Begin component
|
||||
|
||||
The starting component in a workflow.
|
||||
|
||||
---
|
||||
|
||||
The **Begin** component sets an opening greeting or accepts inputs from the user. It is automatically populated onto the canvas when you create an agent, whether from a template or from scratch (from a blank template). There should be only one **Begin** component in the workflow.
|
||||
|
||||
## Scenarios
|
||||
|
||||
A **Begin** component is essential in all cases. Every agent includes a **Begin** component, which cannot be deleted.
|
||||
|
||||
## Configurations
|
||||
|
||||
Click the component to display its **Configuration** window. Here, you can set an opening greeting and the input parameters (global variables) for the agent.
|
||||
|
||||
### ID
|
||||
|
||||
The ID is the unique identifier for the component within the workflow. Unlike the IDs of other components, the ID of the **Begin** component *cannot* be changed.
|
||||
|
||||
### Opening greeting
|
||||
|
||||
An opening greeting is the agent's first message to the user. It can be a welcoming remark or an instruction to guide the user forward.
|
||||
|
||||
### Global variables
|
||||
|
||||
You can set global variables within the **Begin** component, which can be either required or optional. Once established, users will need to provide values for these variables when interacting or with the agent. Click **+ Add variable** to add a global variable, each with the following attributes:
|
||||
|
||||
- **Key**: *Required*
|
||||
The unique variable name.
|
||||
- **Name**: *Required*
|
||||
A descriptive name providing additional details about the variable.
|
||||
For example, if **Key** is set to `lang`, you can set its **Name** to `Target language`.
|
||||
- **Type**: *Required*
|
||||
The type of the variable:
|
||||
- **line**: Accepts a single line of text without line breaks.
|
||||
- **paragraph**: Accepts multiple lines of text, including line breaks.
|
||||
- **options**: Requires the user to select a value for this variable from a dropdown menu. And you are required to set *at least* one option for the dropdown menu.
|
||||
- **file**: Requires the user to upload a file from their device.
|
||||
- **integer**: Accepts an integer as input.
|
||||
- **boolean**: Requires the user to toggle between on and off.
|
||||
- **Optional**: A toggle indicating whether the variable is optional.
|
||||
|
||||
## Examples
|
||||
|
||||
As mentioned earlier, the **Begin** component is indispensable for an agent. Still, you can take a look at our three-step interpreter agent, where the **Begin** component takes two global variables:
|
||||
|
||||
1. Click the **Agent** tab in the middle top of the page to show the **Agent** page.
|
||||
2. Click **+ Create agent** on the top right of the page to show the **agent template** page.
|
||||
3. On the **agent template** page, hover over the card on **Interperter** and click **Use this template**.
|
||||
4. Name the new agent and click **OK** to enter the workflow editor.
|
||||
5. Click the **Begin** component to display its **Configuration** window.
|
||||
|
||||
## Frequently asked questions
|
||||
|
||||
### Is the uploaded file in a knowledge base?
|
||||
|
||||
No. Files uploaded to an agent as input are not stored in a knowledge base and will not be chunked using RAGFlow's built-in chunk methods. However, RAGFlow's built-in OSR, DLR, and TSR models will still be applied to process the document.
|
||||
|
||||
### File size limit for uploaded file
|
||||
|
||||
The maximum file size for each uploaded file is determined by the variable `MAX_CONTENT_LENGTH` in `/docker/.env`. It defaults to 128 MB. If you change the default file size, ensure you also update the value of `client_max_body_size` in `/docker/nginx/nginx.conf` accordingly.
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
sidebar_position: 10
|
||||
slug: /faq
|
||||
---
|
||||
|
||||
|
@ -21,6 +21,7 @@ Released on December 25, 2024.
|
||||
This release fixes the following issues:
|
||||
|
||||
- The `SCORE not found` and `position_int` errors returned by [Infinity](https://github.com/infiniflow/infinity).
|
||||
- Once an embedding model in a specific knowledge base is changed, embedding models in other knowledge bases can no longer be changed.
|
||||
- Slow response in question-answering and AI search due to repetitive loading of the embedding model.
|
||||
- Fails to parse documents with RAPTOR.
|
||||
- Using the **Table** parsing method results in information loss.
|
||||
|
@ -350,7 +350,7 @@ The above is the content you need to summarize.`,
|
||||
language: 'Language',
|
||||
emptyResponse: 'Empty response',
|
||||
emptyResponseTip: `Set this as a response if no results are retrieved from the knowledge bases for your query, or leave this field blank to allow the LLM to improvise when nothing is found.`,
|
||||
setAnOpener: 'Set an opener',
|
||||
setAnOpener: 'Opening greeting',
|
||||
setAnOpenerInitial: `Hi! I'm your assistant, what can I do for you?`,
|
||||
setAnOpenerTip: 'Set an opening greeting for users.',
|
||||
knowledgeBases: 'Knowledge bases',
|
||||
@ -677,7 +677,7 @@ The above is the content you need to summarize.`,
|
||||
msg: 'Messages',
|
||||
messagePlaceholder: 'message',
|
||||
messageMsg: 'Please input message or delete this field.',
|
||||
addField: 'Add field',
|
||||
addField: 'Add option',
|
||||
addMessage: 'Add message',
|
||||
loop: 'Loop',
|
||||
loopTip:
|
||||
|
@ -55,7 +55,7 @@ const BeginDynamicOptions = () => {
|
||||
icon={<PlusOutlined />}
|
||||
block
|
||||
>
|
||||
Add field
|
||||
Add option
|
||||
</Button>
|
||||
<Form.ErrorList errors={errors} />
|
||||
</Form.Item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user