You've already forked DataMate
实现功能: - Neo4j Docker Compose 配置(社区版,端口 7474/7687,数据持久化) - Makefile 新增 Neo4j 命令(neo4j-up/down/logs/shell) - knowledge-graph-service Spring Boot 服务(完整的 DDD 分层架构) - kg_extraction Python 模块(基于 LangChain LLMGraphTransformer) 技术实现: - Neo4j 配置:环境变量化密码,统一默认值 datamate123 - Java 服务: - Domain: GraphEntity, GraphRelation 实体模型 - Repository: Spring Data Neo4j,支持 graphId 范围查询 - Service: 业务逻辑,graphId 双重校验,查询限流 - Controller: REST API,UUID 格式校验 - Exception: 实现 ErrorCode 接口,统一异常体系 - Python 模块: - KnowledgeGraphExtractor 类 - 支持异步/同步/批量抽取 - 支持 schema-guided 模式 - 兼容 OpenAI 及自部署模型 关键设计: - graphId 权限边界:所有实体操作都在正确的 graphId 范围内 - 查询限流:depth 和 limit 参数受配置约束 - 异常处理:统一使用 BusinessException + ErrorCode - 凭据管理:环境变量化,避免硬编码 - 双重防御:Controller 格式校验 + Service 业务校验 代码审查: - 经过 3 轮 Codex 审查和 2 轮 Claude 修复 - 所有 P0 和 P1 问题已解决 - 编译通过,无阻塞性问题 文件变更: - 新增:Neo4j 配置、knowledge-graph-service(11 个 Java 文件)、kg_extraction(3 个 Python 文件) - 修改:Makefile、pom.xml、application.yml、pyproject.toml
50 lines
1.4 KiB
TOML
50 lines
1.4 KiB
TOML
[project]
|
|
name = "datamate-python"
|
|
version = "0.1.0"
|
|
description = "This is the Python backend of DataMate."
|
|
authors = [
|
|
{name = "Jason Wang",email = "jasonwong2019@outlook.com"}
|
|
]
|
|
license = {text = "MIT"}
|
|
readme = "README.md"
|
|
requires-python =">=3.12,<4.0.0"
|
|
dependencies = [
|
|
"uvicorn[standard] (>=0.38.0,<0.39.0)",
|
|
"aiomysql (>=0.3.2,<0.4.0)",
|
|
"pymysql (>=1.1.2,<2.0.0)",
|
|
"aiosqlite (>=0.21.0,<0.22.0)",
|
|
"httpx (>=0.28.1,<0.29.0)",
|
|
"pydantic-settings (>=2.12.0,<3.0.0)",
|
|
"python-multipart (>=0.0.20,<0.0.21)",
|
|
"python-dotenv (>=1.2.1,<2.0.0)",
|
|
"python-dateutil (>=2.9.0.post0,<3.0.0)",
|
|
"pyyaml (>=6.0.3,<7.0.0)",
|
|
"unstructured (>=0.18.21,<0.19.0)",
|
|
"markdown (>=3.10,<4.0)",
|
|
"langchain-community (>=0.4.1,<0.5.0)",
|
|
"jsonschema (>=4.25.1,<5.0.0)",
|
|
"greenlet (>=3.3.0,<4.0.0)",
|
|
"docx2txt (>=0.9,<0.10)",
|
|
"openpyxl (>=3.1.5,<4.0.0)",
|
|
"xlrd (>=2.0.1,<3.0.0)",
|
|
"jq (>=1.10.0,<2.0.0)",
|
|
"openai (>=2.9.0,<3.0.0)",
|
|
"langchain-openai (>=1.1.1,<2.0.0)",
|
|
"langchain (>=1.1.3,<2.0.0)",
|
|
"langchain-experimental (>=0.3.0,<1.0.0)",
|
|
"pydantic (>=2.12.5,<3.0.0)",
|
|
"sqlalchemy (>=2.0.45,<3.0.0)",
|
|
"fastapi (>=0.124.0,<0.125.0)",
|
|
"Pillow (>=11.0.0,<12.0.0)",
|
|
]
|
|
|
|
|
|
[build-system]
|
|
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
|
build-backend = "poetry.core.masonry.api"
|
|
|
|
[tool.poetry]
|
|
packages = [
|
|
{ include = "app" }
|
|
]
|