Image2text Ocr
v1.0.4将图片中的文字信息识别并提取出来。本技能应在用户需要 OCR 识别图片中的文字时使用。
Security Scan
Capability signals
These labels describe what authority the skill may exercise. They are separate from suspicious or malicious moderation verdicts.
OpenClaw
Benign
high confidencePurpose & Capability
The skill is an OCR client that calls https://api.scnet.cn/api/llm/v1/ocr/recognize and therefore reasonably needs an SCNET_API_KEY (and optionally SCNET_API_BASE). The only minor inconsistency is that the top-level registry summary in the provided metadata said "Required env vars: none" while the SKILL.md and skill.yaml correctly declare SCNET_API_KEY as required.
Instruction Scope
Runtime instructions and the Python script only read a local config file (config/.env) for the API key, read a user-specified local image file path, and POST that file to the Scnet API. The SKILL.md explicitly instructs where to store the key and warns not to paste it into chat. There are no instructions to read unrelated files, shell history, or to send data to any endpoint other than the declared Scnet API.
Install Mechanism
This is an instruction-only skill with an included Python script; there is no install spec that downloads external archives or runs installers. Dependencies are limited to python3 and the requests library, which is expected for this task.
Credentials
The only credential required is SCNET_API_KEY (primary_credential) and an optional SCNET_API_BASE. That aligns with the stated purpose. No unrelated secrets, system credentials, or config paths are requested. The script reads config/.env and the supplied filePath only.
Persistence & Privilege
The skill does not request always:true and has no install steps that modify other skills or system-wide agent settings. It does not persist credentials beyond reading the .env file in its own directory.
Assessment
This skill appears to do what it claims: it sends a local image file to the Scnet OCR API and prints the JSON result. Before installing, verify you trust the Scnet service (https://www.scnet.cn) and its privacy policy. Store your SCNET_API_KEY securely (use a file with 600 permissions or an environment variable) and do not paste the key into chat. Be aware the skill will read any local file path you provide — avoid sending images that contain sensitive data you don't want uploaded to the external OCR service. Also note the small metadata mismatch (registry summary showed no required env var while the skill requires SCNET_API_KEY); confirm the platform will provide the API key securely or that you will create config/.env as instructed.Like a lobster shell, security has layers — review code before you run it.
latest
Sugon-Scnet 通用 OCR 技能
本技能封装了 Sugon-Scnet 通用 OCR 服务,通过单一接口即可调用ocr识别能力,高效提取文字信息。
功能特性
- 通用文字识别:提取图片中的全部文字,支持横竖版及坐标定位。
前置配置
⚠️ 重要:使用前需要申请 Scnet API Token
申请 API Token
- 访问 Scnet 官网 注册/登录
- 在控制台申请 API 密钥(格式:
sc-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx) - 复制密钥备用
配置 Token
手动配置(推荐)
- 在技能目录下创建
config/.env文件,内容如下:
# ===== Sugon-Scnet OCR API 配置 =====
# 申请地址:https://www.scnet.cn
SCNET_API_KEY=your_scnet_api_key_here
# API 基础地址(一般无需修改)
SCNET_API_BASE=https://api.scnet.cn/api/llm/v1
- 添加:
SCNET_API_KEY=你的密钥 - 设置文件权限为 600(仅所有者可读写) ⚠️ 安全警告:切勿将 API Key 直接粘贴到聊天对话中,否则可能被记录或泄露。
Token 更新
Token 过期后调用会返回 401 或 403 错误。更新方法:重新申请 Token 并替换 config/.env 中的 SCNET_API_KEY。
依赖安装
本技能需要 Python 3.6+ 和 requests 库。请运行以下命令:
pip install requests
使用方法
参数说明
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| ocrType | string | 是 | 识别类型枚举。必须为以下之一:<br>• GENERAL 通用文字 |
| filePath | string | 是 | 待识别图片的本地绝对路径。支持 jpg、png、pdf 等常见格式。 |
命令行调用示例
python .claude/skills/sugon-scnet-ocr/scripts/main.py VAT_INVOICE /path/to/invoice.jpg
在 AI 对话中使用
用户可以说:
- “OCR 这个图片里的文字,图片在 /Users/name/Desktop/text.png”
AI 会根据 description 中的关键词自动触发本技能。
AI 调用建议
为避免触发 API 速率限制(10 QPS),请串行调用本技能,即等待前一个识别完成后再发起下一个请求。 如果使用 OpenClaw 的 exec 工具,建议设置 timeout 或 yieldMs 参数,让命令同步执行,避免多个命令同时运行导致并发。
配置选项
编辑 config/.env 文件:
| 变量名 | 默认值 | 说明 |
|---|---|---|
| SCNET_API_KEY | 必需 | Scnet API 密钥 |
| SCNET_API_BASE | https://api.scnet.cn/api/llm/v1 | API 基础地址(一般无需修改) |
输出
- 标准输出:识别结果的 JSON 数据,结构与 API 文档一致,位于
data字段内。 - 识别结果位于 data[0].result[0].elements 中,具体字段取决于 ocrType。
- 错误信息:如果发生错误,会输出以
错误:开头的友好提示。
注意事项
- 本技能调用的 OCR API 有 10 QPS 的速率限制。
- 如果遇到 429 错误,请等待 2-3 秒后重试,不要连续发起请求。
- 建议在调用前确保图片已准备就绪,避免因网络问题导致重复调用。
故障排除
| 问题 | 解决方案 |
|---|---|
| 配置文件不存在 | 创建 config/.env 并填入 Token(参考前置配置) |
| API Key 无效/过期 | 重新申请 Token 并更新 .env 文件 |
| 文件不存在 | 检查提供的文件路径是否正确 |
| 网络连接失败 | 检查网络连接或防火墙设置 |
| 不支持的文件类型 | 确保文件扩展名为允许的类型(参考 API 文档) |
| 401/403/Unauthorized | Token 无效或过期,重新申请并配置 |
| 429 Too Many Requests | 请求过于频繁,技能会自动等待并重试(最多 3 次)。若持续失败,请降低调用频率或联系服务方提高限额。 |
Comments
Loading comments...
