File size: 384 Bytes
cf450f7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from dataclasses import dataclass
from io import BytesIO
from typing import Any


@dataclass
class ChunkWithMetadata:
    content: str
    metadata: dict[str, Any]  # pyright: ignore[reportExplicitAny]


@dataclass
class ChunkDocumentResult:
    filename: str
    chunks: list[str] | list[ChunkWithMetadata]


@dataclass
class DocumentStreamGeneric:
    name: str
    stream: BytesIO