(image_files: list, output_path: Path)
| 433 | LLM_CONFIG = load_llm_config() |
| 434 | |
| 435 | # 初始化 OpenAI 客户端 (兼容模式) |
| 436 | client = AsyncOpenAI( |
| 437 | api_key=LLM_CONFIG["api_key"], |
| 438 | base_url=LLM_CONFIG["base_url"] |
| 439 | ) |
| 440 | |
| 441 | base_dir = os.getenv("BASE_DIR") |
| 442 | if base_dir: |
| 443 | input_path = Path(base_dir) / "mark" / "input_image" |
| 444 | output_path = Path(base_dir) / "raw_content" |
| 445 | else: |
| 446 | input_path_str = os.getenv("QWEN_VL_EXTRACT_INPUT") |
| 447 | output_path_str = os.getenv("QWEN_VL_EXTRACT_OUTPUT") |
| 448 | |
| 449 | if not input_path_str or not output_path_str: |
| 450 | print("错误:未设置必要的环境变量 QWEN_VL_EXTRACT_INPUT 或 QWEN_VL_EXTRACT_OUTPUT") |
| 451 | sys.exit(1) |
| 452 | |
| 453 | input_path = Path(input_path_str) |
| 454 | output_path = Path(output_path_str) |
| 455 |
no test coverage detected