Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 12 additions & 18 deletions skills/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ This directory contains official PaddleOCR Agent Skills. They integrate with AI

## Prerequisites

1. Python 3.8 or later must be installed on the device that runs the skill.
2. These skills depend on PaddleOCR official APIs and require API credentials. Visit the [PaddleOCR website](https://www.paddleocr.com), click **API**, select the model you need, then copy the `API_URL` and `Token`. They correspond to the API URL and access token used for authentication. Supported models per skill:
1. Python 3.9 or later and [uv](https://docs.astral.sh/uv/) must be installed on the device that runs the skill. Scripts declare dependencies inline ([PEP 723](https://peps.python.org/pep-0723/)); `uv run` resolves them automatically.
2. These skills depend on PaddleOCR official APIs and require API credentials. Visit the [PaddleOCR website](https://www.paddleocr.com), click **API**, select the model you need, select the language for the text recognition model, then copy the `API_URL` and `Token`. They correspond to the API URL and access token used for authentication. Supported model per skill:
- `paddleocr-text-recognition`: `PP-OCRv5`
- `paddleocr-doc-parsing`: `PP-StructureV3`, `PaddleOCR-VL`, `PaddleOCR-VL-1.5`

Expand All @@ -34,6 +34,7 @@ npx skills add PaddlePaddle/PaddleOCR -g --skill paddleocr-doc-parsing -y
> ```shell
> git clone https://github.com/PaddlePaddle/PaddleOCR.git
> npx skills add ./PaddleOCR/skills/paddleocr-text-recognition
> npx skills add ./PaddleOCR/skills/paddleocr-doc-parsing
> ```

#### Option 2: Install via `clawhub` (OpenClaw)
Expand Down Expand Up @@ -65,8 +66,8 @@ After installation, configure the required environment variables so the skills c

| Skill | Required | Optional |
| --- | --- | --- |
| `paddleocr-text-recognition` | `PADDLEOCR_OCR_API_URL` (API URL), `PADDLEOCR_ACCESS_TOKEN` (access token) | `PADDLEOCR_OCR_TIMEOUT` (API request timeout) |
| `paddleocr-doc-parsing` | `PADDLEOCR_DOC_PARSING_API_URL` (API URL), `PADDLEOCR_ACCESS_TOKEN` (access token) | `PADDLEOCR_DOC_PARSING_TIMEOUT` (API request timeout) |
| `paddleocr-text-recognition` | `PADDLEOCR_OCR_API_URL` (full endpoint URL ending with `/ocr`), `PADDLEOCR_ACCESS_TOKEN` (access token) | `PADDLEOCR_OCR_TIMEOUT` (API request timeout) |
| `paddleocr-doc-parsing` | `PADDLEOCR_DOC_PARSING_API_URL` (full endpoint URL ending with `/layout-parsing`), `PADDLEOCR_ACCESS_TOKEN` (access token) | `PADDLEOCR_DOC_PARSING_TIMEOUT` (API request timeout) |

Below are configuration methods for some AI apps:

Expand Down Expand Up @@ -145,28 +146,21 @@ This section describes how to run smoke tests locally to verify that the skills

> The examples below cover both skills. Run only the commands for the skill(s) you need.

Make sure your working directory is the directory containing this file.
Make sure your working directory is the directory containing this file. All scripts declare their dependencies inline ([PEP 723](https://peps.python.org/pep-0723/)), so [uv](https://docs.astral.sh/uv/) resolves them automatically — no separate install step is needed.

1. Install dependencies.

```shell
python -m pip install -r paddleocr-text-recognition/scripts/requirements.txt
python -m pip install -r paddleocr-doc-parsing/scripts/requirements.txt
# Optional: required only when using document file optimization
python -m pip install -r paddleocr-doc-parsing/scripts/requirements-optimize.txt
```

2. Configure environment variables (see [Configure Environment Variables](#configure-environment-variables) for the list of variables).
1. Configure environment variables (see [Configure Environment Variables](#configure-environment-variables) for the list of variables).

```shell
export PADDLEOCR_OCR_API_URL="<OCR_API_URL>"
export PADDLEOCR_ACCESS_TOKEN="<ACCESS_TOKEN>"
export PADDLEOCR_DOC_PARSING_API_URL="<DOC_PARSING_API_URL>"
```

3. Run the smoke test scripts.
2. Run the smoke test scripts.

```shell
python paddleocr-text-recognition/scripts/smoke_test.py
python paddleocr-doc-parsing/scripts/smoke_test.py
cd paddleocr-text-recognition && uv run scripts/smoke_test.py && cd ..
cd paddleocr-doc-parsing && uv run scripts/smoke_test.py && cd ..
```

Use `--skip-api-test` to verify configuration only (no network call). Use `--test-url "https://..."` to override the default sample document/image URL.
30 changes: 12 additions & 18 deletions skills/README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

## 准备工作

1. 请确保执行 skill 的设备安装有 Python 3.8 或以上版本
2. Skill 底层依赖于 PaddleOCR 官方 API,因此需要配置相关凭证才能使用。可以在 [PaddleOCR 官网](https://www.paddleocr.com) 点击 **API**,选择需要用到的算法,然后复制 `API_URL` 和 `Token`,它们分别对应服务的 API URL 和用户鉴权使用的 access token。各 skill 支持的算法如下
1. 请确保执行 skill 的设备安装有 Python 3.9 或以上版本和 [uv](https://docs.astral.sh/uv/)。所有脚本均以 [PEP 723](https://peps.python.org/pep-0723/) 格式内联声明依赖,`uv run` 会自动解析
2. Skill 底层依赖于 PaddleOCR 官方 API,因此需要配置相关凭证才能使用。可以在 [PaddleOCR 官网](https://www.paddleocr.com) 点击 **API**,选择需要用到的模型,选择语言(对于文字识别模型),然后复制 `API_URL` 和 `Token`,它们分别对应服务的 API URL 和用户鉴权使用的 access token。各 skill 支持的模型如下
- `paddleocr-text-recognition`:`PP-OCRv5`
- `paddleocr-doc-parsing`:`PP-StructureV3`、`PaddleOCR-VL`、`PaddleOCR-VL-1.5`

Expand All @@ -34,6 +34,7 @@ npx skills add PaddlePaddle/PaddleOCR -g --skill paddleocr-doc-parsing -y
> ```shell
> git clone https://github.com/PaddlePaddle/PaddleOCR.git
> npx skills add ./PaddleOCR/skills/paddleocr-text-recognition
> npx skills add ./PaddleOCR/skills/paddleocr-doc-parsing
> ```

#### 方式二:通过 `clawhub` 安装(OpenClaw)
Expand Down Expand Up @@ -65,8 +66,8 @@ git clone https://github.com/PaddlePaddle/PaddleOCR.git

| Skill | 必填 | 可选 |
| --- | --- | --- |
| `paddleocr-text-recognition` | `PADDLEOCR_OCR_API_URL`(API URL)、`PADDLEOCR_ACCESS_TOKEN`(access token) | `PADDLEOCR_OCR_TIMEOUT`(API 请求超时时间) |
| `paddleocr-doc-parsing` | `PADDLEOCR_DOC_PARSING_API_URL`(API URL)、`PADDLEOCR_ACCESS_TOKEN`(access token) | `PADDLEOCR_DOC_PARSING_TIMEOUT`(API 请求超时时间) |
| `paddleocr-text-recognition` | `PADDLEOCR_OCR_API_URL`(完整端点 URL,须以 `/ocr` 结尾)、`PADDLEOCR_ACCESS_TOKEN`(access token) | `PADDLEOCR_OCR_TIMEOUT`(API 请求超时时间) |
| `paddleocr-doc-parsing` | `PADDLEOCR_DOC_PARSING_API_URL`(完整端点 URL,须以 `/layout-parsing` 结尾)、`PADDLEOCR_ACCESS_TOKEN`(access token) | `PADDLEOCR_DOC_PARSING_TIMEOUT`(API 请求超时时间) |

以下是部分 AI 应用的配置方式:

Expand Down Expand Up @@ -145,28 +146,21 @@ git clone https://github.com/PaddlePaddle/PaddleOCR.git

> 以下示例覆盖多个 skill。如果只需使用某一个 skill,只需执行该 skill 对应的命令。

执行前,请确保工作目录位于本文档所在的目录下。
执行前,请确保工作目录位于本文档所在的目录下。所有脚本均以 [PEP 723](https://peps.python.org/pep-0723/) 格式内联声明依赖,[uv](https://docs.astral.sh/uv/) 会自动解析——无需单独安装依赖。

1. 安装依赖库。

```shell
python -m pip install -r paddleocr-text-recognition/scripts/requirements.txt
python -m pip install -r paddleocr-doc-parsing/scripts/requirements.txt
# 可选依赖,仅在优化文档文件大小时需要
python -m pip install -r paddleocr-doc-parsing/scripts/requirements-optimize.txt
```

2. 配置环境变量(需要配置的变量参见[配置环境变量](#配置环境变量)一节)。
1. 配置环境变量(需要配置的变量参见[配置环境变量](#配置环境变量)一节)。

```shell
export PADDLEOCR_OCR_API_URL="<OCR_API_URL>"
export PADDLEOCR_ACCESS_TOKEN="<ACCESS_TOKEN>"
export PADDLEOCR_DOC_PARSING_API_URL="<DOC_PARSING_API_URL>"
```

3. 运行冒烟测试脚本。
2. 运行冒烟测试脚本。

```shell
python paddleocr-text-recognition/scripts/smoke_test.py
python paddleocr-doc-parsing/scripts/smoke_test.py
cd paddleocr-text-recognition && uv run scripts/smoke_test.py && cd ..
cd paddleocr-doc-parsing && uv run scripts/smoke_test.py && cd ..
```

使用 `--skip-api-test` 可只做配置检查(不发网络请求)。使用 `--test-url "https://..."` 可指定自定义测试用文档/图片 URL。
Loading
Loading