Refactor document processing endpoint to accept file_id as a path parameter and update related logic; modify DocumentProcessRequest to make file_id optional; add clarification to tax processing rules in DocumentProcessor.
This commit is contained in:
@@ -51,22 +51,22 @@ class MatchingEngine:
|
||||
enhanced_matches = self._apply_manual_tax_analysis(
|
||||
ai_matches, user_location
|
||||
)
|
||||
else:
|
||||
# Use LLM-based tax analysis in a SINGLE batch call
|
||||
try:
|
||||
enhanced_matches = (
|
||||
self.llm_tax_analyzer.analyze_and_apply_tax_rules_batch(
|
||||
ai_matches, user_location
|
||||
)
|
||||
)
|
||||
except Exception as e:
|
||||
# If batch LLM analysis fails, log it and continue with matches as-is
|
||||
import logging
|
||||
# else:
|
||||
# # Use LLM-based tax analysis in a SINGLE batch call
|
||||
# try:
|
||||
# enhanced_matches = (
|
||||
# self.llm_tax_analyzer.analyze_and_apply_tax_rules_batch(
|
||||
# ai_matches, user_location
|
||||
# )
|
||||
# )
|
||||
# except Exception as e:
|
||||
# # If batch LLM analysis fails, log it and continue with matches as-is
|
||||
# import logging
|
||||
|
||||
logging.error(f"Batch LLM tax analysis failed: {str(e)}")
|
||||
for match in ai_matches:
|
||||
match.match_reason += " (Note: Advanced tax analysis unavailable)"
|
||||
enhanced_matches = ai_matches
|
||||
# logging.error(f"Batch LLM tax analysis failed: {str(e)}")
|
||||
# for match in ai_matches:
|
||||
# match.match_reason += " (Note: Advanced tax analysis unavailable)"
|
||||
# enhanced_matches = ai_matches
|
||||
|
||||
return enhanced_matches
|
||||
|
||||
|
||||
Reference in New Issue
Block a user