Version: latest
agrag.chunking.chunker.TextPiece
TextPiece(text:str, start_index:int, end_index:int, token_count:int) -> None
A piece of text that Chunker.split made.
Attributes:
- text (
str) – The text of the piece. It equals the slice of the source text fromstart_indextoend_index. - start_index (
int) – The offset of the first character in the source text. - end_index (
int) – The offset just past the last character in the source text. - token_count (
int) – The number of tokens in the piece.
end_index
end_index: int
start_index
start_index: int
text
text: str
token_count
token_count: int