Files
ai-contract-platform/infra/env/backend.3.90.env.example
T
yuqei 6d2edc6753 feat: migrate PDF/OCR extraction to shared-ai-platform
Remove all local PDF/OCR extraction and quality gate logic from
review_service.py, replacing it with calls to the shared-ai-platform
document extraction service via the SDK.

Removed from review_service.py:
- 17 local PDF/OCR methods (_extract_text_from_pdf, _classify_pdf_source,
  _extract_text_from_pdf_with_ocr, _extract_text_from_image_with_ocr,
  _evaluate_ocr_quality, _looks_like_platform_review_report, etc.)
- All PDF/OCR constants (PDF_TEXT_PATTERN, PDF_NOISE_LINE_PATTERN,
  REPORT_PDF_MARKERS, OCR_GATE_*, PDF_SOURCE_KIND_*, etc.)
- Imports: pdfplumber, pypdfium2, pytesseract, PIL.Image

Added:
- extract_review_upload_text() now calls shared platform's
  client.extract_document_text() directly
- _detect_upload_type() retained locally for upload validation only
- Protocol methods extract_document_text, classify_pdf_source in client

Removed from requirements.txt: pdfplumber, pytesseract
Added to config: shared_ai_platform_document_extraction_enabled

Also includes prior changes:
- Model settings and chat history stabilization
- Mobile UI polish
- Governance launch-closure enhancements

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 11:09:13 +08:00

21 lines
1005 B
Bash

APP_NAME=AI Contract Platform
APP_ENV=production
SECRET_KEY=replace-with-strong-random-secret-at-least-32-characters
DATABASE_URL=postgresql+psycopg://postgres:replace-with-password@172.17.0.1:5432/ai_contract_platform
REDIS_URL=redis://redis:6379/0
MINIO_ENDPOINT=192.168.3.90:9000
MINIO_ACCESS_KEY=replace-with-minio-access-key
MINIO_SECRET_KEY=replace-with-minio-secret-key
MINIO_BUCKET=contracts
SHARED_AI_PLATFORM_BASE_URL=http://192.168.3.90:18011
# Default shared-ai contract version is v0.2. Override to /api/v0.1 only for temporary compatibility with legacy deployments.
SHARED_AI_PLATFORM_API_PREFIX=/api/v0.2
SHARED_AI_PLATFORM_APP_ID=ai-contract-platform
SHARED_AI_PLATFORM_API_KEY=replace-with-shared-ai-platform-api-key
SHARED_AI_PLATFORM_TIMEOUT_SECONDS=180
SHARED_AI_PLATFORM_LEGAL_REVIEW_ENABLED=true
SHARED_AI_PLATFORM_LEGAL_REVIEW_FALLBACK_TO_LOCAL=false
LEGAL_CHANGE_IMPACT_WORKER_BATCH_SIZE=10
LEGAL_CHANGE_IMPACT_WORKER_INTERVAL_SECONDS=300
LEGAL_CHANGE_IMPACT_SEMANTIC_ENABLED=true