51 lines
2.2 KiB
Python
51 lines
2.2 KiB
Python
from pathlib import Path
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
app_name: str = "AI Contract Platform"
|
|
app_env: str = "development"
|
|
api_v1_prefix: str = "/api/v1"
|
|
review_pdf_ocr_enabled: bool = True
|
|
review_pdf_ocr_languages: str = "chi_sim+eng"
|
|
review_pdf_ocr_max_pages: int = 6
|
|
review_pdf_ocr_render_scale: float = 2.0
|
|
review_pdf_ocr_block_min_chars: int = 40
|
|
review_pdf_ocr_warn_min_chars: int = 120
|
|
review_pdf_ocr_block_min_confidence: float = 45.0
|
|
review_pdf_ocr_warn_min_confidence: float = 70.0
|
|
review_pdf_ocr_warn_max_noise_ratio: float = 0.18
|
|
review_pdf_ocr_block_max_noise_ratio: float = 0.35
|
|
shared_ai_platform_base_url: str = ""
|
|
shared_ai_platform_api_prefix: str = "/api/v0.1"
|
|
shared_ai_platform_app_id: str = "ai-contract-platform"
|
|
shared_ai_platform_api_key: str = ""
|
|
shared_ai_platform_timeout_seconds: float = 30.0
|
|
shared_ai_platform_legal_review_enabled: bool = True
|
|
shared_ai_platform_legal_review_fallback_to_local: bool = False
|
|
prompt_golden_eval_mode: str = "auto"
|
|
prompt_golden_eval_include_raw_model_response: bool = False
|
|
legal_change_impact_semantic_enabled: bool = True
|
|
legal_change_impact_semantic_threshold: float = 0.10
|
|
legal_change_impact_worker_enabled: bool = True
|
|
legal_change_impact_worker_batch_size: int = 10
|
|
legal_change_impact_worker_interval_seconds: int = 300
|
|
legal_change_impact_worker_user_id: str = "system-legal-change-worker"
|
|
secret_key: str = "change-me"
|
|
access_token_expire_minutes: int = 120
|
|
database_url: str = "postgresql+psycopg://postgres:postgres@localhost:5432/ai_contract_platform"
|
|
redis_url: str = "redis://localhost:6379/0"
|
|
minio_endpoint: str = "localhost:9000"
|
|
minio_access_key: str = "minioadmin"
|
|
minio_secret_key: str = "minioadmin"
|
|
minio_bucket: str = "contracts"
|
|
minio_secure: bool = False
|
|
file_storage_backend: str = "minio"
|
|
local_storage_dir: str = str(Path(__file__).resolve().parents[2] / "storage")
|
|
|
|
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")
|
|
|
|
|
|
settings = Settings()
|