fix: 补充 __init__.py 导出符号,修复测试导入错误

- src/core/extraction/__init__.py: 导出 _image_to_base64
- src/core/matching/__init__.py: 导出所有内部函数(_build_invoice_summary, _build_payment_records, _invoices_to_records, _match, _match_by_filename, _match_one_to_many, _match_one_to_one, _relative_tolerance, _safe_float)
- src/infra/documents/__init__.py: 导出 INVOICE_LEVEL_COLUMNS, PAYMENT_RECORD_COLUMNS
- tests/test_extractor.py: 修正 monkeypatch 路径为模块级引用
This commit is contained in:
wandering
2026-07-02 18:51:59 +08:00
parent 8a9c144637
commit 44496a54e6
4 changed files with 35 additions and 7 deletions
+2
View File
@@ -11,6 +11,7 @@ from .extractor import (
)
from .llm_extractor import (
CACHE_DIR_NAME,
_image_to_base64,
build_extraction_user_message,
extract_document,
extract_normal_info,
@@ -25,6 +26,7 @@ from .llm_extractor import (
__all__ = [
"CACHE_DIR_NAME",
"_image_to_base64",
"build_extraction_user_message",
"extract_document",
"extract_normal_info",
+24 -2
View File
@@ -3,6 +3,28 @@
提供发票与支付记录的金额匹配功能。
"""
from .matcher import match_invoices_to_cards
from .matcher import (
_build_invoice_summary,
_build_payment_records,
_invoices_to_records,
_match,
_match_by_filename,
_match_one_to_many,
_match_one_to_one,
_relative_tolerance,
_safe_float,
match_invoices_to_cards,
)
__all__ = ["match_invoices_to_cards"]
__all__ = [
"_build_invoice_summary",
"_build_payment_records",
"_invoices_to_records",
"_match",
"_match_by_filename",
"_match_one_to_many",
"_match_one_to_one",
"_relative_tolerance",
"_safe_float",
"match_invoices_to_cards",
]