feat: 增加简化版json数据

This commit is contained in:
2026-04-15 14:52:33 +08:00
parent 37cd2171b1
commit 8c5cd3705a
9 changed files with 310 additions and 1 deletions
+21
View File
@@ -24,3 +24,24 @@ type GraphData struct {
Nodes []Node `json:"nodes"`
Edges []Edge `json:"edges"`
}
// SimpleNode 简化版节点结构,仅保留核心信息,适合 LLM 处理
type SimpleNode struct {
ID string `json:"id" example:"1"`
Label string `json:"label" example:"人工智能"`
Type string `json:"type,omitempty" example:"概念"`
}
// SimpleEdge 简化版边结构,仅保留核心信息,适合 LLM 处理
type SimpleEdge struct {
Source string `json:"source" example:"1"`
Target string `json:"target" example:"2"`
Type string `json:"type,omitempty" example:"CONTAINS"`
Label string `json:"label,omitempty" example:"包含"`
}
// SimpleGraphData 简化版图数据,适合 LLM 处理
type SimpleGraphData struct {
Nodes []SimpleNode `json:"nodes"`
Edges []SimpleEdge `json:"edges"`
}