diff --git a/runtime/datamate-python/app/module/annotation/service/knowledge_sync.py b/runtime/datamate-python/app/module/annotation/service/knowledge_sync.py index 850a470..ae345ea 100644 --- a/runtime/datamate-python/app/module/annotation/service/knowledge_sync.py +++ b/runtime/datamate-python/app/module/annotation/service/knowledge_sync.py @@ -11,7 +11,6 @@ from sqlalchemy.ext.asyncio import AsyncSession from app.core.config import settings from app.core.logging import get_logger from app.db.models import Dataset, DatasetFiles, LabelingProject -from app.module.annotation.service.text_fetcher import fetch_text_content_via_download_api logger = get_logger(__name__) @@ -254,16 +253,6 @@ class KnowledgeSyncService: content_type = "MARKDOWN" content = annotation_json - if dataset_type == "TEXT": - try: - content = await fetch_text_content_via_download_api( - project.dataset_id, - str(file_record.id), - ) - content = self._append_annotation_to_content(content, annotation_json, content_type) - except Exception as exc: - logger.warning("读取文本失败,改为仅存标注JSON:%s", exc) - content = annotation_json payload: Dict[str, Any] = { "title": title, @@ -294,13 +283,6 @@ class KnowledgeSyncService: extension = file_type return extension.lower() in {"md", "markdown"} - def _append_annotation_to_content(self, content: str, annotation_json: str, content_type: str) -> str: - if content_type == "MARKDOWN": - return ( - f"{content}\n\n---\n\n## 标注结果\n\n```json\n" - f"{annotation_json}\n```") - return f"{content}\n\n---\n\n标注结果(JSON):\n{annotation_json}" - def _strip_extension(self, file_name: str) -> str: if not file_name: return ""