工作流“信息收集”节点
更新时间:2025-08-04
什么是工作流“信息收集”节点
1.“信息收集”节点是通过工作流创建Agent时,可以向用户提问并进行用户答案收集的节点。该节点将用户回复的信息、对话历史及参数抽取的结果作为输出参数。


2.在工作流中使用“信息收集”节点。
通过API使用“信息收集”节点
在平台发布后一个含有“信息收集”节点工作流Agent后,可通过代码态的方式,对该节点进行回复。
1.通过 新建对话 接口获取conversation_id
请求
JSON
1curl --location 'http://qianfan.baidubce.com/v2/app/conversation' \
2--header 'Authorization: Bearer <AppBuilder API Key>' \
3--header 'Content-Type: application/json' \
4--data '{
5 "app_id": "85036d8f-239c-469c-b342-b62ca9d696f6" // 应用id 前往【个人空间】- 【应用】中获取
6}'
响应
JSON
1{
2 "request_id": "9e6c2b6b-2ca7-4782-b26e-b12017ce7dee",
3 "conversation_id": "e2c4b0fc-fe5b-4221-b978-b6ef606860b0"
4}
2.调用 对话 接口,发送首轮消息,触发工作流中“信息收集”节点,从回复里获取interrupt_event_id和interrupt_event_type。
JSON
1curl --location --request POST 'http://qianfan.baidubce.com/v2/app/conversation/runs' \
2--header 'Authorization: Bearer <AppBuilder API Key>' \
3--header 'Content-Type: application/json' \
4--data-raw '{
5 "app_id": "85036d8f-239c-469c-b342-b62ca9d696f6",
6 "query": "你好",
7 "stream": true,
8 "conversation_id": "e2c4b0fc-fe5b-4221-b978-b6ef606860b0"
9 }'
3.获取到interrupt_event_id后,再次调用“对话”接口,通过配置请求参数"action"回复"信息收集节点"的消息。
JSON
1 curl --location --request POST 'http://qianfan.baidubce.com/v2/app/conversation/runs' \
2 --header 'Authorization: Bearer <AppBuilder API Key>' \
3 --header 'Content-Type: application/json' \
4 --data-raw '{
5 "app_id": "7439c98a-a96c-468a-8a94-97a61b4476bf",
6 "query": "你好,我叫小明", // 此处为用户回复的信息
7 "stream": true,
8 "conversation_id": "f1e88920-6075-42e2-b6ce-fff44f2c3159",
9 "action":{
10 "action_type":"resume",
11 "parameters":{
12 "interrupt_event":{
13 "id": "af01f7ee-0ba2-4208-ac3c-09dee43c9ba0",
14 "type": "chat"
15 }
16 }
17 }
18 }'