Контракт: примеры сообщений и результатов распознавания v1.0
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
faae87c9c7
commit
38c50c2101
14
contracts/examples/request-image.json
Normal file
14
contracts/examples/request-image.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"schema_version": "1.0",
|
||||||
|
"job_id": "8d6b1f30-2e94-4a7c-b5d8-0f1e9c3a6b03",
|
||||||
|
"file_id": "c7e2a9b4-1d58-4630-a2f7-6b4d8e0c1f04",
|
||||||
|
"pipeline": "image",
|
||||||
|
"file_type": "PDF",
|
||||||
|
"original_name": "bb_2025_q3.pdf",
|
||||||
|
"s3": {
|
||||||
|
"bucket": "arm-ka",
|
||||||
|
"key": "uploads/c7e2a9b4-1d58-4630-a2f7-6b4d8e0c1f04/8d6b1f30-2e94-4a7c-b5d8-0f1e9c3a6b03/bb_2025_q3.pdf"
|
||||||
|
},
|
||||||
|
"reply_deadline": "2026-10-03T12:45:00Z",
|
||||||
|
"attempt": 1
|
||||||
|
}
|
||||||
14
contracts/examples/request-tabular.json
Normal file
14
contracts/examples/request-tabular.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"schema_version": "1.0",
|
||||||
|
"job_id": "3f2a9c1e-7b4d-4e0a-9d51-2c8e6a1b0f01",
|
||||||
|
"file_id": "a1c4e7d2-5b36-4f89-8e12-9d0c3b7a4e02",
|
||||||
|
"pipeline": "tabular",
|
||||||
|
"file_type": "XLSX",
|
||||||
|
"original_name": "osv_60_2025_q1.xlsx",
|
||||||
|
"s3": {
|
||||||
|
"bucket": "arm-ka",
|
||||||
|
"key": "uploads/a1c4e7d2-5b36-4f89-8e12-9d0c3b7a4e02/3f2a9c1e-7b4d-4e0a-9d51-2c8e6a1b0f01/osv_60_2025_q1.xlsx"
|
||||||
|
},
|
||||||
|
"reply_deadline": "2026-10-03T12:30:00Z",
|
||||||
|
"attempt": 1
|
||||||
|
}
|
||||||
12
contracts/examples/result-error.json
Normal file
12
contracts/examples/result-error.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"schema_version": "1.0",
|
||||||
|
"job_id": "3f2a9c1e-7b4d-4e0a-9d51-2c8e6a1b0f01",
|
||||||
|
"file_id": "a1c4e7d2-5b36-4f89-8e12-9d0c3b7a4e02",
|
||||||
|
"service": { "name": "tabular-parser", "version": "0.1.0" },
|
||||||
|
"status": "error",
|
||||||
|
"error": {
|
||||||
|
"code": "NOT_IMPLEMENTED",
|
||||||
|
"message": "Разбор ОСВ пока не реализован / OSV parsing is not implemented yet"
|
||||||
|
},
|
||||||
|
"documents": []
|
||||||
|
}
|
||||||
21
contracts/examples/result-message-done.json
Normal file
21
contracts/examples/result-message-done.json
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"schema_version": "1.0",
|
||||||
|
"job_id": "8d6b1f30-2e94-4a7c-b5d8-0f1e9c3a6b03",
|
||||||
|
"file_id": "c7e2a9b4-1d58-4630-a2f7-6b4d8e0c1f04",
|
||||||
|
"status": "done",
|
||||||
|
"service": { "name": "scan-gateway", "version": "0.1.0" },
|
||||||
|
"result_s3": {
|
||||||
|
"bucket": "arm-ka",
|
||||||
|
"key": "results/c7e2a9b4-1d58-4630-a2f7-6b4d8e0c1f04/8d6b1f30-2e94-4a7c-b5d8-0f1e9c3a6b03/result.json"
|
||||||
|
},
|
||||||
|
"result_schema_version": "1.0",
|
||||||
|
"raw_s3_key": "raw/8d6b1f30-2e94-4a7c-b5d8-0f1e9c3a6b03.json",
|
||||||
|
"metrics": {
|
||||||
|
"duration_ms": 18400,
|
||||||
|
"pages": 2,
|
||||||
|
"fields_total": 4,
|
||||||
|
"fields_low_confidence": 0,
|
||||||
|
"fields_unrecognized": 0,
|
||||||
|
"warnings": []
|
||||||
|
}
|
||||||
|
}
|
||||||
11
contracts/examples/result-message-error.json
Normal file
11
contracts/examples/result-message-error.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"schema_version": "1.0",
|
||||||
|
"job_id": "3f2a9c1e-7b4d-4e0a-9d51-2c8e6a1b0f01",
|
||||||
|
"file_id": "a1c4e7d2-5b36-4f89-8e12-9d0c3b7a4e02",
|
||||||
|
"status": "error",
|
||||||
|
"service": { "name": "tabular-parser", "version": "0.1.0" },
|
||||||
|
"error": {
|
||||||
|
"code": "NOT_IMPLEMENTED",
|
||||||
|
"message": "Разбор ОСВ пока не реализован / OSV parsing is not implemented yet"
|
||||||
|
}
|
||||||
|
}
|
||||||
7
contracts/examples/result-message-processing.json
Normal file
7
contracts/examples/result-message-processing.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"schema_version": "1.0",
|
||||||
|
"job_id": "3f2a9c1e-7b4d-4e0a-9d51-2c8e6a1b0f01",
|
||||||
|
"file_id": "a1c4e7d2-5b36-4f89-8e12-9d0c3b7a4e02",
|
||||||
|
"status": "processing",
|
||||||
|
"service": { "name": "tabular-parser", "version": "0.1.0" }
|
||||||
|
}
|
||||||
79
contracts/examples/result-osv-minimal.json
Normal file
79
contracts/examples/result-osv-minimal.json
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
{
|
||||||
|
"schema_version": "1.0",
|
||||||
|
"job_id": "3f2a9c1e-7b4d-4e0a-9d51-2c8e6a1b0f01",
|
||||||
|
"file_id": "a1c4e7d2-5b36-4f89-8e12-9d0c3b7a4e02",
|
||||||
|
"service": { "name": "tabular-parser", "version": "0.1.0" },
|
||||||
|
"status": "done",
|
||||||
|
"documents": [
|
||||||
|
{
|
||||||
|
"document_type": "OSV",
|
||||||
|
"locator": "sheet:Лист_1",
|
||||||
|
"header": {
|
||||||
|
"organization_name": "ООО Ромашка",
|
||||||
|
"organization_inn": "7700000000",
|
||||||
|
"account_code_raw": "60",
|
||||||
|
"period_text": "1 квартал 2025 г.",
|
||||||
|
"period_year": 2025,
|
||||||
|
"period_quarter": "Q1",
|
||||||
|
"is_cumulative": false,
|
||||||
|
"data_type": "BU",
|
||||||
|
"currency": "RUB",
|
||||||
|
"header_variant": 1
|
||||||
|
},
|
||||||
|
"group_schema": [
|
||||||
|
{ "type": "COUNTERPARTY", "name": "Контрагенты", "has_inn": true }
|
||||||
|
],
|
||||||
|
"columns": {
|
||||||
|
"opening_debit": "C",
|
||||||
|
"opening_credit": "D",
|
||||||
|
"turnover_debit": "E",
|
||||||
|
"turnover_credit": "F",
|
||||||
|
"closing_debit": "G",
|
||||||
|
"closing_credit": "H"
|
||||||
|
},
|
||||||
|
"rows": [
|
||||||
|
{
|
||||||
|
"row_number": 1,
|
||||||
|
"level": 0,
|
||||||
|
"parent_row_number": null,
|
||||||
|
"row_value": "60",
|
||||||
|
"group_type": "ACCOUNT",
|
||||||
|
"group_name": null,
|
||||||
|
"account_code_raw": "60",
|
||||||
|
"counterparty_name": null,
|
||||||
|
"counterparty_inn": null,
|
||||||
|
"data_type": "BU",
|
||||||
|
"opening_debit": "0.00",
|
||||||
|
"opening_credit": "1000.00",
|
||||||
|
"turnover_debit": "500.00",
|
||||||
|
"turnover_credit": "200.50",
|
||||||
|
"closing_debit": "0.00",
|
||||||
|
"closing_credit": "700.50"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"row_number": 2,
|
||||||
|
"level": 1,
|
||||||
|
"parent_row_number": 1,
|
||||||
|
"row_value": "ООО Лютик, ИНН 7711111111",
|
||||||
|
"group_type": "COUNTERPARTY",
|
||||||
|
"group_name": "Контрагенты",
|
||||||
|
"account_code_raw": "60",
|
||||||
|
"counterparty_name": "ООО Лютик",
|
||||||
|
"counterparty_inn": "7711111111",
|
||||||
|
"data_type": "BU",
|
||||||
|
"opening_debit": "0.00",
|
||||||
|
"opening_credit": "1000.00",
|
||||||
|
"turnover_debit": "500.00",
|
||||||
|
"turnover_credit": "200.50",
|
||||||
|
"closing_debit": "0.00",
|
||||||
|
"closing_credit": "700.50"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"checks": {
|
||||||
|
"total_row_matches_root": true,
|
||||||
|
"balance_identity_violations": [],
|
||||||
|
"parent_sum_violations": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
50
contracts/examples/result-statement-minimal.json
Normal file
50
contracts/examples/result-statement-minimal.json
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
{
|
||||||
|
"schema_version": "1.0",
|
||||||
|
"job_id": "8d6b1f30-2e94-4a7c-b5d8-0f1e9c3a6b03",
|
||||||
|
"file_id": "c7e2a9b4-1d58-4630-a2f7-6b4d8e0c1f04",
|
||||||
|
"service": { "name": "scan-gateway", "version": "0.1.0" },
|
||||||
|
"status": "done",
|
||||||
|
"raw_s3_key": "raw/8d6b1f30-2e94-4a7c-b5d8-0f1e9c3a6b03.json",
|
||||||
|
"documents": [
|
||||||
|
{
|
||||||
|
"document_type": "BALANCE",
|
||||||
|
"locator": "pages:1-2",
|
||||||
|
"header": {
|
||||||
|
"form_name": "Бухгалтерский баланс",
|
||||||
|
"organization_name": "ООО Ромашка",
|
||||||
|
"organization_name_confidence": 97.5,
|
||||||
|
"inn": "7700000000",
|
||||||
|
"inn_confidence": 99,
|
||||||
|
"report_date_text": "30 сентября 2025 г.",
|
||||||
|
"report_date": "2025-09-30",
|
||||||
|
"units": "тыс. руб."
|
||||||
|
},
|
||||||
|
"columns": [
|
||||||
|
{ "column_index": 0, "label": "На 30 сентября 2025 г.", "period_date": "2025-09-30" },
|
||||||
|
{ "column_index": 1, "label": "На 31 декабря 2024 г.", "period_date": "2024-12-31" }
|
||||||
|
],
|
||||||
|
"lines": [
|
||||||
|
{
|
||||||
|
"line_code": "1100",
|
||||||
|
"line_code_confidence": 99,
|
||||||
|
"line_name": "Итого по разделу I",
|
||||||
|
"line_name_confidence": 96,
|
||||||
|
"values": [
|
||||||
|
{ "column_index": 0, "amount": "1234.50", "confidence": 95, "is_recognized": true },
|
||||||
|
{ "column_index": 1, "amount": "1100", "confidence": 93, "is_recognized": true }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"line_code": "1600",
|
||||||
|
"line_code_confidence": 99,
|
||||||
|
"line_name": "БАЛАНС (актив)",
|
||||||
|
"line_name_confidence": 98,
|
||||||
|
"values": [
|
||||||
|
{ "column_index": 0, "amount": "5678.00", "confidence": 94.5, "is_recognized": true },
|
||||||
|
{ "column_index": 1, "amount": "-12.30", "confidence": 90, "is_recognized": true }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user