Toggle navigation
Toggle navigation
This project
Loading...
Sign in
万朱浩
/
Venue-Ops
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
马一丁
2025-12-19 10:07:41 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7b86e055182a3521b978aaad833332035e29dcd2
7b86e055
1 parent
8478e9d7
Align graph API lookup path with GraphStorage output dir
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
ReportEngine/graphrag/graph_storage.py
ReportEngine/graphrag/graph_storage.py
View file @
7b86e05
...
...
@@ -292,7 +292,16 @@ class GraphStorage:
"""图谱存储管理器"""
FILENAME
=
"graphrag.json"
DEFAULT_CHAPTERS_DIR
=
Path
(
"chapters"
)
@property
def
chapters_dir
(
self
)
->
Path
:
"""获取章节目录路径(与 ChapterStorage 保持一致)"""
try
:
from
..utils.config
import
settings
return
Path
(
settings
.
CHAPTER_OUTPUT_DIR
)
except
ImportError
:
# 回退到默认值
return
Path
(
"final_reports/chapters"
)
def
save
(
self
,
graph
:
Graph
,
task_id
:
str
,
run_dir
:
Path
)
->
Path
:
"""
...
...
@@ -363,8 +372,8 @@ class GraphStorage:
Returns:
图谱文件路径,未找到返回 None
"""
# 在默认目录中搜索
chapters_dir
=
self
.
DEFAULT_CHAPTERS_DIR
# 在章节目录中搜索(与 ChapterStorage 保持一致)
chapters_dir
=
self
.
chapters_dir
if
not
chapters_dir
.
exists
():
return
None
...
...
@@ -388,7 +397,7 @@ class GraphStorage:
Returns:
最新图谱文件路径,未找到返回 None
"""
chapters_dir
=
self
.
DEFAULT_CHAPTERS_DIR
chapters_dir
=
self
.
chapters_dir
if
not
chapters_dir
.
exists
():
return
None
...
...
@@ -416,7 +425,7 @@ class GraphStorage:
Returns:
图谱信息列表,包含路径、报告ID、创建时间等
"""
chapters_dir
=
self
.
DEFAULT_CHAPTERS_DIR
chapters_dir
=
self
.
chapters_dir
if
not
chapters_dir
.
exists
():
return
[]
...
...
Please
register
or
login
to post a comment