Install
openclaw skills install @diyanqi/composition-correction墨灵高考作文批改。调用 InkCraft API 提交批改并返回结构化结果。
openclaw skills install @diyanqi/composition-correctioncomposition-correction墨灵高考作文批改1.0.0latest当用户请求“批改作文/高考作文打分/作文优化建议”时,使用本 Skill。
在调用 API 前,确保以下字段存在:
originalText:作文题目或材料essayText:学生作文正文可选字段:
titlemodel(默认 doubao)essayType(默认 gaokao-chinese)tone(默认 strict)referenceTextfirstSentencesecondSentence如果缺少 originalText 或 essayText,先向用户追问,不要发起请求。
默认使用:
https://www.inkcraft.cnPOST /api/skills/essay-correctionGET /api/skills/correction-result?uuid=<uuid>优先读取环境变量(若存在):
INKCRAFT_BASE_URL(可选)INKCRAFT_API_KEY(必需)优先使用可执行命令工具(如 system.run)通过 curl 调用 API。
执行等价请求:
BASE_URL="${INKCRAFT_BASE_URL:-https://www.inkcraft.cn}"
curl -sS -X POST "$BASE_URL/api/skills/essay-correction" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $INKCRAFT_API_KEY" \
-H "x-api-key: $INKCRAFT_API_KEY" \
-d '<JSON_PAYLOAD>'
判定:
success=true 且含 uuid,进入查询阶段。Invalid API key,停止并提示用户更新 API Key。最多轮询 3 次,每次间隔 2-5 秒:
BASE_URL="${INKCRAFT_BASE_URL:-https://www.inkcraft.cn}"
curl -sS "$BASE_URL/api/skills/correction-result?uuid=<uuid>" \
-H "Authorization: Bearer $INKCRAFT_API_KEY" \
-H "x-api-key: $INKCRAFT_API_KEY"
判定:
done=false:继续轮询。done=true 且 status=success:输出结构化结果。status=error:输出失败原因和重试建议。最终回复使用以下结构:
https://www.inkcraft.cn