feat: Implement core application structure, AI extraction, persistence, and Telegram bot modules with updated configuration and dependencies.

This commit is contained in:
Marco Gallegos
2025-12-18 12:15:04 -06:00
parent 7276e480b0
commit 899482580e
45 changed files with 1157 additions and 225 deletions

16
app/ai/confidence.py Normal file
View File

@@ -0,0 +1,16 @@
"""
Functions for calculating confidence scores.
"""
def calculate_confidence(extracted_data: dict) -> float:
"""
Calculates a confidence score based on the quality of the extracted data.
Stub function.
"""
score = 1.0
# Lower score if key fields are missing
if not extracted_data.get("amount"):
score -= 0.5
if not extracted_data.get("description"):
score -= 0.3
return max(0.0, score)