Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command-name settings for --help #630

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

web-sst
Copy link

@web-sst web-sst commented Nov 13, 2024

Adding these name settings enables --help for them. Without them I get the help for prompt.

@simonw
Copy link
Owner

simonw commented Nov 14, 2024

Currently I get this:

llm chat --help
Usage: llm chat [OPTIONS]

  Hold an ongoing chat with a model.

Options:
  -s, --system TEXT            System prompt to use
  -m, --model TEXT             Model to use
  -c, --continue               Continue the most recent conversation.
  --cid, --conversation TEXT   Continue the conversation with the given ID.
  -t, --template TEXT          Template to use
  -p, --param <TEXT TEXT>...   Parameters for template
  -o, --option <TEXT TEXT>...  key/value options for the model
  --no-stream                  Do not stream output
  --key TEXT                   API key to use
  --help                       Show this message and exit.

I might be misunderstanding what this PR does - what's the problem it fixes?

@web-sst
Copy link
Author

web-sst commented Nov 14, 2024

Apologies, I should have been clearer. I got here through embed-multi:

(venv) d01$ llm embed-multi --help
Usage: llm prompt [OPTIONS] [PROMPT]

  Execute a prompt

  Documentation: https://llm.datasette.io/en/stable/usage.html

  Examples:

      llm 'Capital of France?'
      llm 'Capital of France?' -m gpt-4o
      llm 'Capital of France?' -s 'answer in Spanish'

  Multi-modal models can be called with attachments like this:

      llm 'Extract text from this image' -a image.jpg
      llm 'Describe' -a https://static.simonwillison.net/static/2024/pelicans.jpg
      cat image | llm 'describe image' -a -
      # With an explicit mimetype:
      cat image | llm 'describe image' --at - image/jpeg

Options:
  -s, --system TEXT               System prompt to use
  -m, --model TEXT                Model to use
  -a, --attachment ATTACHMENT     Attachment path or URL or -
  --at, --attachment-type <TEXT TEXT>...
                                  Attachment with explicit mimetype
  -o, --option <TEXT TEXT>...     key/value options for the model
  -t, --template TEXT             Template to use
  -p, --param <TEXT TEXT>...      Parameters for template
  --no-stream                     Do not stream output
  -n, --no-log                    Don't log to database
  --log                           Log prompt and response to the database
  -c, --continue                  Continue the most recent conversation.
  --cid, --conversation TEXT      Continue the conversation with the given ID.
  --key TEXT                      API key to use
  --save TEXT                     Save prompt with this template name
  --help                          Show this message and exit.

Also, llm embed_multi --help does produce the expected help output.

@simonw
Copy link
Owner

simonw commented Nov 14, 2024

This is weird, I'm not able to replicate your result. Here's what I get on macOS:

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
...

What operating system are you using?

For me, llm embed_multi --help (with the underscore) shows the same output as llm prompt --help.

@web-sst
Copy link
Author

web-sst commented Nov 14, 2024

I'm on FreeBSD 14.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants