A pointer back to the source span an extracted fact came from.
| 26 | from pydantic import BaseModel, ConfigDict, Field |
| 27 | from typing_extensions import Self |
| 28 | |
| 29 | |
| 30 | class Citation(BaseModel): |
| 31 | """A pointer back to the source span an extracted fact came from.""" |
| 32 | |
| 33 | model_config = ConfigDict(extra="forbid", frozen=True) |
| 34 | |
| 35 | source_id: str |
| 36 | page: int | None = None |
| 37 | char_offset: int | None = None |
| 38 | quote: str | None = Field(default=None, max_length=500) |
| 39 | # When the citation points into a TreeKnowledge, anchor to a specific node. |
| 40 | tree_id: UUID | None = None |
| 41 | node_id: UUID | None = None |
| 42 |
no outgoing calls