Feature/ontology v0.2 (#348)
* [add]Integration of the core engineering and memory extraction * [add]The import and export function of the main body engineering files * [add]Improve the import interface * [add]Introducing generic types helps with entity extraction * [add]Modify the references of the main repository to the sub-repositories * [add]The extraction trial run introduces the ontology type. * [add]Integration of the core engineering and memory extraction * [add]The import and export function of the main body engineering files * [add]Improve the import interface * [add]Introducing generic types helps with entity extraction * [add]Modify the references of the main repository to the sub-repositories * [add]The extraction trial run introduces the ontology type. * [add]Complete the second phase of the main project content * [add]The dependencies and configurations of the main body project * [add]Modify the code based on the AI review
This commit is contained in:
@@ -142,6 +142,20 @@ async def run_pilot_extraction(
|
||||
f"enable_llm_disambiguation={config.deduplication.enable_llm_disambiguation}"
|
||||
)
|
||||
|
||||
# 加载本体类型(如果配置了 scene_id),支持通用类型回退
|
||||
ontology_types = None
|
||||
try:
|
||||
from app.core.memory.ontology_services.ontology_type_loader import load_ontology_types_with_fallback
|
||||
|
||||
ontology_types = load_ontology_types_with_fallback(
|
||||
scene_id=memory_config.scene_id,
|
||||
workspace_id=memory_config.workspace_id,
|
||||
db=db,
|
||||
enable_general_fallback=True
|
||||
)
|
||||
except Exception as e:
|
||||
logger.warning(f"Failed to load ontology types: {e}", exc_info=True)
|
||||
|
||||
orchestrator = ExtractionOrchestrator(
|
||||
llm_client=llm_client,
|
||||
embedder_client=embedder_client,
|
||||
@@ -150,6 +164,7 @@ async def run_pilot_extraction(
|
||||
progress_callback=progress_callback,
|
||||
embedding_id=str(memory_config.embedding_model_id),
|
||||
language=language,
|
||||
ontology_types=ontology_types,
|
||||
)
|
||||
|
||||
log_time("Orchestrator Initialization", time.time() - step_start, log_file)
|
||||
|
||||
Reference in New Issue
Block a user