GITBOOK-1: Integrated configuration of Notion-English

pull/13/head
潘辉燕 2023-09-05 14:58:43 +00:00 committed by gitbook-bot
parent f04ab10a94
commit e22f8e18d4
No known key found for this signature in database
GPG Key ID: 07D2180C7B12D0FF
11 changed files with 53 additions and 39 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 KiB

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 420 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 193 KiB

View File

@ -40,7 +40,6 @@
* [Datasets\&Index](advanced/datasets/README.md)
* [Sync from Notion](advanced/datasets/sync-from-notion.md)
* [Dataset of QA model](advanced/datasets/dataset-of-qa-model.md)
* [Plugins](advanced/ai-plugins.md)
* [Based on WebApp Template](advanced/based-on-frontend-templates.md)
* [Model Configuration](advanced/model-configuration/README.md)

View File

@ -1,21 +0,0 @@
---
description: QAmodeldataset
---
# Dataset of QA model
**The Q\&A paragraph mode feature is different from the normal "Q2P" (question matches paragraph content) matching mode. The "Q2Q" (question matches question) matching mode means that when a user asks a question, the system will find the most similar question to it, and then return the corresponding paragraph as the answer. This method is more precise, because it directly matches the user's question, and can more accurately obtain the information that the user really needs.**
<figure><img src="../../.gitbook/assets/image (63).png" alt=""><figcaption></figcaption></figure>
1. QA dataset is created by summarizing each paragraph in a document and generating QA pairs from the summaries. This process summarizes the information in each paragraph and breaks it down to extract valuable insights for the user.
<figure><img src="../../.gitbook/assets/image (65).png" alt=""><figcaption></figcaption></figure>
<figure><img src="../../.gitbook/assets/image (67).png" alt=""><figcaption></figcaption></figure>
2. At the same time, we support custom additions and modifications to the segmentation. Users can dynamically adjust their own segmentation information to make your dataset more precise.
![](<../../.gitbook/assets/image (68).png>)![](<../../.gitbook/assets/image (69).png>)
3. The problem text has a complete syntactic structure of natural language, rather than some keywords in a document retrieval task. Therefore, matching Q to Q makes the semantics and matching clearer while satisfying some high-frequency and high-similarity question scenarios.

View File

@ -5,7 +5,7 @@ Dify dataset supports importing from Notion and setting up **Sync** so that data
### Authorization verification
1. When creating a dataset, select the data source, click **Sync from Notion--Go to connect**, and complete the authorization verification according to the prompt.
2. You can also: click **Settings--Data Sources--Add a Data Source**, click Notion Source **Connect** to complete authorization verification.
2. You can also: click **Settings--Data Sources--Add a Data Source**, click Notion Source **Connect** to complete authorization verification.
<figure><img src="../../.gitbook/assets/notion-connect.png" alt=""><figcaption><p>Connect Notion</p></figcaption></figure>
@ -24,3 +24,51 @@ _**Note: Images and files are not currently supported for import. Table data wil
If your Notion content has been modified, you can click Sync directly on the Dify dataset document list page to sync the data with one click(Please note that each time you click, the current content will be synchronized). This step requires token consumption.
<figure><img src="../../.gitbook/assets/sync-notion-data.png" alt=""><figcaption><p>Sync Notion data</p></figcaption></figure>
### (Community Edition) Notion Integration Configuration Guide
Notion integration is divided into two ways: **internal integration** and **public integration** . It can be configured in Dify on demand.
For the specific differences between the two integration methods, please refer to the [official doc of Notion](https://developers.notion.com/docs/authorization).
#### 1. **Use internal integration**
Create an integration in your [integration's settings](https://www.notion.so/my-integrations) page. By default, all integrations start with an internal integration; internal integrations will be associated with a workspace of your choice, so you need to be the workspace owner to create an integration.
**Specific operation steps:**
Click the " **New integration** " button, the type is Internal by default (cannot be modified), select the associated space, enter the name and upload the logo, and click "**Submit**" to create the integration successfully.
<figure><img src="../../.gitbook/assets/image.png" alt=""><figcaption></figcaption></figure>
Once the integration is created, you can update its settings as needed under the **Capabilities** tab and click the "**Show**" button under **Secrets** and then copy the Secrets.
<figure><img src="../../.gitbook/assets/image (1).png" alt=""><figcaption></figcaption></figure>
Copy it and back to the Dify source code , in the **.env** file configuration related environment variables, environment variables as follows:
**NOTION\_INTEGRATION\_TYPE** = public
**NOTION\_INTERNAL\_SECRET**=you-internal-secret
#### 2. **Use public integration**
**You need to upgrade the internal integration to public integration** , navigate to the integrated Distribution page, and toggle the switch to expose the integration.
To toggle the switch to public settings, you need to **fill in additional information in the Organization Information** form below, including your company name, website, and Retargeting URL, and click the "Submit" button.
<figure><img src="../../.gitbook/assets/image (2).png" alt=""><figcaption></figcaption></figure>
After your integration has been successfully made public in your [integrations settings page](https://www.notion.so/my-integrations), you will be able to access the integrations secrets in the Secrets tab.
<figure><img src="../../.gitbook/assets/image (3).png" alt=""><figcaption></figcaption></figure>
Back to the Dify source code , in the **.env** file configuration related environment variables , environment variables as follows:
**NOTION\_INTEGRATION\_TYPE**=public&#x20;
**NOTION\_CLIENT\_SECRET**=you-client-secret&#x20;
**NOTION\_CLIENT\_ID**=you-client-id
Once configured, you will be able to utilize Notion data import and sync functions in the dataset section.

View File

@ -20,13 +20,11 @@ Click the "Create Application" button on the homepage to create an application.
#### Step 2: Compose the Application
After the application is successfully created, it will automatically redirect to the application overview page. Click on the left-hand menu: “**Prompt Eng.**” to compose the application.
After the application is successfully created, it will automatically redirect to the application overview page. Click on the left-hand menu: “**Prompt Eng.**” to compose the application.
<figure><img src="../../.gitbook/assets/image (2).png" alt=""><figcaption></figcaption></figure>
<figure><img src="../../.gitbook/assets/image (2) (1).png" alt=""><figcaption></figcaption></figure>
**2.1 Fill in Prompts**
**2.1 Fill in Prompts**
Prompts are used to give a series of instructions and constraints to the AI response. Form variables can be inserted, such as `{{input}}`. The value of variables in the prompts will be replaced with the value filled in by the user.
@ -38,8 +36,6 @@ The prompt we are filling in here is:
![](<../../.gitbook/assets/image (38).png>)
For a better experience, we will add an opening dialogue: `"Hello, {{name}}. I'm your interviewer, Bob. Are you ready?"`
To add the opening dialogue, click the "Add Feature" button in the upper left corner, and enable the "Conversation remarkers" feature:
@ -50,16 +46,12 @@ And then edit the opening remarks:
![](<../../.gitbook/assets/image (15).png>)
**2.2 Adding Context**
If an application wants to generate content based on private contextual conversations, it can use our [dataset](../../advanced/datasets/) feature. Click the "Add" button in the context to add a dataset.
![](<../../.gitbook/assets/image (9).png>)
**2.3 Debugging**
We fill in the user input on the right side and debug the input content.
@ -72,8 +64,6 @@ If the results are not satisfactory, you can adjust the prompts and model parame
We support the GPT-4 model.
**2.4 Publish**
After debugging the application, click the **"Publish"** button in the upper right corner to save the current settings.
@ -84,6 +74,4 @@ On the overview page, you can find the sharing address of the application. Click
<figure><img src="../../.gitbook/assets/image (47).png" alt=""><figcaption></figcaption></figure>
If you want to customize the application that you share, you can Fork our open source [WebApp template](https://github.com/langgenius/webapp-conversation). Based on the template, you can modify the application to meet your specific needs and style requirements.

View File

@ -94,7 +94,7 @@ _I want you to act as an IT Expert in my Notion workspace, using your knowledge
It's recommended to initially enable the AI to actively furnish the users with a starter sentence, providing a clue as to what they can ask. Furthermore, activating the 'Speech to Text' feature can allow users to interact with your AI assistant using their voice.
<figure><img src="../.gitbook/assets/image (3).png" alt=""><figcaption></figcaption></figure>
<figure><img src="../.gitbook/assets/image (3) (1).png" alt=""><figcaption></figcaption></figure>
Finally, Click the "Publish" button on the top right of the page. Now you can click the public URL in the "Overview" section to converse with your personalized AI assistant!