std.document
Generated by
sema docfromstdlib/sema/document.sema. Import withfrom std.document import …. For a narrative introduction see std.document.
document
Section titled “document”std.document — typed document IR + deterministic render (design ⑦).
The model fills a typed Report; rendering to markdown is a pure, deterministic
function — no regex repair of freeform LLM markdown, and section/table placement is
structural. Replaces a hand-rolled assemble_basic_answer/_assemble_report.
nl is the newline separator, parametrizable so the same renderer can emit a
single-line form for tests or real newlines for output.
struct Report
Section titled “struct Report”Fields
| field | type | descriptor |
|---|---|---|
title | str | |
context | str | |
confidence | f64 | |
rationale | str | |
takeaways | list[str] | |
section_titles | list[str] | |
sections_text | str | |
conclusion | str |
def fmt1(x: f64) -> str !{}Parameters
| name | type |
|---|---|
x | f64 |
Returns str
Effects !{}
render
Section titled “render”def render(r: Report, nl: str) -> str !{}Parameters
| name | type |
|---|---|
r | Report |
nl | str |
Returns str
Effects !{}