异步生成内容并产出 PPT
接口信息
- 方法:POST
- 路径:
- 鉴权:请求头传
token
接口作用
在生成内容的同时异步产出 PPT,并在流式响应中返回实时的 pptId 与进度信息。
请求示例
curl --request POST \ --url https://open.docmee.cn/api/ppt/generateContent \ --header "Content-Type: application/json" \ --header "token: YOUR_TEMP_TOKEN" \ --data '{ "templateId": "template_xxx", "outlineMarkdown": "# 主题\n## 章节\n### 页面标题", "asyncGenPptx": true, "prompt": "加强专业感", "dataUrl": null }'
请求参数
{ "templateId": "template_xxx", "outlineMarkdown": "# 主题\n## 章节\n### 页面标题", "asyncGenPptx": true, "prompt": "加强专业感", "dataUrl": null }
请求字段说明
| 参数名 | 类型 | 必填 | 示例 | 说明 |
|---|---|---|---|---|
templateId | string | 否 | template_xxx | 模板 ID。 |
outlineMarkdown | string | 否 | # 主题 / ## 章节 / ### 页面标题 | Markdown 格式的内容结构。 |
asyncGenPptx | boolean | 否 | true | 字段用途请结合接口场景传入。 |
prompt | string | 否 | 加强专业感 | 附加生成要求。 |
dataUrl | string | 否 | null | 字段用途请结合接口场景传入。 |
关键说明
asyncGenPptx必须为true- 流式响应中会持续出现
pptId、total、current - 每次收到新的
pptId时,可调用asyncPptInfo拉取最新渲染数据
响应示例
event: message data: {"status":3,"text":"生成中..."} event: message data: {"status":4,"markdown":"# 主题"}
响应字段说明
| 字段名 | 类型 | 示例 | 说明 |
|---|---|---|---|
event | string | message | SSE 事件名。 |
data.status | number | 3 | 当前生成状态。常见值如 1、3、4。 |
data.text | string | 生成中... | 当前阶段返回的文本片段或提示。 |
data.markdown | string | # 主题 | 生成完成后返回的 Markdown 内容。 |
Last updated on