chore(server): update backend configuration files

- pyproject.toml: update project dependencies and metadata
- config.py: update application configuration settings
- openapi.py: update OpenAPI documentation
This commit is contained in:
caoxiaozhu
2026-05-12 03:01:24 +00:00
parent 4792b5074f
commit 33826929ba
3 changed files with 33 additions and 11 deletions

View File

@@ -67,6 +67,18 @@ class Settings(BaseSettings):
log_dir: str = Field(default="logs", alias="LOG_DIR")
log_file_enabled: bool = Field(default=True, alias="LOG_FILE_ENABLED")
storage_root_dir: str = Field(default="storage", alias="STORAGE_ROOT_DIR")
ocr_python_bin: str = Field(default="", alias="OCR_PYTHON_BIN")
ocr_timeout_seconds: int = Field(default=180, alias="OCR_TIMEOUT_SECONDS")
ocr_max_file_size_mb: int = Field(default=20, alias="OCR_MAX_FILE_SIZE_MB")
ocr_language: str = Field(default="ch", alias="OCR_LANGUAGE")
ocr_text_detection_model: str = Field(
default="PP-OCRv5_mobile_det",
alias="OCR_TEXT_DETECTION_MODEL",
)
ocr_text_recognition_model: str = Field(
default="PP-OCRv5_mobile_rec",
alias="OCR_TEXT_RECOGNITION_MODEL",
)
@property
def resolved_database_url(self) -> str:
@@ -85,6 +97,10 @@ class Settings(BaseSettings):
path = SERVER_DIR / path
return path.resolve()
@property
def resolved_ocr_temp_dir(self) -> Path:
return (self.resolved_storage_root_dir / "ocr_temp").resolve()
def _resolve_env_files() -> tuple[Path, ...]:
env_files = Settings.model_config.get("env_file") or ()
return tuple(Path(item) for item in env_files)

View File

@@ -27,6 +27,7 @@ X-Financial 后端 OpenAPI 文档。
- 员工目录
- 报销单
- 知识库与 ONLYOFFICE
- OCR 票据识别
- 语义本体解析
- Orchestrator 统一调度
- 系统设置与模型连通性
@@ -59,6 +60,10 @@ OPENAPI_TAGS = [
"name": "knowledge",
"description": "知识库文件管理、内容访问与 ONLYOFFICE 集成接口。",
},
{
"name": "ocr",
"description": "票据图片与 PDF 的 OCR 识别接口,当前默认对接 PaddleOCR mobile 运行时。",
},
{
"name": "ontology",
"description": "Day 3 语义本体解析接口,把自然语言问题稳定转换为 8 个核心字段。",