writinwaters commited on
Commit
8d43c11
·
1 Parent(s): 85a7d1b

Added instructions on embedding agent or assistant into a third-party webpage (#4369)

Browse files

### What problem does this PR solve?


### Type of change

- [x] Documentation Update

docs/guides/agent/embed_agent_into_webpage.md ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ sidebar_position: 3
3
+ slug: /embed_agent_into_webpage
4
+ ---
5
+
6
+ # Embed agent into a webpage
7
+
8
+ You can use iframe to embed an agent into a third-party webpage.
9
+
10
+ 1. Before proceeding, you must [acquire an API key](https://ragflow.io/docs/dev/acquire_ragflow_api_key); otherwise, an error message would appear.
11
+ 2. On the **Agent** page, click an intended agent **>** **Edit** to access its editing page.
12
+ 3. Click **Embed into webpage** on the top right corner of the canvas to show the **iframe** window:
13
+
14
+ ![agent_embed](https://github.com/user-attachments/assets/f748bb91-1a48-45ca-89ea-5b1c257407cb)
15
+
16
+ 4. Copy the iframe and embed it into a specific location on your webpage.
docs/guides/agent/text2sql_agent.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- sidebar_position: 3
3
  slug: /text2sql_agent
4
  ---
5
 
@@ -9,7 +9,7 @@ Build a Text2SQL agent leverging RAGFlow's RAG capabilities. Contributed by @Tes
9
 
10
  ## Scenario
11
 
12
- 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:
13
 
14
  - **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.
15
 
@@ -31,7 +31,7 @@ However, traditional Text2SQL solutions often require model fine-tuning, which c
31
 
32
  A list of components required:
33
 
34
- - Begin
35
  - Interface
36
  - Retrieval
37
  - Generate
 
1
  ---
2
+ sidebar_position: 10
3
  slug: /text2sql_agent
4
  ---
5
 
 
9
 
10
  ## Scenario
11
 
12
+ The Text2SQL agent bridges the gap between Natural Language Processing (NLP) and Structured Query Language (SQL). Its key advantages are as follows:
13
 
14
  - **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.
15
 
 
31
 
32
  A list of components required:
33
 
34
+ - [Begin](https://ragflow.io/docs/dev/begin_component)
35
  - Interface
36
  - Retrieval
37
  - Generate
docs/guides/run_health_check.md CHANGED
@@ -3,7 +3,7 @@ sidebar_position: 7
3
  slug: /run_health_check
4
  ---
5
 
6
- # Run health check on RAGFlow's dependencies
7
 
8
  Double-check the health status of RAGFlow's dependencies.
9
 
 
3
  slug: /run_health_check
4
  ---
5
 
6
+ # Run dependency health check
7
 
8
  Double-check the health status of RAGFlow's dependencies.
9
 
docs/guides/start_chat.md CHANGED
@@ -57,7 +57,7 @@ You start an AI conversation by creating an assistant.
57
 
58
  :::tip NOTE
59
 
60
- Click the light bubble logo above the answer to view the expanded system prompt:
61
 
62
  ![](https://github.com/user-attachments/assets/515ab187-94e8-412a-82f2-aba52cd79e09)
63
 
@@ -74,10 +74,19 @@ Hover over an intended chat assistant **>** **Edit** to show the chat configurat
74
 
75
  ![chat_config](https://github.com/user-attachments/assets/1a4eaed2-5430-4585-8ab6-930549838c5b)
76
 
77
- ## Integrate chat capabilities into your application
78
 
79
- RAGFlow also offers HTTP and Python APIs for you to integrate RAGFlow's capabilities into your applications. Read the following documents for more information:
80
 
81
- - [Acquire a RAGFlow API key](./develop/acquire_ragflow_api_key.md)
82
- - [HTTP API reference](../references/http_api_reference.md)
83
- - [Python API reference](../references/python_api_reference.md)
 
 
 
 
 
 
 
 
 
 
57
 
58
  :::tip NOTE
59
 
60
+ Click the light bubble icon above the answer to view the expanded system prompt:
61
 
62
  ![](https://github.com/user-attachments/assets/515ab187-94e8-412a-82f2-aba52cd79e09)
63
 
 
74
 
75
  ![chat_config](https://github.com/user-attachments/assets/1a4eaed2-5430-4585-8ab6-930549838c5b)
76
 
77
+ ## Integrate chat capabilities into your application or webpage
78
 
79
+ RAGFlow offers HTTP and Python APIs for you to integrate RAGFlow's capabilities into your applications. Read the following documents for more information:
80
 
81
+ - [Acquire a RAGFlow API key](https://ragflow.io/docs/dev/acquire_ragflow_api_key)
82
+ - [HTTP API reference](https://ragflow.io/docs/dev/http_api_reference)
83
+ - [Python API reference](https://ragflow.io/docs/dev/python_api_reference)
84
+
85
+ You can use iframe to embed the created chat assistant into a third-party webpage:
86
+
87
+ 1. Before proceeding, you must [acquire an API key](https://ragflow.io/docs/dev/acquire_ragflow_api_key); otherwise, an error message would appear.
88
+ 2. Hover over an intended chat assistant **>** **Edit** to show the **iframe** window:
89
+
90
+ ![chat-embed](https://github.com/user-attachments/assets/13ea3021-31c4-4a14-9b32-328cd3318fb5)
91
+
92
+ 3. Copy the iframe and embed it into a specific location on your webpage.
docs/references/agent_component_reference/begin.mdx CHANGED
@@ -41,7 +41,7 @@ You can set global variables within the **Begin** component, which can be either
41
  - **line**: Accepts a single line of text without line breaks.
42
  - **paragraph**: Accepts multiple lines of text, including line breaks.
43
  - **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.
44
- - **file**: Requires the user to upload one or multiple files from their device.
45
  - **integer**: Accepts an integer as input.
46
  - **boolean**: Requires the user to toggle between on and off.
47
  - **Optional**: A toggle indicating whether the variable is optional.
@@ -62,9 +62,13 @@ As mentioned earlier, the **Begin** component is indispensable for an agent. Sti
62
 
63
  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.
64
 
65
- ### File size limit for uploaded file
66
 
67
- 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.
 
 
68
 
 
69
 
 
70
 
 
41
  - **line**: Accepts a single line of text without line breaks.
42
  - **paragraph**: Accepts multiple lines of text, including line breaks.
43
  - **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.
44
+ - **file**: Requires the user to upload one or multiple files.
45
  - **integer**: Accepts an integer as input.
46
  - **boolean**: Requires the user to toggle between on and off.
47
  - **Optional**: A toggle indicating whether the variable is optional.
 
62
 
63
  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.
64
 
65
+ ### How to upload a webpage or file from a URL?
66
 
67
+ If you set the type of a variable as **file**, your users will be able to upload a file either from their local device or from an accessible URL. For example:
68
+
69
+ ![upload_file](https://github.com/user-attachments/assets/7ad2a352-0807-4b74-b8d1-d09e5cd37997)
70
 
71
+ ### File size limit for an uploaded file
72
 
73
+ 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.
74
 
docs/references/http_api_reference.md CHANGED
@@ -1726,7 +1726,7 @@ Creates a session with a chat assistant.
1726
  - `'Authorization: Bearer <YOUR_API_KEY>'`
1727
  - Body:
1728
  - `"name"`: `string`
1729
- - `"user_id"`: `string`(optional)
1730
 
1731
  ##### Request example
1732
 
@@ -1801,7 +1801,7 @@ Updates a session of a specified chat assistant.
1801
  - `'Authorization: Bearer <YOUR_API_KEY>'`
1802
  - Body:
1803
  - `"name`: `string`
1804
- - `"user_id`: `string`(optional)
1805
 
1806
  ##### Request example
1807
 
@@ -2013,8 +2013,8 @@ Asks a specified chat assistant a question to start an AI-powered conversation.
2013
  - Body:
2014
  - `"question"`: `string`
2015
  - `"stream"`: `boolean`
2016
- - `"session_id"`: `string`(optional)
2017
- - `"user_id`: `string`(optional)
2018
 
2019
  ##### Request example
2020
 
 
1726
  - `'Authorization: Bearer <YOUR_API_KEY>'`
1727
  - Body:
1728
  - `"name"`: `string`
1729
+ - `"user_id"`: `string` (optional)
1730
 
1731
  ##### Request example
1732
 
 
1801
  - `'Authorization: Bearer <YOUR_API_KEY>'`
1802
  - Body:
1803
  - `"name`: `string`
1804
+ - `"user_id`: `string` (optional)
1805
 
1806
  ##### Request example
1807
 
 
2013
  - Body:
2014
  - `"question"`: `string`
2015
  - `"stream"`: `boolean`
2016
+ - `"session_id"`: `string` (optional)
2017
+ - `"user_id`: `string` (optional)
2018
 
2019
  ##### Request example
2020
 
web/src/locales/en.ts CHANGED
@@ -22,7 +22,7 @@ export default {
22
  languagePlaceholder: 'select your language',
23
  copy: 'Copy',
24
  copied: 'Copied',
25
- comingSoon: 'Coming Soon',
26
  download: 'Download',
27
  close: 'Close',
28
  preview: 'Preview',
@@ -428,7 +428,7 @@ The above is the content you need to summarize.`,
428
  created: 'Created',
429
  action: 'Action',
430
  embedModalTitle: 'Embed into webpage',
431
- comingSoon: 'Coming Soon',
432
  fullScreenTitle: 'Full Embed',
433
  fullScreenDescription:
434
  'Embed the following iframe into your website at the desired location',
 
22
  languagePlaceholder: 'select your language',
23
  copy: 'Copy',
24
  copied: 'Copied',
25
+ comingSoon: 'Coming soon',
26
  download: 'Download',
27
  close: 'Close',
28
  preview: 'Preview',
 
428
  created: 'Created',
429
  action: 'Action',
430
  embedModalTitle: 'Embed into webpage',
431
+ comingSoon: 'Coming soon',
432
  fullScreenTitle: 'Full Embed',
433
  fullScreenDescription:
434
  'Embed the following iframe into your website at the desired location',