Skip to content

Commit e070716

Browse files
Bryceclaude
andcommitted
refactor(celery Wave 5 P1 chunk 2): relocate ENTITY_RELATION_EXTRACTION import to aperag/indexing/llm
Wave 5 task #26 chunk 2 per §K.9.1 acceptance item 3 cascade (legacy graphindex caller migration): `aperag/service/prompt_template_service.py:155-163` (the `get_default_prompt(prompt_type="graph")` branch) was importing the ENTITY_RELATION_EXTRACTION template from the legacy `aperag.domains.knowledge_graph.graphindex.prompts` module. Per chunk 1 relocate (`11113acb`), the canonical home for the template is now `aperag.indexing.llm`. This commit migrates the import site so the caller no longer transitively touches the legacy module. Behavior unchanged — the legacy `graphindex/prompts.py` shim already re-exports the template from the new location, so this is a pure import-path refactor that leaves the runtime payload identical. Local gates: - `ruff check ./aperag ./tests` clean - `ruff format --check ./aperag ./tests` clean (509 files) Phase 1 cascade progress: - chunk 1 ✅ (`11113acb`): §K.9 spec + `aperag/indexing/llm.py` relocate - **chunk 2** (this commit): `service/prompt_template_service.py` import relocate - chunk 3+ pending: `retrieval/pipeline.py` / `knowledge_graph/service.py` / `graph_curation/*` migration (these need new design — legacy 24-method `GraphStore` Protocol → new 10-method `LineageGraphStore` Protocol API surface is NOT a 1-to-1 replacement; per Bryce msg=30c7e994 scope reality check + architect msg=b052b1b4 cascade ratify lane lock) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 11113ac commit e070716

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

aperag/service/prompt_template_service.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,13 @@ def get_hardcoded_index_prompt(prompt_type: str) -> Optional[str]:
153153
Hardcoded prompt content, or None if not available
154154
"""
155155
if prompt_type == "graph":
156-
# Return the graphindex v2 extraction prompt template. Unlike
157-
# LightRAG's parameterised ``entity_extraction``, this one
158-
# expects ``{input_text}`` / ``{entity_types}`` / ``{language}``
159-
# / ``{max_entities}`` / ``{max_relations}`` to be filled by the
160-
# caller (see ``aperag.domains.knowledge_graph.graphindex.prompts.render_extraction_prompt``).
161-
from aperag.domains.knowledge_graph.graphindex.prompts import ENTITY_RELATION_EXTRACTION
156+
# Return the canonical entity/relation extraction prompt template.
157+
# Wave 5 P1 chunk 1 relocate (per §K.9.1 item 3): the canonical
158+
# home is now :mod:`aperag.indexing.llm`. The template expects
159+
# ``{input_text}`` / ``{entity_types}`` / ``{language}`` /
160+
# ``{max_entities}`` / ``{max_relations}`` to be filled by the
161+
# caller (see :func:`aperag.indexing.llm.render_extraction_prompt`).
162+
from aperag.indexing.llm import ENTITY_RELATION_EXTRACTION
162163

163164
return ENTITY_RELATION_EXTRACTION
164165
elif prompt_type == "summary":

0 commit comments

Comments
 (0)