97 lines
4.1 KiB
Plaintext
97 lines
4.1 KiB
Plaintext
Process Incoming Product and Invoices: Document Extraction & Manifests
|
|
|
|
# Overview
|
|
|
|
This skill guides the automated and interactive processing of inbound supplier documents (invoices / *Rechnungen* and delivery notes / *Lieferscheine*).
|
|
It covers:
|
|
- **Document Data Extraction**: Extracting structured metadata, packaging units (VPE), units of measurement, line items, and notes from document text or images.
|
|
- **Delta & Batching Updates**: Formatting and returning extracted product and document metadata via the `output_manifest` tool.
|
|
|
|
---
|
|
|
|
# 2. Extraction Tool Specification (`output_manifest`)
|
|
|
|
The extraction engine outputs structured findings via the `output_manifest` tool call.
|
|
|
|
```json
|
|
{
|
|
"name": "output_manifest",
|
|
"description": "Stores extracted invoice/delivery-note data: header metadata (basedata), notes, and product line items. Each component is strictly optional — only include the ones that carry new data.",
|
|
"strict": false,
|
|
"parameters": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [],
|
|
"properties": {
|
|
"basedata": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"date": { "type": ["string", "null"], "description": "Document date (ISO 8601, YYYY-MM-DD)" },
|
|
"lieferant_id": { "type": ["number", "null"], "description": "Lieferant ID if matched, else null" },
|
|
"lieferantName": { "type": "string", "description": "Supplier name" },
|
|
"manifestNr": { "type": ["string", "null"], "description": "Lieferscheinnummer or Rechnungsnummer" },
|
|
"manifestType": {
|
|
"anyOf": [
|
|
{ "type": "string", "enum": ["rechnung", "lieferschein"] },
|
|
{ "type": "null" }
|
|
],
|
|
"description": "Document type"
|
|
}
|
|
}
|
|
},
|
|
{ "type": "null" }
|
|
],
|
|
"description": "Header/metadata. Only include fields that are currently missing or changed."
|
|
},
|
|
"notes": {
|
|
"anyOf": [
|
|
{ "type": "array", "items": { "type": "string" } },
|
|
{ "type": "null" }
|
|
],
|
|
"description": "New noteworthy details (in German), for a human to double-check the result."
|
|
},
|
|
"items": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"numberOfItemsToAdd": { "type": "number", "description": "Number of NEW line items being added in this call." },
|
|
"items": {
|
|
"type": "array",
|
|
"description": "Invoice/delivery product line items",
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["position", "count", "vpe", "unit", "articleName", "liefArtNr", "mwst", "eknetto"],
|
|
"properties": {
|
|
"position": { "type": "number", "description": "Position number" },
|
|
"count": { "type": "number", "description": "Quantity (Menge)" },
|
|
"vpe": { "type": "number", "description": "Packaging unit size (VPE). Default: 1." },
|
|
"unit": { "type": "string", "description": "Unit of the individual sellable item. NEVER 'VE' or 'VPE'." },
|
|
"articleName": { "type": "string", "description": "Article name" },
|
|
"liefArtNr": { "type": "string", "description": "Supplier article number" },
|
|
"mwst": {
|
|
"anyOf": [{ "type": "string", "enum": ["7", "19"] }, { "type": "null" }],
|
|
"description": "VAT rate percentage; null if delivery note or missing"
|
|
},
|
|
"eknetto": { "type": ["number", "null"], "description": "Net purchase price per VPE in euro cents; null if missing" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{ "type": "null" }
|
|
],
|
|
"description": "New product line items."
|
|
}
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
|