# DocChain

This package can be used to generate complex structured documents from Specs using LLMm models.

`Document` is an abstraction that represent generated data, e.g. it could be any text data in
markdown or HTML, configuration in JSON, YAML or other formats, Python objects or classes, or any
other data that can be generated by LLMs.

`Spec` contains document requirements. It holds general information about the generated document.

`Section` is a composite part of a Document. Document itself is a Section. Such design allows
inclusion of Documents inside another documents.

`Generator` generates Document from the provided Spec. Each generator can be configured with a list
of steps that are executed before or after generation.

`Middleware` is a callable that can modify Spec or the generated Documents. It acts the same as
middleware in an HTTP framework, it can be used for variety of tasks. E.g. transforming, formatting
or linting generated document ot its parts.

## TODO

- [ ] Store stats in an SQLite database.
- [ ] Blocks for HTML, Markdown, Python, one line Python, templates.
- [ ] Add middleware to plan steps.
