Skip to content

Commit

Permalink
-s shortcut for --system, closes #69
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jul 1, 2023
1 parent db46c75 commit d6bb09e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Usage: llm prompt [OPTIONS] [PROMPT]
Documentation: https://llm.datasette.io/en/stable/usage.html
Options:
--system TEXT System prompt to use
-s, --system TEXT System prompt to use
-m, --model TEXT Model to use
-t, --template TEXT Template to use
-p, --param <TEXT TEXT>... Parameters for template
Expand Down
4 changes: 2 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ This pattern of using `$(command)` inside a double quoted string is a useful way

## System prompts

You can use `--system '...'` to set a system prompt.
You can use `-s/--system '...'` to set a system prompt.

llm 'SQL to calculate total sales by month' \
--system 'You are an exaggerated sentient cheesecake that knows SQL and talks about cheesecake a lot'

This is useful for piping content to standard input, for example:

curl -s 'https://simonwillison.net/2023/May/15/per-interpreter-gils/' | \
llm --system 'Suggest topics for this post as a JSON array'
llm -s 'Suggest topics for this post as a JSON array'
2 changes: 1 addition & 1 deletion llm/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def cli():

@cli.command(name="prompt")
@click.argument("prompt", required=False)
@click.option("--system", help="System prompt to use")
@click.option("-s", "--system", help="System prompt to use")
@click.option("model_id", "-m", "--model", help="Model to use")
@click.option("-t", "--template", help="Template to use")
@click.option(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def test_templates_prompt_save(templates_path, args, expected_prompt, expected_e
),
(
"boo",
["--system", "s"],
["-s", "s"],
None,
None,
"Error: Cannot use -t/--template and --system together",
Expand Down

0 comments on commit d6bb09e

Please sign in to comment.