From 75eb489fc3d86b3517f1b6fac529d193a86b2072 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 13 Oct 2026 10:03:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(bioflow):=20main.py=20=E5=8A=A0=20load=5Fdo?= =?UTF-8?q?tenv=20=E6=8A=8A=20.env=20=E6=B3=A8=E5=85=A5=20os.environ?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E8=A7=84=E5=88=92=20LLM=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=AD=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bioflow_service/app/main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bioflow_service/app/main.py b/bioflow_service/app/main.py index aa04d66..9bced0c 100644 --- a/bioflow_service/app/main.py +++ b/bioflow_service/app/main.py @@ -10,6 +10,13 @@ from __future__ import annotations import logging +from pathlib import Path + +from dotenv import load_dotenv + +# 把 bioflow_service/.env 注入 os.environ(llm.py 等模块直读 DOCGEN_LLM_*, +# 不走 pydantic-settings 的 env_file,避免「.env 配了但 os.environ 读不到」的配置断层)。 +load_dotenv(Path(__file__).resolve().parent.parent / ".env") from contextlib import asynccontextmanager from fastapi import FastAPI