{"record":{"id":"4e662e1b1e60b101","repo":"iflytek/astron-agent","slug":"sparkdesk-rag-does-not-support-split-operation","errorCode":null,"errorMessage":"SparkDesk-RAG does not support split operation.","messagePattern":"SparkDesk-RAG does not support split operation\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"core/knowledge/service/impl/sparkdesk_strategy.py","lineNumber":71,"sourceCode":"        Split file into multiple chunks\n\n        Args:\n            fileUrl: File url\n            length_range: Length range\n            overlap: Overlap length\n            resource_type: Resource type\n            separator: Separator list\n            title_split: Whether to split by title\n            cut_off: Cutoff marker list\n            **kwargs: Other parameters\n\n        Returns:\n            List of split chunks\n\n        Raises:\n            NotImplementedError: SparkDesk-RAG does not support split operation\n        \"\"\"\n        raise NotImplementedError(\"SparkDesk-RAG does not support split operation.\")\n\n    async def chunks_save(\n        self, docId: str, group: str, uid: str, chunks: List[Any], **kwargs: Any\n    ) -> Any:\n        \"\"\"\n        Save chunks to knowledge base\n\n        Args:\n            doc_id: Document ID\n            group: Group name\n            uid: User ID\n            chunks: Chunk list\n            **kwargs: Other parameters\n\n        Returns:\n            Save result\n\n        Raises:","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/knowledge/service/impl/sparkdesk_strategy.py#L53-L89","documentation":"SparkDeskRagStrategy.split() is an intentional stub in the SparkDesk RAG adapter. SparkDesk-RAG does not expose a server-side document splitting API, so the strategy raises NotImplementedError for this capability. It exists only to satisfy the abstract RagStrategy interface; callers must not invoke it against SparkDesk.","triggerScenarios":"Calling split() on a strategy obtained from RagStrategyFactory with ragType=SparkDesk-RAG, e.g. requesting chunk splitting for a document routed to the SparkDesk backend.","commonSituations":"Code written generically against the RagStrategy interface (works with local RAG backends) being pointed at SparkDesk-RAG via config; copy-pasted chunking pipelines; tests verifying unsupported operations.","solutions":["Split the document locally before upload instead of calling strategy.split()","Check the backend type before calling: skip or route split() to a backend that supports it","Add split support to SparkDeskRagStrategy if the SparkDesk API offers an equivalent endpoint"],"exampleFix":"// before\nchunks = await strategy.split(content)\n// after\nif isinstance(strategy, SparkDeskRagStrategy):\n    chunks = local_split(content)\nelse:\n    chunks = await strategy.split(content)","handlingStrategy":"validation","validationCode":"def supports_split(strategy) -> bool:\n    return not isinstance(strategy, SparkDeskRagStrategy)","typeGuard":"def is_sparkdesk(strategy) -> bool:\n    return isinstance(strategy, SparkDeskRagStrategy)","tryCatchPattern":"try:\n    chunks = await strategy.split(content)\nexcept NotImplementedError:\n    chunks = local_split(content)  # fallback","preventionTips":["Check backend capability before invoking strategy methods generically","Document which RagStrategy methods each backend supports","Split documents locally when the backend lacks a split API"],"tags":["python","rag","not-implemented","sparkdesk"],"backgroundTag":"unsupported-operation","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}