名称: deepresearch-conversation
描述: Deep ReSearch Conversation 由百度提供,用于与“深度研究”智能体进行多轮流式对话。“深度研究”是一项涉及多步推理与执行的长流程任务,不同于普通的“问答”。此类对话需要用户反复验证与修正,直至获得满意的答案。
元数据: { "openclaw": { "emoji": "📌", "requires": { "bins": ["python3", "curl"], "env": ["BAIDU_API_KEY"] }, "primaryEnv": "BAIDU_API_KEY" } }
此技能使 OpenClaw 智能体能够就给定主题与用户进行深度研究讨论。API Key 会自动从 OpenClaw 配置中加载,无需手动设置。
| 名称 | 路径 | 描述 |
|---|---|---|
| DeepresearchConversation | /v2/agent/deepresearch/run | 多轮流式深度研究对话(通过 Python 脚本) |
| ConversationCreate | /v2/agent/deepresearch/create | 创建新的对话会话,返回 conversation_id |
| FileUpload | /v2/agent/file/upload | 为对话上传文件 |
| FileParseSubmit | /v2/agent/file/parse/submit | 提交已上传的文件进行解析 |
| FileParseQuery | /v2/agent/file/parse/query | 查询文件解析任务状态 |
conversation_id。conversation_id 调用 FileUpload 上传文件。file_id 调用 FileParseSubmit。query、conversation_id 和 file_ids 调用 DeepresearchConversation。conversation_id。interrupt_id(用于“需求澄清”或“大纲确认”),则下一次调用必须包含该 interrupt_id。structured_outline,请将其呈现给用户进行确认/修改,然后在下次调用中传递最终大纲。无参数
curl -X POST "https://qianfan.baidubce.com/v2/agent/deepresearch/create" \
-H "X-Appbuilder-From: openclaw" \
-H "Authorization: Bearer $BAIDU_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
agent_code: 固定值 "deepresearch"(必需)conversation_id: 来自 ConversationCreate 响应(必需)file: 本地文件二进制数据(与 file_url 互斥)。最多 10 个文件。支持格式:file_url: 文件的公开 URL(与 file 互斥)curl -X POST "https://qianfan.baidubce.com/v2/agent/file/upload" \
-H "Authorization: Bearer $BAIDU_API_KEY" \
-H "Content-Type: multipart/form-data" \
-H "X-Appbuilder-From: openclaw" \
-F "agent_code=deepresearch" \
-F "conversation_id=$conversation_id" \
-F "file=@local_file_path"
curl -X POST "https://qianfan.baidubce.com/v2/agent/file/upload" \
-H "Authorization: Bearer $BAIDU_API_KEY" \
-H "Content-Type: multipart/form-data" \
-H "X-Appbuilder-From: openclaw" \
-F "agent_code=deepresearch" \
-F "conversation_id=$conversation_id" \
-F "file_url=$file_url"
file_id: 来自 FileUpload 响应(必需)curl -X POST "https://qianfan.baidubce.com/v2/agent/file/parse/submit" \
-H "Authorization: Bearer $BAIDU_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Appbuilder-From: openclaw" \
-d '{"file_id": "$file_id"}'
task_id: 来自 FileParseSubmit 响应(必需)curl -X GET "https://qianfan.baidubce.com/v2/agent/file/parse/query?task_id=$task_id" \
-H "Authorization: Bearer $BAIDU_API_KEY" \
-H "X-Appbuilder-From: openclaw"
query: 用户的问题或研究主题(必需)conversation_id: 首次调用可选(自动生成)。后续调用必需。file_ids: 已解析的文件 ID 列表(可选,仅在讨论文件时使用)interrupt_id: 当响应上一轮的“需求澄清”或“大纲确认”时必需。可在上一轮 SSE 响应的 content.text.data 中找到。structured_outline: 研究报告大纲。如果上一轮生成了大纲,则后续调用必需。结构如下:{
"title": "字符串",
"locale": "字符串",
"description": "字符串",
"sub_chapters": [
{
"title": "字符串",
"locale": "字符串",
"description": "字符串",
"sub_chapters": []
}
]
}
version: "Lite"(更快,10 分钟内)或 "Standard"(更深层,更慢)。默认:"Standard"。python3 scripts/deepresearch_conversation.py '{"query": "您的问题", "version": "Standard"}'
python3 scripts/deepresearch_conversation.py '{"query": "问题", "file_ids": ["file_id_1"], "interrupt_id": "interrupt_id", "conversation_id": "conversation_id", "structured_outline": {"title": "报告标题", "locale": "zh", "description": "描述", "sub_chapters": [{"title": "章节 1", "locale": "zh", "description": "章节描述", "sub_chapters": []}]}, "version": "Standard"}'