AGPT
AGPT (Assistant with GPT) is a command line tool for interacting with OpenAI's GPT chat completion API. It allows you to ask questions and receive generated answers from OpenAI's GPT models. AGPT saves your questions and answers locally for easy reference.
Installation
Git
- Make sure you have Node.js installed on your machine.
- Download or clone this repository.
- Navigate to the repository folder in your terminal or command prompt.
- Run
npm install
to install the necessary dependencies.
NPM
- Make sure you have Node.js installed on your machine.
- Run
npm install agpt
(optionally with -g)
Usage
To use AGPT, navigate to the repository folder in your terminal or command prompt and run:
node index.js [options] ["question"]
Options:
-h, --help Show help message
--set-api-key Set API key in the config file
--set-questions-directory Set questions directory in the config file
--set-model Set model in the config file
-c, --config Set config file path for this run only
-m, --model Use supplied model for this run only
-s, --system-prompt Set the system prompt for this question
-n, --question-name Set question name (should not contain spaces)
--setup Only setup the question, don't query the API
--no-context Don't use context from previous questions
Configuration
Before using AGPT, you need to set your OpenAI API key. You can obtain your API key from the OpenAI Developer Dashboard.
Set your API key by running:
node index.js --set-api-key "your_api_key_here"
You can also configure the questions directory to store your questions and answers:
node index.js --set-questions-directory "/path/to/your/questions/directory"
If you want to use a different GPT model (e.g. gpt-4
), you can set it using:
node index.js --set-model "model_name"
Example
Ask a question:
node index.js -n "meaning-of-life" "What is the meaning of life?"
Ask a followup question to the answer you just received (by leaving out the -n
):
node index.js "Who said it was 42?"
Set a system prompt:
node index.js -n "meaning-of-life" -s "Please provide a philosophical answer." "What is the meaning of life?"
For more examples and detailed usage instructions, you can check the help message with:
node index.js --help
Author
Stef Dunlap
License
MD GPL