extract-json
GitHub基于 Schema 从自由文本中提取结构化 JSON 数据,支持联系信息、发票等字段提取。通过调用 ZeroGPU API 执行,需严格遵循命令格式与元数据规范。
Trigger Scenarios
Install
npx skills add zerogpu/zerogpu-router --skill extract-json -g -y
SKILL.md
Frontmatter
{
"name": "extract-json",
"metadata": {
"openclaw": {
"install": [
{
"bins": [
"zerogpu"
],
"kind": "node",
"package": "zerogpu-cli"
}
],
"requires": {
"bins": [
"zerogpu"
]
}
}
},
"description": "Schema-driven structured JSON extraction (gliner2-base-v1). Use when the user wants to pull specific named fields out of free text into a JSON object — contact info, invoice details, order data, profile attributes — defined by a per-field type\/description schema.",
"allowed-tools": "Bash(zerogpu chat_completions *)",
"argument-hint": "<text> -s '<json schema>'"
}
Sends your input to ZeroGPU's hosted API for inference — this is not local processing. Don't pass secrets, credentials, or regulated data you aren't cleared to share with a third party. See the plugin README's "Data & privacy" section.
Run structured JSON extraction. The user gives the source text and the fields to extract, as -s '<json>' or in plain words.
Run this with the exec tool, putting the schema in --metadata and pasting the text into the heredoc verbatim — no escaping, the quoted heredoc handles every shell metacharacter, newline, quote, and paren:
zerogpu chat_completions -m gliner2-base-v1 --metadata '{"usecase":"json","schema":{"contact":["name::str::Full name","email::str::Email address","phone::str::Phone number"]}}' <<'ZGPU_END_OF_INPUT'
<the source text, verbatim>
ZGPU_END_OF_INPUT
"usecase":"json"is required exactly as written; the API rejects the request without it.schemamaps each group to its fields, and each field isname::type::description. If the user names fields in plain words, build the schema from them.--metadatais single-quoted JSON, so write any'inside a description as'\''.
Output is a JSON object whose data holds the extracted fields, keyed by group.
Savings note: only if the command output literally contains a line starting with 💰 ZeroGPU savings, append that exact line, unchanged, as the last line of your reply. If no such line is present, say nothing about savings and do not mention or suggest the cost-savings skill — this note is intentionally occasional, not shown every time.
Version History
-
4e1b070
Current 2026-09-22 08:08
v4.3.1至v4.4.0:改用zerogpu-cli的模型无关端点命令,技能体由!块改为exec指令,确保插件独立于CLI模型变化。
-
cee9321
2026-08-02 21:16
更新依赖库并修复安全漏洞。
- 7b9b503 2026-07-24 11:48


