安装方式
命令行安装
在项目根目录执行以下命令,完成 Skill 安装。
npx bzskills add zai-org/GLM-skills --skill glmocr 使用 GLM-OCR API 从图片中提取文本。支持图片和 PDF 文件,具备高精度 OCR、表格识别、公式提取和手写识别功能。当用户需要从图片中提取文本、对图片执行 OCR、扫描文档、将图片转换为文本,或处理任何图像文件以获取其文字内容时,请使用此技能。
165
下载量
命令行安装
在项目根目录执行以下命令,完成 Skill 安装。
npx bzskills add zai-org/GLM-skills --skill glmocr name: glmocr
description: 使用 GLM-OCR API 从图片中提取文本。支持图片和 PDF 文件,具备高精度 OCR、表格识别、公式提取和手写识别功能。当用户需要从图片中提取文本、对图片执行 OCR、扫描文档、将图片转换为文本,或处理任何图像文件以获取其文字内容时,请使用此技能。
metadata:
openclaw:
requires:
env:
- ZHIPU_API_KEY
- GLM_OCR_TIMEOUT
primaryEnv: ZHIPU_API_KEY
emoji: "\U0001F4C4"
homepage: https://github.com/zai-org/GLM-OCR/tree/main/skills/glmocrExtract text from images and PDFs using the GLM-OCR layout parsing API.
| Resource | Link |
|---|---|
| Get API Key | https://www.bigmodel.cn/usercenter/proj-mgmt/apikeys |
| GitHub | https://github.com/zai-org/GLM-OCR |
ZHIPU_API_KEY (and optional timeout) is read from environment variables.⛔ MANDATORY RESTRICTIONS - DO NOT VIOLATE ⛔
python scripts/glm_ocr_cli.py python scripts/config_setup.py setup --api-key YOUR_KEY
python scripts/glm_ocr_cli.py --file-url "URL provided by user"
python scripts/glm_ocr_cli.py --file /path/to/image.jpg
python scripts/glm_ocr_cli.py --file-url "URL" --output result.json
python {baseDir}/scripts/glm_ocr_cli.py (--file-url URL | --file PATH) [--output FILE] [--pretty]
| Parameter | Required | Description |
|---|---|---|
--file-url | One of | URL to image/PDF |
--file | One of | Local file path to image/PDF |
--output, -o | No | Save result JSON to file |
--pretty | No | Pretty-print JSON output |
{
"ok": true,
"text": "# Extracted text in Markdown...",
"layout_details": [[...]],
"result": { "raw_api_response": "..." },
"error": null,
"source": "/path/to/file.jpg",
"source_type": "file"
}
Key fields:
ok — whether extraction succeededtext — extracted text in Markdown (use this for display)layout_details — layout analysis detailsresult — raw API responseerror — error details on failureAPI key not configured:
Error: ZHIPU_API_KEY not configured. Get your API key at: https://www.bigmodel.cn/usercenter/proj-mgmt/apikeys
→ Show exact error to user, guide them to configure
Authentication failed (401/403): API key invalid/expired → reconfigure
Rate limit (429): Quota exhausted → inform user to wait
File not found: Local file missing → check path
references/output_schema.md — detailed output format specification