File size: 398 Bytes
5b7955a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""Abstract base for chunkers."""

from __future__ import annotations

from abc import ABC, abstractmethod
from typing import List, Tuple

from rag_engine.schemas.chunk_metadata import ChunkMetadata


class BaseChunker(ABC):

    @abstractmethod
    def chunk(
        self,
        text: str,
        policy_id: str,
        source_file: str,
    ) -> List[Tuple[str, ChunkMetadata]]:
        ...