fastrag.ingestion.models#
Value types produced by the ingestion pipeline’s source-fetching stage.
A Source is raw fetched content, produced by a fetcher and consumed
by a parser. What a Source becomes once parsed — Document
— is shared by every later stage (parsing, chunking, embedding, indexing) as
well as by retrieval, querying, serving and benchmarking, so it lives at the
top level, in fastrag.models, rather than here.
Classes
|
Raw content fetched from somewhere, plus enough metadata to place it. |
- class fastrag.ingestion.models.Source(id, uri, content, content_type, content_hash, etag=None, last_modified=None, metadata=<factory>, last_validated=None, cached=False)[source]#
Bases:
objectRaw content fetched from somewhere, plus enough metadata to place it.
A
Sourceis produced by a fetcher and carries the original bytes together with enough information to identify, validate, cache, and later transform it into one or moreDocumentinstances. Sources are independently cacheable, and their freshness may be validated against the originating system using ETags, modification timestamps, content hashes, or equivalent mechanisms.- Parameters:
- last_modified#
Origin-reported modification time, when available.
- Type:
datetime.datetime | None
- last_validated#
When this source was last confirmed fresh against its origin (or, for one that has never been revalidated, first fetched). Persisted: round-tripped through the cache so that
SourceStep.cache_validation_intervalmeans the same thing across process restarts, not just within one.Noneon aSourcethat has never been through a cache write, e.g. one just produced byevaluate()and not yet cached.- Type:
datetime.datetime | None