private-gpt icon indicating copy to clipboard operation
private-gpt copied to clipboard

feat: make it a library and a cli

Open emilianobonassi opened this issue 2 years ago • 1 comments

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 scripts
  • ingest, executes the logic for ingesting documents
  • init, this is new and it's useful to bootstrap a new env, copying the default configuration and downloading the default model
  • reset, 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.

emilianobonassi avatar May 29 '23 07:05 emilianobonassi

I like your architecture.

RonquilloAeon avatar Jun 15 '23 16:06 RonquilloAeon