humanize style
Have Skryba write a style from the prose of your own manuscripts.
Invocation#
lem-cli humanize style <name> --from <id-or-title> [--from <id-or-title> ...] [--model <model>] [--example-words <n>] [--min-words <n> --max-words <n>]Inputs and options#
- name is the name Skryba keeps the style under.
- --from names one paper of the registry, by id or title, and is repeated for each manuscript the style is written from.
- --model is passed on as Skryba's own --model; without it Skryba uses its SKRYBA_MODEL or refuses.
- --example-words, a whole number above zero, is passed on as Skryba's --words: its model is given at most that many words of the prose, the manuscripts in the order named, the one crossing the bound cut there. A whole manuscript can be more than a model reads in one request; without it all of the prose is handed over.
- --min-words and --max-words, given together, also keep the prose in Skryba's writing-style store as writing in the style, in passages of that many words: Skryba drops shorter prose and splits longer.
Output and state#
Reads each manuscript's main file from \\begin{document} on and every file it includes, keeps formulas, environments, commands, comments and ties aside as humanize section does, and hands the prose that is left to `skryba style derive <name> --from <file> ...`. The prose files are written only into the run's own workspace and removed after.
Prints `program`, `name`, `instruction` (what Skryba's model wrote) and `derived_from`, each paper with its id, title and main file. A Skryba voice can then carry the style (`skryba voice add <voice> --style <name> ...`), and humanize section --voice <voice> rewrites a section in it.
With the word bounds, Lem then runs `skryba writing-style add <files> --min-words <n> --max-words <n> --style <name>` over the same prose and prints `kept`: the style, the passages Skryba `added` and those it already held (`skipped`), the store's `passages` after, and the `sources` as Skryba names them, one file per paper (`manuscript-<paper id>.txt`), which `skryba writing-style remove <source> --yes` takes back. A rewrite in the style is then read against your own papers rather than all of your writing (`voice_basis.style`).
`POST /papers/<id>/style` with `{name, model, min_words, max_words, example_words}` does the same for that one paper (a bound alone, or example_words not above zero, is refused with status 400), and Lem Desktop's AI text panel offers it as Your style from this paper.
Refusals#
- A missing name, no --from, an option without its value, another option, a word bound that is not a whole number, or one given without the other, or an --example-words that is not a whole number above zero refuse with “humanize style needs the name the style is kept under and one --from naming each manuscript it is written from”, exit 2, before the registry is read.
- A paper the registry does not hold refuses as every paper command does; one with no main LaTeX file is `lem.humanize.style.source-absent`, and one with no prose left once its LaTeX is kept aside is `prose-none`. Both are checked before Skryba is looked for.
- Skryba's refusal is relayed with what it said (`style-refused`); an answer that is not Skryba's report is `style-answer-unreadable`. When the prose is kept, Skryba's refusal of `writing-style add` is `keep-refused` and an answer that is not its report is `keep-answer-unreadable`; the style was already kept by then.