private-gpt
private-gpt copied to clipboard
feat: make it a library and a cli
Fixes #525
Keep the same interface for ingest.py and privateGPT.py but refactored to use a library and a CLI.
I've built this, to speed up my own usage and to prepare for building a specific client. Sharing with the community thinking it will be useful for you too.
With this PR, privateGPT.py becomes a Click-based CLI exposing the following commands:
chat, the default command when the CLI is invoked without command that runs the original privateGPT scriptsingest, executes the logic for ingesting documentsinit, this is new and it's useful to bootstrap a new env, copying the default configuration and downloading the default modelreset, just drop the database (instead of dropping manually the folder)`
Example of launching privateGPT.py --help
Usage: privateGPT.py [OPTIONS] COMMAND [ARGS]...
Ask questions to your documents without an internet connection, using the
power of LLMs.
Options:
--help Show this message and exit.
Commands:
chat Query your documents.
ingest Ingest your documents.
init Inititalize with default settings.
reset Reset your database.
NB: it's the beginning of making a library, a few things like setup.py and others are missing but could be added after this.
I like your architecture.