Basic docs for llm schema list, closes #781

This commit is contained in:
Simon Willison 2025-02-27 07:46:34 -08:00
parent c126b5d04c
commit edc9e2dd7e

View file

@ -159,6 +159,7 @@ You can also save the JSON schema to a file and reference the filename using `--
```bash
llm --schema dogs.schema.json 'invent two dogs'
```
Or save your schema {ref}`to a template <prompt-templates>` like this:
```bash
@ -166,6 +167,18 @@ llm --schema dogs.schema.json --save dogs
# Then to use it:
llm -t dogs 'invent two dogs'
```
Schemas are logged to your database. You can view stored schemas with:
```bash
llm schemas
```
And add `-q` one or more times to search:
```bash
llm schemas -q dogs -q bio
```
You can then use a stored schema ID as an argument to `--schema`:
```bash
llm --schema a75b7b3f00e065247e6e364304338aa5 'five dogs
```
Be warned that different models may support different dialects of the JSON schema specification.