From da4eaf9fb02f403af1334ee78c22f1439c15b46b Mon Sep 17 00:00:00 2001 From: kingloon <1044057492@qq.com> Date: Thu, 21 May 2026 13:57:21 +0800 Subject: [PATCH] Fix: remove duplicate function definitions (#15063) ### What problem does this PR solve? Remove duplicate function definitions in `api/db/services/dialog_service.py`. **Problem:** Two helper functions were defined twice in the same file, but with different parameter orders: - First definition (line 57): `_resolve_reference_metadata(request_payload=None, config=None)` - Second definition (line 136): `_resolve_reference_metadata(config, request_payload=None)` **Solution:** Keep the second definition (which is actually used by other modules) and remove the first one to avoid confusion. Additionally, remove duplicate `_enrich_chunks_with_document_metadata` definition (keep line 140 version). image image ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) - [ ] New Feature (non-breaking change which adds functionality) - [ ] Documentation Update - [x] Refactoring - [ ] Performance Improvement - [ ] Other (please describe): --- api/db/services/dialog_service.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/api/db/services/dialog_service.py b/api/db/services/dialog_service.py index 66a6060d2a..77c11ce57b 100644 --- a/api/db/services/dialog_service.py +++ b/api/db/services/dialog_service.py @@ -54,12 +54,6 @@ from rag.utils.tts_cache import synthesize_with_cache from common.string_utils import remove_redundant_spaces from common import settings -def _resolve_reference_metadata(request_payload=None, config=None): - return resolve_reference_metadata_preferences(request_payload or {}, config) - -def _enrich_chunks_with_document_metadata(chunks, metadata_fields=None): - enrich_chunks_with_document_metadata(chunks, metadata_fields) - def _chunk_kb_id_for_doc(row_dict, kb_ids, doc_id): if len(kb_ids or []) == 1: return kb_ids[0]