Help tweak and ran cog

This commit is contained in:
Simon Willison 2023-09-03 15:08:04 -07:00
parent 3d379fbddc
commit 2440eb4f48
2 changed files with 38 additions and 0 deletions

View file

@ -58,6 +58,7 @@ Commands:
embed Embed text and store or return the result
embed-db Manage the embeddings database
embed-models Manage available embedding models
embed-multi Store embeddings for multiple strings at once
install Install packages from PyPI into the same environment as LLM
keys Manage stored API keys for different models
logs Tools for exploring logged prompts and responses
@ -401,6 +402,36 @@ Options:
Output format
--help Show this message and exit.
```
### llm embed-multi --help
```
Usage: llm embed-multi [OPTIONS] COLLECTION [INPUT_PATH]
Store embeddings for multiple strings at once
Input can be CSV, TSV or a JSON list of objects.
The first column is treated as an ID - all other columns are assumed to be
text that should be concatenated together in order to calculate the
embeddings.
Input data can come from one of three sources:
1. A CSV, JSON, TSV or JSON-nl file (including on standard input)
2. A SQL query against a SQLite database
3. A directory of files
Options:
--format [json|csv|tsv|nl] Format of input file - defaults to auto-detect
--files <DIRECTORY TEXT>... Embed files in this directory - specify directory
and glob pattern
--sql TEXT Read input using this SQL query
--attach <TEXT FILE>... Additional databases to attach - specify alias
and file path
-m, --model TEXT Embedding model to use
--store Store the text itself in the database
-d, --database FILE
--help Show this message and exit.
```
### llm similar --help
```
Usage: llm similar [OPTIONS] COLLECTION [ID]

View file

@ -1013,6 +1013,13 @@ def embed_multi(
The first column is treated as an ID - all other columns
are assumed to be text that should be concatenated together
in order to calculate the embeddings.
Input data can come from one of three sources:
\b
1. A CSV, JSON, TSV or JSON-nl file (including on standard input)
2. A SQL query against a SQLite database
3. A directory of files
"""
if not input_path and not sql and not files:
raise click.UsageError("Either --sql or input path or --files is required")