(data: bytes, prompt_text: str, include_debug: bool)
| 86 | "available": not missing, |
| 87 | "missing_dependencies": missing, |
| 88 | "include_debug": self.settings.tencent_ocr_include_debug, |
| 89 | "workers": self.settings.tencent_ocr_workers, |
| 90 | "timeout_seconds": self.settings.tencent_ocr_timeout_seconds, |
| 91 | "executor_ready": self._executor is not None, |
| 92 | "engine_bootstrapped": self._engine_bootstrapped, |
| 93 | } |
| 94 | |
| 95 | def warmup(self) -> None: |
| 96 | if not self.settings.tencent_ocr_enabled: |
| 97 | return |
| 98 | missing = self._missing_dependencies() |
| 99 | if missing: |
| 100 | raise BadRequestError( |
| 101 | "本地 OCR 依赖没装全,先运行 pip install -r requirements.txt,别让发动机缺缸还硬跑。", |
| 102 | details={"missing_dependencies": missing}, |
| 103 | ) |
| 104 | self._bootstrap_engine_once() |
nothing calls this directly
no test coverage detected