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
- 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
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
- 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
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
- SparkDesk-RAG does not support chunks_save operation.
- SparkDesk-RAG does not support chunks_update operation.
- SparkDesk-RAG does not support chunks_delete operation.
- SparkDesk-RAG does not support query_doc operation.
- SparkDesk-RAG does not support query_doc_name operation.
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)