File size: 2,200 Bytes
55a3432
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fc46923
55a3432
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# ========== Web 框架 ==========
fastapi>=0.115,<1.0
uvicorn[standard]>=0.32,<1.0
python-multipart>=0.0.12          # 文件上传
sse-starlette>=2.1.3              # SSE 增强

# ========== 配置 ==========
pydantic>=2.9,<3.0
pydantic-settings>=2.5,<3.0
python-dotenv>=1.0

# ========== LLM 抽象 (OpenAI 兼容) ==========
openai>=1.60,<2.0                 # MiniMax-M3 / OpenAI / 兼容 provider 共用
httpx>=0.27                       # AsyncOpenAI 依赖

# ========== Agent / LangGraph ==========
langgraph>=0.3,<1.0
langchain-core>=0.3,<1.0
langgraph-checkpoint-sqlite>=2.0  # 实施前核对最新稳定版
# pydantic-ai 注释掉: 与 marker-pdf 冲突, 我们代码里不用 (会引一堆 LLM 依赖)

# ========== 文档解析 ==========
docling>=2.30,<2.74               # 主力:结构感知 + 跨页表 + OCR
pypdf>=4.0                        # 兜底:纯 Python PDF 文本提取 (零冲突, 50 行 fallback parser)
# marker-pdf 注释掉: 与 pydantic-ai 冲突 (anthropic 版本要求)
# mineru>=0.22                    # 可选:学术论文 / 复杂双栏 (按需安装)

# ========== Embedding / Reranker ==========
FlagEmbedding>=1.2                # BGE-M3 + bge-reranker-v2-m3
sentence-transformers>=3.0        # 备选 embedding 库
torch>=2.2                        # FlagEmbedding 依赖

# ========== 向量库 ==========
chromadb>=0.5,<2.0                # 1.0+ Rust core
rank-bm25>=0.2.2                  # BM25 备用 (当前用 BGE-M3 稀疏通路, 留作降级)

# ========== 持久化 ==========
huggingface_hub>=0.30             # snapshot_download / upload_folder / delete_patterns (需 >=0.20)

# ========== 分块 / NLP ==========
tiktoken>=0.7                     # token 计数
nltk>=3.9                         # 句子切分
tenacity>=9.0                     # 重试
cachetools                        # LLM 缓存

# ========== 评估 / 可观测性 ==========
# ragas>=0.2                        # RAG 质量离线评估
# deepeval>=1.0                     # 质量门禁

# ========== 测试 ==========
pytest>=8.0
pytest-asyncio>=0.23
pytest-cov>=5.0
httpx>=0.27                       # TestClient
respx>=0.21                       # mock httpx