feat: multimodal RAG with PDF image extraction and display
Extract images from PDFs using pymupdf, generate descriptions via Qwen3-VL-8B, store in ChromaDB alongside text chunks, and render images in chat answers. Includes image proxy rewrite, force re-process endpoint, and VLM API timeout. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -197,6 +197,11 @@ if os.path.exists(settings.upload_dir):
|
||||
if os.path.exists(settings.generated_images_dir):
|
||||
app.mount("/generated_images", StaticFiles(directory=settings.generated_images_dir), name="generated_images")
|
||||
|
||||
# 挂载PDF图片提取目录
|
||||
IMAGES_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), "data", "images")
|
||||
os.makedirs(IMAGES_DIR, exist_ok=True)
|
||||
app.mount("/images", StaticFiles(directory=IMAGES_DIR), name="images")
|
||||
|
||||
# 根路径
|
||||
@app.get("/")
|
||||
async def root():
|
||||
|
||||
Reference in New Issue
Block a user