diff --git a/docs/integrations/dify.md b/docs/integrations/dify.md index edbf6f7327fb0fe43eae566d35761569ba986318..514ab5b118b5e62e3cba8a0a4d7c88e27de489ee 100644 --- a/docs/integrations/dify.md +++ b/docs/integrations/dify.md @@ -6,28 +6,56 @@ sidebar_position: 11 Dify 是一款开源的大语言模型(LLM)应用开发平台。它融合了后端即服务(Backend as Service)和 [LLMOps](https://docs.dify.ai/v/zh-hans/learn-more/extended-reading/what-is-llmops) 的理念,使开发者可以快速搭建生产级的生成式 AI 应用。即使是非技术人员,也能参与到 AI 应用的定义和数据运营过程中。 -### 配置指南 +Serverless API 支持在 Dify 中调用,使用步骤如下: -Serverless API 支持在 Dify 中调用,使用步骤如下 +## 获取模力方舟访问令牌 -1. 获取模力方舟访问令牌 + 开发者首先需要访问 [**工作台->设置->访问令牌**]({{SITE_URL}}/dashboard/settings/tokens) 中获取访问令牌,没有购买模型资源包的开发者,可以使用免费体验访问令牌(仅供体验,每日调用次数有限),复制对应的访问令牌,以便后续使用。 -开发者首先需要访问 [**工作台->设置->访问令牌**]({{SITE_URL}}/dashboard/settings/tokens) 中获取访问令牌,没有购买 Serverless API 的开发者,可以使用免费体验访问令牌(仅供体验,每日调用次数有限),复制想要使用的令牌即可。 + ![访问令牌](/img/serverless-api/integrated/integrate14.png) -![](/img/serverless-api/integrated/integrate14.png) -2. 在 Dify 中填入访问令牌 +## 集成模力方舟模型至 Dify 应用 +模力方舟提供的模型可无缝集成至 Dify 的应用编排流程中,无论是调用内置模型还是添加自定义模型,都能让开发者灵活组合模型能力,快速构建符合业务需求的生成式 AI 应用。以下是具体的操作方式: -打开并登录 [Dify](https://cloud.dify.ai) ,点击页面右上角用户名,进入设置,选择「模型供应商」。 +### 调用内置模型 -![](/img/serverless-api/integrated/integrate15.png) +对于常用的模力方舟模型,Dify 已预先完成集成配置,开发者只需简单几步即可启用这些模型,快速投入应用开发。 -选择 模力方舟中的设置,填入此前复制的访问令牌,点击保存即可。 +1. 打开并登录 [Dify](https://cloud.dify.ai) ,点击页面右上角 **用户名->设置->选择「模型供应商」** -![](/img/serverless-api/integrated/integrate16.png) + ![安装模力方舟](/img/serverless-api/integrated/dify01.png) -3. 在应用编排中调用模力方舟 +2. 选择模力方舟并安装,填入此前复制的访问令牌,点击 “保存” 即可。 -至此,开发者便可以在 Dify 的应用编排中调用来自模力方舟的模型了。 + ![添加模力方舟令牌](/img/serverless-api/integrated/dify02.png) -![](/img/serverless-api/integrated/integrate17.png) +3. 至此,开发者便可以在 Dify 应用编排中调用来自模力方舟的模型了。 + + **模力方舟共提供了 53 个模型供开发者们调用**,涵盖了文本生成、文本补全、文本嵌入、重排序、语音转文本、文本转语音等多个应用领域。 + + ![模型展示](/img/serverless-api/integrated/dify03.png) + + 编排完成后点击发布,开发者即拥有了一个基于模力方舟平台上的模型及算力的应用。 + +### 添加自定义模型 + +若需要使用 Dify 未内置的模力方舟特色模型,可通过自定义配置将其添加至 Dify 环境中,扩展应用开发的模型选择范围。 + +1. 打开 [Dify](https://cloud.dify.ai) ,点击页面右上角 **用户名->设置->选择「模型供应商」** ,若未安装则点击安装 + + ![安装模力方舟](/img/serverless-api/integrated/dify01.png) + +2. 选择模型列表中已安装的模力方舟,输入对应的访问令牌后点击 “添加模型” + + ![添加模型](/img/serverless-api/integrated/dify05.png) + +3. 在其中 **选择模型类型->填写模型名称->输入访问令牌** + + ![输入信息](/img/serverless-api/integrated/dify06.png) + +- **模型类型**:根据需添加的模型进行选择 +- **模型名称**:前往 [**AI 模型广场**]({{SITE_URL}}/serverless-api) 中选择 +- **API Key**:前往 [**工作台->设置->访问令牌**]({{SITE_URL}}/dashboard/settings/tokens) 获取 + +4. 设置完成后,可以在模型列表中看到您新增的模型。 \ No newline at end of file diff --git a/static/img/serverless-api/integrated/dify01.png b/static/img/serverless-api/integrated/dify01.png new file mode 100644 index 0000000000000000000000000000000000000000..aa5bdcb81a9c74f9c3db5db18f3d26f28c909fbb Binary files /dev/null and b/static/img/serverless-api/integrated/dify01.png differ diff --git a/static/img/serverless-api/integrated/dify02.png b/static/img/serverless-api/integrated/dify02.png new file mode 100644 index 0000000000000000000000000000000000000000..2a25aa2c16b9d880d66c47c98d42d64f92331dc5 Binary files /dev/null and b/static/img/serverless-api/integrated/dify02.png differ diff --git a/static/img/serverless-api/integrated/dify03.png b/static/img/serverless-api/integrated/dify03.png new file mode 100644 index 0000000000000000000000000000000000000000..4525a8283acd30e9649f39f03a069731b28e468f Binary files /dev/null and b/static/img/serverless-api/integrated/dify03.png differ diff --git a/static/img/serverless-api/integrated/dify04.png b/static/img/serverless-api/integrated/dify04.png new file mode 100644 index 0000000000000000000000000000000000000000..9abd756a9723f0e7abc313b7f626632230afa496 Binary files /dev/null and b/static/img/serverless-api/integrated/dify04.png differ diff --git a/static/img/serverless-api/integrated/dify05.png b/static/img/serverless-api/integrated/dify05.png new file mode 100644 index 0000000000000000000000000000000000000000..5702075dcad37bf910a9a156992c158919861f03 Binary files /dev/null and b/static/img/serverless-api/integrated/dify05.png differ diff --git a/static/img/serverless-api/integrated/dify06.png b/static/img/serverless-api/integrated/dify06.png new file mode 100644 index 0000000000000000000000000000000000000000..65953e5c910131b646d269fd0d89c95bd93aab84 Binary files /dev/null and b/static/img/serverless-api/integrated/dify06.png differ diff --git a/static/img/serverless-api/integrated/integrate1.png b/static/img/serverless-api/integrated/integrate1.png index e27e70d384e9cfb06f9cbe5f20b582314f3881d0..ecebe6710adac8423e8374e5a3848ce86b7844bc 100644 Binary files a/static/img/serverless-api/integrated/integrate1.png and b/static/img/serverless-api/integrated/integrate1.png differ diff --git a/static/img/serverless-api/integrated/integrate14.png b/static/img/serverless-api/integrated/integrate14.png index 50ea44caee71db158acb43d12b4181749190010c..08762ce8e86b35e26fb601aea6bd6ee53eb6fd88 100644 Binary files a/static/img/serverless-api/integrated/integrate14.png and b/static/img/serverless-api/integrated/integrate14.png differ diff --git a/static/img/serverless-api/integrated/integrate15.png b/static/img/serverless-api/integrated/integrate15.png deleted file mode 100644 index f30969fc5975ac7009f1f7f390c87def3e47d225..0000000000000000000000000000000000000000 Binary files a/static/img/serverless-api/integrated/integrate15.png and /dev/null differ diff --git a/static/img/serverless-api/integrated/integrate16.png b/static/img/serverless-api/integrated/integrate16.png deleted file mode 100644 index 056f4e2a9fb457bd65d9d869e033d3a61ac83e53..0000000000000000000000000000000000000000 Binary files a/static/img/serverless-api/integrated/integrate16.png and /dev/null differ diff --git a/static/img/serverless-api/integrated/integrate17.png b/static/img/serverless-api/integrated/integrate17.png deleted file mode 100644 index efe2f4cd88794754af23918a3bf2cd82ed8434ad..0000000000000000000000000000000000000000 Binary files a/static/img/serverless-api/integrated/integrate17.png and /dev/null differ