← Back to Skills Marketplace
wsxf

百度文档AI

by wsxf · GitHub ↗ · v1.0.5 · MIT-0
cross-platform ⚠ suspicious
168
Downloads
1
Stars
0
Active Installs
6
Versions
Install in OpenClaw
/install baidu-xmind-ai-v1-0-2
Description
百度智能文档分析平台API调用技能。支持文档抽取、文档解析、文档解析(PaddleOCR-VL)、文档比对、合同审查、文档格式转换等功能。当用户需要:(1) 从文档中提取特定字段信息,(2) 解析文档内容,(3) 比对两份文档差异,(4) 审查合同风险,(5) 转换文档格式时使用此技能。触发词:文档抽取、文档解析...
README (SKILL.md)

百度智能文档分析平台 API 技能

百度智能文档分析平台提供多种文档处理能力,包括文档抽取、文档解析、文档比对、合同审查、文档格式转换等功能。

功能概览

功能 说明 适用场景
文档抽取 自定义字段抽取,精准定位字段值 合同、票据、订单等结构化抽取
文档解析 通用文档解析,提取文本和表格 各类文档的内容提取
文档解析(PaddleOCR-VL) 多模态文档解析SOTA方案 复杂文档、跨页表格、多语言文档
文档比对 两份文档差异对比 合同修订、版本对比
合同审查 合同风险点识别 合同审核、合规检查
文档格式转换 文档格式转换 PDF转Word、图片转PDF等

⚠️ 安全说明

凭证配置

所有API调用需要百度API凭证(API Key 和 Secret Key):

方式1:环境变量(推荐)

export BAIDU_DOC_AI_API_KEY="您的API_KEY"
export BAIDU_DOC_AI_SECRET_KEY="您的SECRET_KEY"

方式2:配置文件

# 创建 ~/.baidu_doc_ai_config
[credentials]
api_key = 您的API_KEY
secret_key = 您的SECRET_KEY

网络安全

  • 此技能仅与百度官方API通信:aip.baidubce.com
  • 不与任何第三方服务器通信

API调用模式

异步API

所有API均为异步接口,需要两步操作:

  1. 提交请求 - 获取 taskId/task_id
  2. 轮询结果 - 根据 taskId 查询处理结果

建议轮询时间

  • 文档抽取:5秒后开始轮询
  • 文档解析:5-10秒后开始轮询
  • 合同审查:1-2分钟后开始轮询
  • 文档比对:5-10秒后开始轮询

使用脚本

技能提供了Python脚本,简化API调用:

统一命令行工具

所有功能集成在一个脚本中:

# 文档抽取
python scripts/baidu_doc_cli.py extract \
  --file document.pdf \
  --fields '[{"key": "合同名称"}, {"key": "合同金额"}]'

# 文档解析
python scripts/baidu_doc_cli.py parse --file document.pdf

# 文档解析VL
python scripts/baidu_doc_cli.py parse-vl \
  --file document.pdf \
  --analysis-chart --merge-tables

# 文档比对
python scripts/baidu_doc_cli.py compare \
  --base-file doc1.pdf \
  --compare-file doc2.pdf

# 合同审查
python scripts/baidu_doc_cli.py contract-review \
  --file contract.pdf \
  --template Sales_PartyA_V2

# 格式转换
python scripts/baidu_doc_cli.py convert --file document.pdf

Python API

from scripts.baidu_api_client import BaiduDocAIClient

# 初始化客户端
client = BaiduDocAIClient()

# 文档抽取
result = client.extract(
    file_data=file_data,
    manifest=[{"key": "合同名称"}, {"key": "合同金额"}]
)

# 文档解析
result = client.parse(
    file_data=file_data,
    file_name="document.pdf"
)

# 合同审查
result = client.contract_review(
    file_data=file_data,
    template_name="Sales_PartyA_V2"
)

合同类型模板

合同审查支持的合同类型:

模板名称 说明
Sales_PartyA_V2 买卖合同-买方
Sales_PartyB_V2 买卖合同-卖方
Lease_PartyA_V2 租赁合同-出租方
Lease_PartyB_V2 租赁合同-承租方
TechDev_PartyA_V2 技术开发合同-委托方
TechDev_PartyB_V2 技术开发合同-受托方
Labor_PartyA_V2 劳动合同-用人单位
Labor_PartyB_V2 劳动合同-劳动者

完整模板列表见:references/contract_review.md

错误处理

常见错误码及处理方式:

错误码 错误信息 解决方案
110/111 access_token无效或过期 重新获取token
216200 文件或文件路径为空 检查文件URL
216201 文件格式错误 确认文件格式支持
216202 文件大小异常 文件需小于限制
282000 内部错误 重试或联系技术支持
283016 请求参数不合法 检查参数格式

配额和限制

API QPS限制 文件大小限制 支持格式
文档抽取 提交2/查询10 50MB PDF、图片、Word、Excel、OFD
文档解析 提交2/查询10 10MB PDF、图片、Word、Excel
文档解析(VL) 提交2/查询10 100MB/500页 PDF、图片
文档比对 提交2/查询10 50MB PDF、图片、Word
合同审查 提交2/查询10 10MB PDF、Word
格式转换 提交2/查询10 4-10MB PDF、图片

参考文档

详细的API文档请参考 references/ 目录:

  • doc_extract.md - 文档抽取API详细文档
  • doc_parse.md - 文档解析API详细文档
  • doc_parse_vl.md - 文档解析(PaddleOCR-VL)API详细文档
  • doc_compare.md - 文档比对API详细文档
  • contract_review.md - 合同审查API详细文档
  • doc_convert.md - 文档格式转换API详细文档

相关链接

Usage Guidance
This package appears to be an implementation of Baidu's Document AI client and CLI; the code calls only aip.baidubce.com and expects your Baidu API Key and Secret. However: - Do not rely on the top-level registry metadata which incorrectly states no credentials are needed — the code and clawhub.yaml require BAIDU_DOC_AI_API_KEY and BAIDU_DOC_AI_SECRET_KEY. Treat that as a packaging error and verify the credential requirements before proceeding. - The CLI supports a --callback-url option (and USAGE examples show it). If you pass a callback URL, the skill will send results (potentially sensitive extracted document data) to that URL. SKILL.md's claim that it does not communicate with third‑party servers is therefore misleading. Only use callback URLs you control and trust. - Inspect the included scripts yourself (they are plain Python) or run them in a sandboxed environment. Check that network traffic goes only to aip.baidubce.com (and any callback URL you explicitly provided). - Install dependencies (requests) in an isolated env (virtualenv) and avoid exporting credentials globally unless you trust the package. If you want to proceed: correct the metadata (so required credentials are visible to installers), and avoid providing callback URLs to untrusted third parties. If you need help verifying network endpoints or have concerns about sensitive documents, run the tool locally against test documents first.
Capability Analysis
Type: OpenClaw Skill Name: baidu-xmind-ai-v1-0-2 Version: 1.0.5 The skill bundle is a legitimate integration for Baidu's Intelligent Document Analysis platform, providing tools for document extraction, parsing, comparison, and contract review. The Python scripts (`baidu_api_client.py` and `baidu_doc_cli.py`) implement standard API interaction patterns, including credential handling via environment variables and communication exclusively with the official Baidu API endpoint (aip.baidubce.com). No evidence of malicious intent, data exfiltration, or prompt injection was found; the requested permissions are strictly aligned with the documented functionality.
Capability Assessment
Purpose & Capability
The package code (scripts/baidu_api_client.py and scripts/baidu_doc_cli.py), SKILL.md, and clawhub.yaml all implement a Baidu 文档 AI client and CLI and legitimately require BAIDU_DOC_AI_API_KEY and BAIDU_DOC_AI_SECRET_KEY. However the registry metadata at the top of the submission incorrectly lists no required env vars/credentials; this mismatch between declared registry metadata and the actual code/packaging is an incoherence (likely packaging/metadata error) and should be resolved before trust.
Instruction Scope
SKILL.md and code indicate network access to aip.baidubce.com only, and the client reads only user-provided files (converts them to base64). However the CLI and USAGE docs support a --callback-url option and '使用回调URL' examples which allow results to be posted to arbitrary endpoints supplied by the user. SKILL.md also states '不与任何第三方服务器通信' which contradicts the supported callback behavior. The ability to supply a callback URL means user files or extracted data could be transmitted to third‑party endpoints if the user (or an automated workflow) provides such a URL.
Install Mechanism
No install spec that downloads third‑party archives; code files are included in the package. Dependencies are minimal (requests) declared in clawhub.yaml. No high‑risk download/install steps observed.
Credentials
The credentials requested by the code and clawhub.yaml (BAIDU_DOC_AI_API_KEY and BAIDU_DOC_AI_SECRET_KEY) are appropriate for a Baidu Document AI client. The inconsistency is that registry metadata erroneously lists no required env vars; SKILL.md and clawhub.yaml do require them. No unrelated secrets (AWS/etc.) are requested.
Persistence & Privilege
The skill is not marked always:true, does not request system-wide config changes, and does not attempt to modify other skills. Standard CLI behavior and runtime invocation are used.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install baidu-xmind-ai-v1-0-2
  3. After installation, invoke the skill by name or use /baidu-xmind-ai-v1-0-2
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.5
- Skill name changed from "baidu-doc-ai" to "baidu-xmind-ai". - No code or functional changes detected; only documentation and metadata were updated. - Initial version number for the new skill set to 1.0.0.
v1.0.4
彻底移除 callback_url 参数和 token 持久化,重写核心代码
v1.0.3
移除 callback_url 参数和 token 持久化,简化安全配置
v1.0.2
添加 clawhub.yaml 元数据文件,修复注册表凭证声明不匹配问题
v1.0.1
修复安全警告:1. 完善凭证配置声明 2. 添加网络权限声明 3. 添加callback_url安全警告 4. 添加token持久化警告 5. 修复文档中错误的脚本引用
v1.0.0
Initial release providing comprehensive access to Baidu's intelligent document analysis APIs: - Supports document extraction, parsing (including PaddleOCR-VL), comparison, contract review, and format conversion. - Includes Python scripts for each main API scenario with detailed parameter descriptions. - Provides ready-to-use field extraction and contract review templates. - Documents asynchronous API usage patterns, error handling, quotas, and supported formats. - Configuration guidance and references to official docs and tools are included.
Metadata
Slug baidu-xmind-ai-v1-0-2
Version 1.0.5
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 6
Frequently Asked Questions

What is 百度文档AI?

百度智能文档分析平台API调用技能。支持文档抽取、文档解析、文档解析(PaddleOCR-VL)、文档比对、合同审查、文档格式转换等功能。当用户需要:(1) 从文档中提取特定字段信息,(2) 解析文档内容,(3) 比对两份文档差异,(4) 审查合同风险,(5) 转换文档格式时使用此技能。触发词:文档抽取、文档解析... It is an AI Agent Skill for Claude Code / OpenClaw, with 168 downloads so far.

How do I install 百度文档AI?

Run "/install baidu-xmind-ai-v1-0-2" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 百度文档AI free?

Yes, 百度文档AI is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 百度文档AI support?

百度文档AI is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 百度文档AI?

It is built and maintained by wsxf (@wsxf); the current version is v1.0.5.

💬 Comments