templates
Render exported ChatKit widget files with Jinja.
WidgetTemplate
Load and render a .widget definition into a canonical widget tree.
Source code in chatkit/templates.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
from_file
classmethod
from_file(path: str | Path) -> WidgetTemplate
Read a widget definition. Relative paths use the working directory.
Source code in chatkit/templates.py
31 32 33 34 | |
build
build(data: dict[str, Any] | BaseModel | None = None) -> WidgetRoot
Render template data into a Card, ListView, or Basic widget tree.
Source code in chatkit/templates.py
36 37 38 39 40 41 42 43 | |