mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-03-26 13:18:34 +07:00
Update build-an-notion-ai-assistant.mdx (#410)
* Update build-an-notion-ai-assistant.mdx * Docs tools: Successfully completed 3 operations
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
"light": "https://assets-docs.dify.ai/2025/05/d05cfc6ebe48f725d171dc71c64a5d16.svg",
|
||||
"dark": "https://assets-docs.dify.ai/2025/05/c51f1cda47c1d9a4a162d7736f6e4c53.svg"
|
||||
},
|
||||
|
||||
"navigation": {
|
||||
"versions": [
|
||||
{
|
||||
|
||||
@@ -64,3 +64,13 @@ Fill in the following configuration:
|
||||
|
||||
Your Dify workspace is now integrated with TrueFoundry's AI Gateway and ready for building AI applications, workflows, and agents.
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
---
|
||||
|
||||
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/development/models-integration/truefoundry.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
|
||||
|
||||
|
||||
@@ -116,7 +116,6 @@ Agent 节点执行过程中将生成详细日志。显示节点执行的总体
|
||||
* 将 `numResults` 固定为 5,控制每次返回结果数量。
|
||||
* 其他如过滤条件参数也可固定,以保证结果一致性。
|
||||
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
|
||||
@@ -49,31 +49,31 @@ Notion 是一个强大的知识管理工具。它的灵活性和可扩展性使
|
||||
|
||||
选择你要和 Dify 同步的页面,然后点击“允许访问”按钮。
|
||||
|
||||

|
||||

|
||||
|
||||
#### 4. 开始训练 <a href="#id-4-start-training" id="id-4-start-training"></a>
|
||||
|
||||
指定需要让 AI 学习的页面,使其能够理解 Notion 中这个部分的内容。然后点击 "下一步" 按钮。
|
||||
|
||||

|
||||

|
||||
|
||||
我们建议选择 "自动" 和 "高质量" 的选项来训练你的 AI 助手。然后点击 "保存并处理" 按钮。
|
||||
|
||||

|
||||

|
||||
|
||||
等待几秒钟,embedding 处理进程完成。
|
||||
|
||||

|
||||

|
||||
|
||||
#### 5. 创建你自己的 AI 应用程序[](https://wsyfin.com/notion-dify#5-create-your-own-ai-application) <a href="#id-5-create-your-own-ai-application" id="id-5-create-your-own-ai-application"></a>
|
||||
|
||||
你需要创建一个AI应用,然后连接刚刚创建的知识库。返回到仪表板,然后点击“创建新应用”按钮。建议直接使用聊天应用。
|
||||
|
||||

|
||||

|
||||
|
||||
选择“Prompt Eng.”并在“context”中添加你的 Notion 知识库。
|
||||
|
||||

|
||||

|
||||
|
||||
我建议在你的 AI 应用程序中添加一个「预设提示」。就像咒语对于哈利·波特来说是必不可少的一样,某些工具或功能可以极大地增强 AI 应用程序的能力。
|
||||
|
||||
@@ -81,15 +81,15 @@ Notion 是一个强大的知识管理工具。它的灵活性和可扩展性使
|
||||
|
||||
> 我希望你能在我的 Notion 工作区中扮演一个 IT 专家的角色,利用你对计算机科学、网络基础设施、Notion 笔记和 IT 安全的知识来解决问题。
|
||||
|
||||

|
||||

|
||||
|
||||
建议初始时启用 AI 主动提供用户一个起始句子,给出可以询问的线索。此外,激活「语音转文字」功能可以让用户通过语音与你的 AI 助手进行互动。
|
||||
|
||||

|
||||

|
||||
|
||||
现在你可以在“概览”中单击公共 URL 聊天与你自己的 AI 助手!
|
||||
|
||||

|
||||

|
||||
|
||||
### 通过API集成到你的项目中
|
||||
|
||||
@@ -99,27 +99,27 @@ Notion 是一个强大的知识管理工具。它的灵活性和可扩展性使
|
||||
|
||||
在概览页面上点击「API 参考」按钮。你可以将其作为你应用程序的 API 文档参考。
|
||||
|
||||

|
||||

|
||||
|
||||
#### 1. 生成 API 密钥 <a href="#id-1-generate-api-secret-key" id="id-1-generate-api-secret-key"></a>
|
||||
|
||||
为了安全起见,建议生成 API 密钥以访问你的 AI 应用。
|
||||
|
||||

|
||||

|
||||
|
||||
#### 2.检索会话ID <a href="#id-2-retrieve-conversation-id" id="id-2-retrieve-conversation-id"></a>
|
||||
|
||||
与 AI 应用程序聊天后,你可以从“Logs & Ann.”页面检索会话 ID。
|
||||
|
||||

|
||||

|
||||
|
||||
#### 3. 调用API <a href="#id-3-invoke-api" id="id-3-invoke-api"></a>
|
||||
|
||||
你可以在API文档上运行示例请求代码来调用终端中的AI应用程序。
|
||||
|
||||
记住替换代码中的SECRET KEY和conversation\_id。
|
||||
记住替换代码中的SECRET KEY和conversation_id。
|
||||
|
||||
你可以在第一次输入空的conversation\_id,在收到包含conversation\_id的响应后将其替换。
|
||||
你可以在第一次输入空的conversation_id,在收到包含conversation_id的响应后将其替换。
|
||||
|
||||
```
|
||||
curl --location --request POST 'https://api.dify.ai/v1/chat-messages' \
|
||||
@@ -136,7 +136,7 @@ curl --location --request POST 'https://api.dify.ai/v1/chat-messages' \
|
||||
|
||||
在终端中发送请求,你将获得成功的响应。
|
||||
|
||||

|
||||

|
||||
|
||||
如果你想继续此聊天,请将请求代码的`conversation_id`替换为你从响应中获得的`conversation_id`。
|
||||
|
||||
@@ -146,6 +146,8 @@ curl --location --request POST 'https://api.dify.ai/v1/chat-messages' \
|
||||
|
||||
如果你的 Notion 页面更新了,你可以定期与 Dify 同步,让你的人工智能助手保持最新状态。你的人工智能助手将从新内容中学习并回答新问题。
|
||||
|
||||

|
||||
|
||||
### 总结
|
||||
|
||||
在本教程中,我们不仅学会了如何将你的 Notion 数据导入到 Dify 中,还学会了如何使用 API 将其与你的项目集成。
|
||||
|
||||
Reference in New Issue
Block a user