Source code for swarmauri.core.chunkers.IChunker
from abc import ABC, abstractmethod
from typing import List, Union, Any
[docs]
class IChunker(ABC):
"""
Interface for chunking text into smaller pieces.
This interface defines abstract methods for chunking texts. Implementing classes
should provide concrete implementations for these methods tailored to their specific
chunking algorithms.
"""
[docs]
@abstractmethod
def chunk_text(self, text: Union[str, Any], *args, **kwargs) -> List[Any]:
pass