Skip to content

Commit d63f1e8

Browse files
committed
feat: update dify, coze and dashscope
1 parent 775f429 commit d63f1e8

File tree

21 files changed

+440
-363
lines changed

21 files changed

+440
-363
lines changed

.vitepress/config.mjs

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export default defineConfig({
124124
collapsed: false,
125125
items: [
126126
{
127-
text: "接入大模型服务",
127+
text: "配置模型服务商",
128128
base: "/config/providers",
129129
collapsed: true,
130130
items: [
@@ -133,13 +133,21 @@ export default defineConfig({
133133
{ text: "硅基流动", link: "/siliconflow" },
134134
{ text: "小马算力", link: "/tokenpony" },
135135
{ text: "302.AI", link: "/302ai" },
136-
{ text: "Dify", link: "/dify" },
137-
{ text: "Coze", link: "/coze" },
138-
{ text: "阿里云百炼应用", link: "/dashscope" },
139136
{ text: "Ollama", link: "/provider-ollama" },
140137
{ text: "LMStudio", link: "/provider-lmstudio" },
141138
],
142139
},
140+
{
141+
text: "配置 Agent 执行器",
142+
base: "/config/agent-runners",
143+
collapsed: true,
144+
items: [
145+
{ text: "内置 Agent 执行器", link: "/astrbot-agent-runner" },
146+
{ text: "Dify", link: "/dify" },
147+
{ text: "扣子 Coze", link: "/coze" },
148+
{ text: "阿里云百炼应用", link: "/dashscope" },
149+
],
150+
},
143151
{
144152
text: "AstrBot 配置文件",
145153
link: "/astrbot-config",
@@ -342,13 +350,21 @@ export default defineConfig({
342350
{ text: "SiliconFlow", link: "/siliconflow" },
343351
{ text: "TokenPony", link: "/tokenpony" },
344352
{ text: "302.AI", link: "/302ai" },
345-
{ text: "Dify", link: "/dify" },
346-
{ text: "Coze", link: "/coze" },
347-
{ text: "Alibaba Cloud Bailian", link: "/dashscope" },
348353
{ text: "Ollama", link: "/provider-ollama" },
349354
{ text: "LMStudio", link: "/provider-lmstudio" },
350355
],
351356
},
357+
{
358+
text: "Integrating Agent Runners",
359+
base: "/en/config/agent-runners",
360+
collapsed: true,
361+
items: [
362+
{ text: "Built-in Agent Runner", link: "/astrbot-agent-runner" },
363+
{ text: "Dify", link: "/dify" },
364+
{ text: "Coze", link: "/coze" },
365+
{ text: "Alibaba Bailian", link: "/dashscope" },
366+
],
367+
},
352368
{
353369
text: "AstrBot Configuration File",
354370
link: "/astrbot-config",
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Built-in Agent Runner
2+
3+
By default, AstrBot uses the built-in Agent Runner as the default executor. You don't need to configure anything to use AstrBot's powerful built-in Agent Runner.
4+
5+
![image](/source/images/astrbot-agent-runner/image.png)
6+
7+
With the built-in Agent Runner, you can use AstrBot's [MCP Server](/use/mcp), [Knowledge Base](/use/knowledge-base), [Web Search](/use/websearch), and persona features.
8+

en/config/agent-runners/coze.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Connect to Coze
2+
3+
AstrBot v4.2.1 and later versions support connecting to [Coze](https://www.coze.cn/) Agent service.
4+
5+
## Preparation: Get API Key
6+
7+
First, register and log in to your [Coze](https://www.coze.cn/) account, then go to the [API Key Management Page](https://www.coze.cn/open/oauth/pats) to create a new API Key.
8+
9+
You can follow the steps in the image to reach the API Key management page, or click the link above to go directly.
10+
11+
![Create API Key](/source/images/coze/image_1.png)
12+
13+
Then, click "Create", fill in your API Key name on the following page, select an expiration time (permanent tokens are not recommended), click "Select All" under "Permissions", select a workspace, and then click "Confirm".
14+
15+
![Create Token](/source/images/coze/image_2.png)
16+
17+
After that, we will get a new API Key. Please copy and save it, as it will be needed later.
18+
19+
![New API Key](/source/images/coze/image_3.png)
20+
21+
## Preparation: Configure the Agent
22+
23+
Go to the [Project Development](https://www.coze.cn/space/develop) page, click "+Project" in the upper right corner to create a new project, and select to create an agent.
24+
25+
![Create Project](/source/images/coze/image_4.png)
26+
27+
![Create Project](/source/images/coze/image_5.png)
28+
29+
**Note**: After creating the agent, you must first click the **Publish** button in the upper right corner to publish the agent. In the "Select Publishing Platform" section, check all API options, then click "Publish".
30+
31+
> If you don't publish or don't check the API options during publishing, you won't be able to call the agent via API.
32+
33+
![Publish Agent](/source/images/coze/image_6.png)
34+
35+
After clicking publish, the agent creation is complete. You can see the publish history on the left side of the publish button on the agent development page to confirm the agent has been published successfully.
36+
37+
Next, note the URL on the agent development page:
38+
39+
![Agent Development](/source/images/coze/image_7.png)
40+
41+
For example, if the URL in the example is: "https://www.coze.cn/space/7553214941005004863/bot/7553248674860826660"
42+
43+
Then the `bot_id` is the string of numbers after `bot/` in the URL: `7553248674860826660`
44+
45+
We need to record the `bot_id` for later use.
46+
47+
## Configure Coze in AstrBot
48+
49+
After completing all the preparation work, we can now configure Coze in AstrBot.
50+
51+
Go to AstrBot Admin Panel -> Service Provider -> Add Service Provider -> Coze to enter the configuration page.
52+
53+
![Coze Provider](/source/images/coze/image_8.png)
54+
55+
Fill in the API Key and bot_id you just created, then click Save.
56+
57+
> Other configuration notes:
58+
>
59+
> - API Base URL: Generally no modification is needed. If you are using the international version of Coze, change this to: "https://api.coze.com"
60+
> - Let Coze manage conversation history: As described.
61+
62+
## Select Agent Runner
63+
64+
Go to the Configuration page in the left sidebar, click "Agent Execution Method", select "Coze", then select the ID of the Coze Agent Runner you just created in the new configuration options that appear below, and click "Save" in the bottom right corner to complete the configuration.
65+
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Connect to Alibaba Cloud Bailian Application
2+
3+
Since v3.4.30, AstrBot supports connecting to Alibaba Cloud Bailian Application.
4+
5+
## Configure Alibaba Cloud Bailian Application in AstrBot
6+
7+
On the [Alibaba Cloud Bailian Application](https://bailian.console.aliyun.com/app-center#/app-center) website, click to add a new application. Create an agent application, workflow application, or agent orchestration application according to your needs, and build the agent or workflow as required.
8+
9+
Record the Application ID:
10+
11+
![image](/source/images/dashscope/image-1.png)
12+
13+
Click to enter the application, click Publishing Channel -> API Call -> API KEY, create and copy the API KEY:
14+
15+
![alt text](/source/images/dashscope/image-2.png)
16+
17+
In the WebUI, click "Model Provider" -> "Add Provider", select "Agent Runner", select "Alibaba Cloud Bailian Application", and enter the Alibaba Cloud Bailian Application configuration page.
18+
19+
According to Alibaba Cloud Bailian Application, there are four application types:
20+
21+
- Agent Application (agent)
22+
- Task Workflow Application (task-workflow)
23+
- Dialog Workflow Application (dialog-workflow)
24+
- Agent Orchestration Application (agent-arrange)
25+
26+
> [!TIP]
27+
> Multi-turn conversations are only supported for agent applications and dialog workflow applications. AstrBot will automatically attach conversation history for these two types of applications to support multi-turn conversations.
28+
29+
Please ensure that the `Application Type` configured in AstrBot matches the application type created in Alibaba Cloud Bailian Application.
30+
31+
Then fill in the Application ID in `dashscope_app_id` and the API KEY in `dashscope_api_key`.
32+
33+
After filling in these three items, click Save.
34+
35+
## Select Agent Runner
36+
37+
Go to the Configuration page in the left sidebar, click "Agent Execution Method", select "Alibaba Cloud Bailian Application", then select the ID of the Alibaba Cloud Bailian Application Agent Runner you just created in the new configuration options that appear below, and click "Save" in the bottom right corner to complete the configuration.
38+
39+
## Appendix: Dynamically Set Workflow Input Variables During Chat (Optional)
40+
41+
For the two workflow applications, you can dynamically set input variables in the chat area.
42+
43+
Use the `/set` command to dynamically set input variables, as shown in the figure below:
44+
45+
![alt text](/source/images/dify/image-5.png)
46+
47+
After setting variables, AstrBot will attach the variables you set in the next request to Alibaba Cloud Bailian Application, flexibly adapting to your Workflow.
48+
49+
Of course, you can use the `/unset` command to cancel the variables you set. For example, `/unset name`
50+
51+
Variables are permanently valid in the current session.
52+

en/config/agent-runners/dify.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Connect to Dify
2+
3+
## Install Dify
4+
5+
If you haven't installed Dify yet, please refer to the [Dify Installation Documentation](https://docs.dify.ai/getting-started/install-self-hosted) to install it.
6+
7+
## Configure Dify in AstrBot
8+
9+
In the WebUI, click "Model Provider" -> "Add Provider", select "Agent Runner", select "Dify", and enter the Dify configuration page.
10+
11+
![image](/source/images/dify/image.png)
12+
13+
In Dify, one `API Key` uniquely corresponds to one Dify application. Therefore, you can create multiple Providers to adapt to multiple Dify applications.
14+
15+
According to the current Dify project, there are three types:
16+
17+
- chat
18+
- agent
19+
- workflow
20+
21+
>[!TIP]
22+
>Please ensure that the APP type you set in AstrBot matches the application type created in Dify.
23+
>![image](/source/images/dify/image-3.png)
24+
25+
26+
### Chat and Agent Applications
27+
28+
Create your Dify Chat and Agent application keys as shown in the figure below:
29+
30+
![image](/source/images/dify/chat-agent-api-key.png)
31+
32+
![image](/source/images/dify/chat-agent-api-key-2.png)
33+
34+
Copy the key and paste it into the `API Key` field in the configuration, then click "Save".
35+
36+
### Workflow Applications
37+
38+
#### Configure Input and Output Variable Names
39+
40+
Workflow applications receive input variables, execute the workflow, and output the results.
41+
42+
![image](/source/images/dify/workflow-io-key.png)
43+
44+
For Workflow applications, AstrBot will attach two variables with each request:
45+
46+
- `astrbot_text_query`: Input variable name. This is the text content entered by the user.
47+
- `astrbot_session_id`: Session ID
48+
49+
You can customize the input variable name in the configuration, which is the "Prompt Input Variable Name" shown in the figure above.
50+
51+
You need to modify the input variable name of your Workflow to adapt to AstrBot's input.
52+
53+
Finally, the Workflow will output a result. You can customize the variable name of this result, which is the "Dify Workflow Output Variable Name" in the configuration above, with a default value of `astrbot_wf_output`. You need to configure this variable name in the output node of the Dify Workflow, otherwise AstrBot cannot parse it correctly.
54+
55+
#### Create API Key
56+
57+
Create your Dify Workflow application's API Key as shown in the figure below:
58+
59+
Click the Publish button in the upper right corner -> Access API -> click API Key in the upper right corner -> Create Key, then copy the API Key.
60+
61+
![image](/source/images/dify/workflow-api-key.png)
62+
63+
Copy the key and paste it into the `API Key` field in the configuration, then click "Save".
64+
65+
### Select Agent Runner
66+
67+
Go to the Configuration page in the left sidebar, click "Agent Execution Method", select "Dify", then select the ID of the Dify Agent Runner you just created in the new configuration options that appear below, and click "Save" in the bottom right corner to complete the configuration.
68+
69+
## Appendix: Dynamically Set Workflow Input Variables During Chat (Optional)
70+
71+
You can use the `/set` command to dynamically set input variables, as shown in the figure below:
72+
73+
![alt text](/source/images/dify/image-5.png)
74+
75+
After setting variables, AstrBot will attach the variables you set in the next request to Dify, flexibly adapting to your Workflow.
76+
77+
![alt text](/source/images/dify/image-4.png)
78+
79+
Of course, you can use the `/unset` command to cancel the variables you set.
80+
81+
Variables are permanently valid in the current session.
82+

en/config/providers/coze.md

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1 @@
1-
# 接入 Coze
2-
3-
AstrBot v4.2.1 之后的版本, 支持接入 [Coze](https://www.coze.cn/) 的 Agent 服务。
4-
5-
## 使用说明
6-
7-
### 预备工作:准备 API Key
8-
9-
首先我们注册并登录 [Coze](https://www.coze.cn/) 账号,然后进入 [API Key 管理页面](https://www.coze.cn/open/oauth/pats) 创建一个新的 API Key。
10-
11-
你可以按图片的步骤到达 API Key 管理页面, 也可以点击上面的链接直接进入。
12-
13-
![创建 API Key](/source/images/coze/image_1.png)
14-
15-
随后, 点击 "创建", 在下面的页面填写你的 API Key 名称, 选择一个过期时间(不建议使用永久令牌), 在 "权限" 处选择点击 "全选", 选择一个工作空间, 然后点击 "确定"。
16-
17-
![创建令牌](/source/images/coze/image_2.png)
18-
19-
随后我们可以得到一个新的 API Key, 请复制保存好, 后面会用到。
20-
21-
![新的 API Key](/source/images/coze/image_3.png)
22-
23-
### 预备工作: 配置智能体
24-
25-
进入 [项目开发](https://www.coze.cn/space/develop) 页面, 点击右上角 "+项目" 创建一个新的项目, 选择创建智能体。
26-
27-
![新建项目](/source/images/coze/image_4.png)
28-
29-
![新建项目](/source/images/coze/image_5.png)
30-
31-
**注意**: 完成智能体创建后, 必须先点击右上角的发布 **发布** 智能体, 并在发布中的 "选择发布平台" 处将 API 分栏全部勾选上, 然后点击 "发布"。
32-
33-
> 如果没有发布或发布时没有勾选 API 分栏, 则无法通过 API 调用智能体。
34-
35-
![发布智能体](/source/images/coze/image_6.png)
36-
37-
点击发布后, 智能体就创建完成了, 你可以在智能体开发页面的发布按钮左侧看到发布历史记录, 以确认智能体已经发布成功。
38-
39-
接下来注意在智能体开发页面的链接:
40-
41-
![智能体开发](/source/images/coze/image_7.png)
42-
43-
例如示例中链接为: "https://www.coze.cn/space/7553214941005004863/bot/7553248674860826660"
44-
45-
那么 `bot_id` 就是链接中 `bot/` 后面的那一串数字: `7553248674860826660`
46-
47-
我们需要将 `bot_id` 记录下来, 后面会用到。
48-
49-
### 接入 AstrBot
50-
51-
完成了所有预备工作, 现在我们就可以在 AstrBot 中配置 Coze 了。
52-
53-
进入 AstrBot 管理面板 -> 服务提供商 -> 新增服务提供商 -> Coze, 进入配置页面。
54-
55-
![Coze 供应商](/source/images/coze/image_8.png)
56-
57-
填入刚刚创建的 API Key 和 bot_id, 然后点击保存。
58-
59-
> 其他配置说明:
60-
>
61-
> - API Base URL: 一般不需要修改, 如果你使用的是 Coze 国际版, 这里修改为: "https://api.coze.com"
62-
> - 由 Coze 管理对话记录: 如描述所示。
63-
64-
到这里, Coze 就配置完成了,你可以在 AstrBot 中选择 Coze 作为服务提供商, 然后开始使用了。
1+
This page is deprecated. Please refer to [Coze Agent Runner](../agent-runners/coze.md).

en/config/providers/dashscope.md

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1 @@
1-
# 接入阿里云百炼应用
2-
3-
在 v3.4.30 及之后,AstrBot 支持接入阿里云百炼应用。
4-
5-
## 使用
6-
7-
[阿里云百炼应用](https://bailian.console.aliyun.com/app-center#/app-center) 官网点击新增应用,根据自己的需要创建智能体应用或者工作流应用或者智能体编排应用,并且按照自己的需求构建好智能体或者工作流。
8-
9-
记录应用ID:
10-
11-
![image](/source/images/dashscope/image-1.png)
12-
13-
点击进入应用,点击发布渠道->API 调用->API KEY,创建并且复制 API KEY:
14-
15-
![alt text](/source/images/dashscope/image-2.png)
16-
17-
进入 AstrBot 管理面板->服务提供商->新增服务提供商->Dashscope,进入配置页面。
18-
19-
![image](/source/images/dashscope/image.png)
20-
21-
根据阿里云百炼应用,一共有四种应用类型,分别是
22-
23-
- 智能体应用(agent)
24-
- 任务型工作流应用(task-workflow)
25-
- 对话型工作流应用(dialog-workflow)
26-
- 智能体编排应用(agent-arrange)
27-
28-
> [!TIP]
29-
> 多轮对话仅支持智能体应用和对话型工作流应用。AstrBot 会自动为这两种应用附上对话历史记录以支持多轮对话。
30-
31-
请保证 AstrBot 里配置的 `应用类型` 和阿里云百炼应用里创建的应用类型一致。
32-
33-
然后将应用 ID 填写到 `dashscope_app_id`,API KEY 填写到 `dashscope_api_key`
34-
35-
填写完这三项之后点击保存。
36-
37-
可以在聊天页进行测试:
38-
39-
![image](/source/images/dashscope/image-3.png)
40-
41-
## 在聊天时动态设置输入变量
42-
43-
对于两种工作流应用,可在聊天区动态设置输入的变量。
44-
45-
使用 `/set` 指令可以动态设置输入变量,如下图所示:
46-
47-
![alt text](/source/images/dify/image-5.png)
48-
49-
当设置变量后,AstrBot 会在下次向阿里云百炼应用请求时附上您设置的变量,以灵活适配您的 Workflow。
50-
51-
当然,可以使用 `/unset` 指令来取消您所设置的变量。如 `/unset name`
52-
53-
变量在当前会话永久有效。
54-
55-
> 变量存储在 data/shared_preferences.json 下。
1+
This page is deprecated. Please refer to [Alibaba Cloud Bailian Application Agent Runner](../agent-runners/dashscope.md).

0 commit comments

Comments
 (0)