Spending Sort
Spending, filed into categories by a model that says when it isn't sure. Confident lines settle into totals; the doubtful ones wait for you.
Needs: A text embedding for each line and example, from any model. The demo runs bge-small (about 34 MB, downloaded once in the browser).
Customize
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| transactions | Spend[] | required | Spend is { id, descriptor, memo?, amount, date?, merchant?, embedding?, category?, opaque? }. descriptor is the raw statement line; merchant lets history and rules follow it across descriptors; category marks one already filed by the person; opaque marks a line that names no merchant, which is never filed without asking. Lines without an embedding wait until it arrives. |
| categories | { id: string; name: string; parent?: string }[] | required | The categories. parent is a coarser group ("Food") shown instead while the model is torn between two of its members. |
| examples | { embedding: ArrayLike<number>; category: string }[] | – | Labelled phrases that aren't transactions ("Pharmacy medicines" for Health). They train the model too. |
| history | Record<string, Record<string, number>> | – | Earlier filings per merchant, e.g. { amazon: { shopping: 7, groceries: 3 } }. A call that disagrees with it is asked about. |
| money | (amount: number) => string | – | Formats an amount. toLocaleString() by default. |
| onChange | (filings: { id: string; category: string | null; by: "you" | "rule" | "model" | "unsure" }[]) => void | – | Called with every line's filing whenever the model or the person changes one. |
| accent | string | "#3c8466" | Colour of the totals and the chosen category, any CSS colour. How sure a filing is never shows in it. |
| className | string | – | Class on the root element. |
| style | CSSProperties | – | Style on the root element. Theme it through the --mlui-* variables. |