Skip to main content

获取文件/文档解析进度

GET http(s)://{{Host}}/v1/files/{file_id}/progress?progress_name=document_parser

文档解析 (document_parser):将文件进行处理,实现非结构化文件( 如:pdf ) -> 结构化数据 (如:json) 的过程。你能够通过文档解析,得到结构化数据,用于LLM请求,进而实现类似"LLM具备多模能力"的效果

示例

请求

curl -L 'http(s)://{{Host}}/v1/files/{file_id}/progress?progress_name=document_parser' \
-H 'Authorization: Bearer $OPEN_API_KEY'

响应

{
"file_id": "file-2503041142310019000486-2075695711",
"name": "document_parser",
"status": "document_parse_finish",
"percent": 100
}

当Http Code为非200(如4041则表示文档解析未开始) 当http code为 200,且percent达到100时,则表示文件/文档解析已完成,能够通过文档解析结果获取接口,得到dom-tree内容

Path parameters

参数类型必需说明
file_idstringRequired要获取解析进度的文件ID。

Query parameters

参数类型必需说明
progress_namestringRequired固定值:document_parser

Returns

字段类型说明
file_idstring文件id。
namestring固定为的 document_parser
statusstring文件解析状态
percentnumber进度。100表示100%,即完成

文件解析状态值

含义
document_parse_begin开始解析
document_parse_layout_finishlayout解析完毕
document_parse_domtree_finishdomtree解析完毕
document_parse_finish全部解析完毕
document_parse_fail解析失败