curated_feed.export

Render a corpus file as compact Markdown for pasting into a chat session.

A collection day can run to several hundred items, so the output is deliberately terse: two lines per item, numbered for reference and carrying the record id so that picks can be traced back to the corpus.

The numbering is the same one policy.py puts in the prompt, and comes from the same renderer. A chat session and a pipeline run therefore refer to an article by the same number, which is what lets a response saved from one drive the other.

Functions

render_markdown(→ str)

Numbered Markdown under a heading, one item per two lines.

render(→ str)

The listing on its own, or the whole prompt the pipeline would send.

build_parser(→ argparse.ArgumentParser)

resolve_corpus_file(→ pathlib.Path)

main(→ int)

Module Contents

curated_feed.export.render_markdown(candidates: collections.abc.Sequence[curated_feed.models.Candidate], *, title: str, max_items: int | None = None) → str[source]

Numbered Markdown under a heading, one item per two lines.

curated_feed.export.render(candidates: collections.abc.Sequence[curated_feed.models.Candidate], *, config: curated_feed.config.Config, title: str, max_items: int | None = None, as_prompt: bool = False, prompt_path: pathlib.Path | None = None) → str[source]

The listing on its own, or the whole prompt the pipeline would send.

The prompt form is what a chat session wants: the same policy documents and the same numbering the pipeline uses, so a response saved from that session can be fed straight back with curate-score –provider file.

curated_feed.export.build_parser() → argparse.ArgumentParser[source]
curated_feed.export.resolve_corpus_file(args: argparse.Namespace, config: curated_feed.config.Config) → pathlib.Path[source]
curated_feed.export.main(argv: collections.abc.Sequence[str] | None = None) → int[source]