refactor(rag/nlp): standardize knowledge graph retrieval to use DocumentChunk and add debug logging
The knowledge graph retrieval logic in `search.py` was updated to consistently return `DocumentChunk` instances instead of raw dictionaries, improving type safety and alignment with the RAG pipeline's expected data structure. Additionally, debug logging was enhanced in `draft_run_service.py` to log the full `retrieve_chunks_result` before extracting page content, aiding troubleshooting.
This commit is contained in:
@@ -223,8 +223,8 @@ def create_knowledge_retrieval_tool(kb_config, kb_ids, user_id, citations_collec
|
||||
|
||||
retrieve_chunks_result = knowledge_retrieval(query, kb_config)
|
||||
if retrieve_chunks_result:
|
||||
logger.warning(f"检索知识结果:{retrieve_chunks_result}")
|
||||
retrieval_knowledge = [i.page_content for i in retrieve_chunks_result]
|
||||
logger.warning(f"检索知识结果:{retrieval_knowledge}")
|
||||
context = '\n\n'.join(retrieval_knowledge)
|
||||
logger.info(
|
||||
"知识库检索成功",
|
||||
|
||||
Reference in New Issue
Block a user