[project] name = "demo-python-agent" version = "0.1.0" description = "Python AI Agent 学习项目(docs 涵盖阶段一~阶段八)" requires-python = ">=3.10" # ========================================================= # 依赖按 docs 学习阶段分组整理 # 阶段一:前置核心基础(Python 高级编程 / 大模型与 Prompt / 软件工程) # 阶段三:主流 Agent 开发框架(LangGraph / LlamaIndex / CrewAI / AutoGen) # 阶段四:工具生态与外围组件(向量库 / RAG / MCP / 检索) # 阶段五:进阶技术(评测 / 记忆 / 多智能体) # 阶段六:垂直领域 Agent(数据分析 / 客服 / 办公自动化) # 阶段七:工程化部署与运维(FastAPI / Docker / 监控) # 阶段八:实战项目(Level1~Level5 + Streamlit Demo) # ========================================================= dependencies = [ # ---------- 阶段一:前置核心基础 ---------- # 数据校验 / 配置 "pydantic>=2.0", "pydantic-settings>=2.0", # 日志 / 重试 / 环境变量 "loguru>=0.7", "tenacity>=8.0", "python-dotenv>=1.0", # 数据分析 Agent 基础 "pandas>=2.0", "numpy>=1.24", # HTTP(异步取代 requests,外呼统一用 httpx) "httpx>=0.27", "requests>=2.31", # 主流模型 SDK(OpenAI / Claude / DeepSeek / Ollama 走 OpenAI 兼容接口) "openai>=1.30", "anthropic>=0.30", # ---------- 阶段三:主流 Agent 开发框架 ---------- # 必修:LangChain + LangGraph(生产级 Agent 事实标准) "langchain>=0.3", "langgraph>=0.2", # LangChain 各家 ChatModel 集成包 "langchain-openai>=0.2", "langchain-anthropic>=0.2", "langchain-deepseek>=0.1", "langchain-ollama>=0.2", # langchain-community 锁定 0.3.x:0.4+ 移除了 ragas 0.4.3 仍依赖的 ChatVertexAI "langchain-community>=0.3.27,<0.4", "langchain-core>=0.3", # LlamaIndex:RAG 数据接入与检索框架 "llama-index>=0.12", # 选学:多智能体框架(了解选型) "crewai>=0.80", # ---------- 阶段四:工具生态与外围组件 ---------- # 向量数据库(轻量 + 生产) "chromadb>=0.5", "qdrant-client>=1.10", "faiss-cpu>=1.8", # 文件处理:PDF / Excel "pymupdf>=1.24", "openpyxl>=3.1", # OCR(图片文字识别) "paddleocr>=2.7", # MCP 协议 SDK(Anthropic 开源的 Agent 工具接入标准) "mcp[cli]>=1.0", # 代码执行沙箱(E2B 云沙箱,可选) "e2b-code-interpreter>=1.0", # Embedding / Reranker(BGE 等中文向量模型) "sentence-transformers>=3.0", # BM25 稀疏检索(混合检索标配) "rank-bm25>=0.2", # ---------- 阶段五:进阶技术 ---------- # RAG 评估(忠实度 / 答案相关性 / 检索质量) "ragas>=0.1", # LangChain 链路追踪与评估平台 "langsmith>=0.1", # 开源可自托管追踪(数据合规场景首选) "langfuse>=2.0", # VertexAI 集成:ragas 0.4.3 仍从 langchain_community.chat_models.vertexai 拉 ChatVertexAI, # 但该路径在新版 langchain-community 中已迁移到独立包;装此包并配 sitecustomize.py 兜底。 "langchain-google-vertexai>=2.0", # ---------- 阶段七:工程化部署与运维 ---------- # Web 框架 + ASGI 服务(Agent 服务接入层) "fastapi>=0.110", "uvicorn[standard]>=0.30", # 数据库 "sqlalchemy>=2.0", "psycopg[binary]>=3.2", # 会话缓存 / 队列 broker "redis>=5.0", # 异步任务队列(worker 消费 Agent 长任务) "arq>=0.25", # 监控三支柱:Metrics "prometheus-client>=0.20", # 监控三支柱:Traces(OTel 协议) "opentelemetry-api>=1.27", "opentelemetry-sdk>=1.27", "opentelemetry-exporter-otlp>=1.27", # 对象存储(原始文档 / 大附件) "minio>=7.2", # ---------- 阶段八:实战项目 ---------- # Streamlit:Agent Demo 前端 "streamlit>=1.30", "langchain-vertexai-shim", ] [dependency-groups] dev = [ # 测试 / 静态检查 / 代码风格(项目分层骨架的质量门禁) "pytest>=8.0", "pytest-asyncio>=0.23", "ruff>=0.6", "mypy>=1.10", "types-requests", ] [tool.uv] # 显式包管理方式与索引设置 managed = true # 工作区成员:本地垫片包(让 ragas 0.4.3 能正常 import) # 文档:https://docs.astral.sh/uv/concepts/projects/workspaces/ [tool.uv.workspace] members = ["packages/*"] [tool.uv.sources] langchain-vertexai-shim = { workspace = true }