2026-05-20 21:39:12 +08:00

82 lines
2.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
name: vehicle-invoice-ocr
description: 机动车销售发票识别。使用多模态大模型识别机动车销售统一发票的发票代码、号码、开票日期、购买方、车辆类型、厂牌型号、车架号码、发动机号码、价税合计、销货单位等关键字段支持URL、base64和PDF输入不需要百度OCR API Key。
license: MIT
metadata:
version: "1.1.0"
category: ocr
skillType: compute-entry
tags: ["ocr", "vehicle-invoice", "机动车发票", "多模态", "投保审核"]
---
# 机动车销售发票识别
当需要从机动车销售统一发票图片或PDF中提取结构化字段时使用本技能。本技能不调用百度 OCR也不需要配置百度 API Key。
推荐流程:
1. 让多模态大模型直接查看 `imageUrl``imageBase64``pdfUrl``pdfBase64` 中的发票。
2. 按本技能输出 schema 让模型只返回 JSON。
3. 将模型返回 JSON 作为 `modelResult` 传入本技能,做字段归一化和稳定输出。
```json
{
"name": "vehicle-invoice-ocr",
"input": {
"imageUrl": "https://example.com/vehicle-invoice.jpg",
"modelResult": {
"fields": {
"buyerName": "张三",
"vin": "LS6D3G0Y0NA500002",
"engineNo": "ABC123456",
"issueDate": "2026-04-27"
}
}
}
}
```
如果没有传 `modelResult`,本技能会返回 `needsModelVision:true` 和一段可直接给多模态模型使用的 `prompt`
## 输入
- `imageUrl`: 发票图片URL。
- `imageBase64`: 发票图片base64支持 `data:image/...;base64,` 前缀。
- `pdfUrl`: 发票PDF URL。
- `pdfBase64`: 发票PDF base64支持 `data:application/pdf;base64,` 前缀。
- `modelResult`: 可选,多模态模型识别后的 JSON 对象或 JSON 字符串。
- `ocrResult`: 可选,等同于 `modelResult`
- `mockResult`: 可选,联调用 JSON 对象或 JSON 字符串。
- `fields`: 可选,直接传入已识别字段对象。
## 输出
成功时输出:
```json
{
"success": true,
"fields": {
"invoiceCode": "050002300111",
"invoiceNumber": "12345678",
"issueDate": "2026-04-27",
"buyerName": "张三",
"vehicleType": "乘用车",
"brandModel": "阿维塔...",
"vin": "LS6D3G0Y0NA500002",
"engineNo": "ABC123456",
"totalAmount": "245000.00",
"sellerName": "重庆某汽车销售服务有限公司"
},
"raw": {}
}
```
未传模型识别结果时输出 `success:false``needsModelVision:true``prompt`,不会向 stdout 输出非 JSON 内容。
## 注意
- 本技能只负责发票识别结果归一化,不做投保业务审核。
- 在 TYCM AI 审核链路中,如果本技能返回 `success:false` 或执行异常,后续编排仍应调用 `tycm-callback`,向 TYCM 的 `/agent-invoke-callback` 回推 `status:"failed"` 和失败原因。
- 字段和提示词细节见 `references/multimodal_vehicle_invoice_ocr.md`