Skip to content

loader

_loader

Utility for loading markdown prompt files with disk-read caching.

Functions:

Name Description
load_markdown

Load a markdown prompt file, optionally formatting placeholders.

Functions

load_markdown

load_markdown(name: str, **kwargs: str) -> str

Load a markdown prompt file, optionally formatting placeholders.

File contents are cached after the first read — the files never change at runtime, so this avoids repeated disk I/O on every prompt invocation.

Parameters:

Name Type Description Default
name
str

Filename (with .md extension) inside the markdown/ directory.

required
**kwargs
str

Values to substitute into {placeholder} tokens in the markdown text. The special key network_housekeeping is automatically populated from network_housekeeping.md if not explicitly provided.

{}

Returns:

Type Description
str

The formatted markdown string.