🎉 svc-infra v1.0 is here — Production-ready backend infrastructure
What's new
nfrax logonfrax

Infrastructure that just works. Ship products, not boilerplate.

Frameworks

  • svc-infra
  • ai-infra
  • fin-infra
  • robo-infra

Resources

  • Getting Started
  • What's New
  • Contributing

Community

  • GitHub

© 2026 nfrax. All rights reserved.

nfrax logonfrax
Start HereWhat's New
GitHub
svc-infra / API Reference

LoadedContent

from svc_infra.loaders.models import LoadedContent
svc_infra.loaders.models

Content loaded from a remote or local source. This is the standard output format for all loaders. It's designed to be compatible with ai-infra's Retriever.add_text() method.

Attributes

content: The text content that was loaded. metadata: Flexible metadata dict. Loaders add source-specific metadata (e.g., repo, path, branch for GitHub). Users can add custom metadata via the loader's `extra_metadata` parameter. source: Source identifier (URL, file path, GitHub URI, etc.). Format varies by loader: - GitHubLoader: "github://owner/repo/path" - URLLoader: "https://example.com/page" - S3Loader: "s3://bucket/key" content_type: MIME type or content category (e.g., "text/markdown", "text/x-python", "text/html"). None if unknown. encoding: Character encoding (default: utf-8).

Example

>>> content = LoadedContent( ... content="# Authentication\n\nThis guide covers...", ... source="github://nfraxlab/svc-infra/docs/auth.md", ... content_type="text/markdown", ... metadata={"repo": "nfraxlab/svc-infra", "path": "docs/auth.md"}, ... ) >>> >>> # Use with ai-infra Retriever >>> retriever.add_text(content.content, metadata=content.metadata)

Constructor
LoadedContent(content: str, metadata: dict[str, Any] = dict(), source: str = '', content_type: str | None = None, encoding: str = 'utf-8') -> None
ParameterTypeDefaultDescription
contentrequiredstr——
metadatadict[str, Any]dict()—
sourcestr''—
content_typestr|NoneNone—
encodingstr'utf-8'—

Methods

On This Page

Constructorfrom_dictto_dictto_tuple