iflytek/astron-agent · error · NotImplementedError

SparkDesk-RAG does not support split operation.

Error message

SparkDesk-RAG does not support split operation.

What it means

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.

Solutions

  1. Split the document locally before upload instead of calling strategy.split()
  2. Check the backend type before calling: skip or route split() to a backend that supports it
  3. Add split support to SparkDeskRagStrategy if the SparkDesk API offers an equivalent endpoint

Example fix

// before
chunks = await strategy.split(content)
// after
if isinstance(strategy, SparkDeskRagStrategy):
    chunks = local_split(content)
else:
    chunks = await strategy.split(content)
Defensive patterns

Strategy: validation

Validate before calling

def supports_split(strategy) -> bool:
    return not isinstance(strategy, SparkDeskRagStrategy)

Type guard

def is_sparkdesk(strategy) -> bool:
    return isinstance(strategy, SparkDeskRagStrategy)

Try / catch

try:
    chunks = await strategy.split(content)
except NotImplementedError:
    chunks = local_split(content)  # fallback

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/4e662e1b1e60b101. Report an issue: GitHub.

Appendix: source

Thrown at core/knowledge/service/impl/sparkdesk_strategy.py:71

        Split file into multiple chunks

        Args:
            fileUrl: File url
            length_range: Length range
            overlap: Overlap length
            resource_type: Resource type
            separator: Separator list
            title_split: Whether to split by title
            cut_off: Cutoff marker list
            **kwargs: Other parameters

        Returns:
            List of split chunks

        Raises:
            NotImplementedError: SparkDesk-RAG does not support split operation
        """
        raise NotImplementedError("SparkDesk-RAG does not support split operation.")

    async def chunks_save(
        self, docId: str, group: str, uid: str, chunks: List[Any], **kwargs: Any
    ) -> Any:
        """
        Save chunks to knowledge base

        Args:
            doc_id: Document ID
            group: Group name
            uid: User ID
            chunks: Chunk list
            **kwargs: Other parameters

        Returns:
            Save result

        Raises:

View on GitHub (pinned to 5e758547a8)