Spaces:
Running on Zero
Running on Zero
| from dataclasses import dataclass, field | |
| from enum import Enum | |
| from pathlib import Path | |
| from typing import Any | |
| class SourceType(str, Enum): | |
| PDF = "pdf" | |
| ARXIV = "arxiv" | |
| MEDIUM = "medium" | |
| class Document: | |
| source_type: SourceType | |
| title: str | |
| text: str | |
| source: str | |
| metadata: dict[str, Any] = field(default_factory=dict) | |
| class Chunk: | |
| id: str | |
| text: str | |
| index: int | |
| source_type: SourceType | |
| source: str | |
| title: str | |
| metadata: dict[str, Any] = field(default_factory=dict) | |
| class IngestionResult: | |
| document: Document | |
| chunks: list[Chunk] | |
| collection_name: str | |
| export_path: Path | |
| class SearchResult: | |
| score: float | |
| text: str | |
| title: str | |
| source: str | |
| source_type: str | |
| metadata: dict[str, Any] | |