3550a22557
入库从纯文本升级为多文件类型:解析(mcp-py 算法层)与切块/embedding 解耦。 上传文件 → Gateway 按类型路由 → mcp-py parse_document 解析为文本 → kb_ingest。 - mcp-py: parsers.py(docx=python-docx / xlsx=openpyxl / pdf=pypdf / csv / txt→文本); parse_document 工具做真(base64 文件→文本,线程池跑 CPU 密集解析);pyproject 加依赖 - gateway: POST /api/v1/kb/ingest_file(multipart);parseFile 文本类直读、office/pdf→mcp-py - nats-server.conf: max_payload 8MB(容纳 base64 文件经工具调用;大文件应走对象存储) - frontend: KbView 加文件上传(accept docx/xlsx/pdf/csv...);api.ingestFile - 验证: 全模块 build✓ + e2e PASS; live——4 类文件上传→mcp-py 解析→入库→检索命中: docx(营收报告)/xlsx(销量表行)/pdf(Q2计划)/csv(城市人口) 全部正确 - 边界: 扫描件/版面 OCR(MinerU/PaddleOCR)推迟;大文件 base64 走 NATS 受 max_payload 限,生产应走对象存储(MinIO) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
22 lines
709 B
TOML
22 lines
709 B
TOML
[project]
|
|
name = "sundynix-mcp-py"
|
|
version = "0.1.0"
|
|
description = "sundynix-agentix · 第 5 层 Python 算法型 MCP 工具微服务"
|
|
requires-python = ">=3.11"
|
|
dependencies = [
|
|
"mcp>=1.2.0", # MCP 协议
|
|
"nats-py>=2.7.0", # 接入 NATS 骨干网
|
|
"docker>=7.1.0", # Docker 隔离沙箱 / Code Interpreter
|
|
"python-docx>=1.1.0", # Word 解析
|
|
"openpyxl>=3.1.0", # Excel 解析
|
|
"pypdf>=4.0.0", # PDF 文本解析
|
|
# "magic-pdf", # MinerU 多模态解析 (PaddleOCR),扫描件 OCR,按需安装
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["src/sundynix_mcp_py"]
|