fastrag.ingestion.logger.source#
Inspect fetched source bytes without losing binary content.
Classes
|
Display unique fetched sources with complete metadata and content. |
- class fastrag.ingestion.logger.source.SourceLogger(pipeline, *, format='rich', stream=None, configuration=None, stages=None, content_lines=None, content_chars=None, metadata_only=False, show_binary=False)[source]#
Bases:
LoggerDisplay unique fetched sources with complete metadata and content.
Accepts
pipeline,format="rich"or"jsonl",stream,configurationand optionalstages. UTF-8 content is displayed as literal text; other content is displayed as base64. JSON Lines always includescontent_base64for exact byte recovery.source_countcounts unique source IDs, deduplicating events from Sources aggregates. Counters reset on each run; failures propagate after a partial summary.Set
content_lines=Nto show only the first and last N text lines, separated by an omitted-line marker. Short content is shown in full. The defaultNoneshows everything. This applies to Rich and JSONL text output; metadata, base64 bytes and size statistics remain complete.content_chars=Nadditionally caps preview text at N characters, useful for minified HTML with very few lines. Both limits default toNone.metadata_only=Trueomits text,content_base64and embeddings, keeping metadata and size statistics. Non-text content is trimmed to a short base64 preview (content_truncated) unlessshow_binary=True.- Parameters:
- label = 'Source inspection'#
- async run()#
Inspect items and write a partial summary before propagating failures.
- Return type:
None