This is a command-line app that uses the Anthropic LLM API to complete text input. Anthropic is a competitor to OpenAI and the creator of the Claude bot
It was built with Node.js and uses the dotenv
, node-fetch
, and readline
libraries.
To use this app, you need to have Node.js and NPM installed. Then, follow these steps:
- Clone this repository or download the source code.
- Navigate to the project directory in your terminal.
- Run
npm install
to install the required dependencies. - Get an Anthropic API key: Go to https://www.anthropic.com/product and request access.
The app uses the dotenv
library to load configuration options from a .env
file. You need to create this file (or edit and rename the .env.sample
file) in the project directory and add the following configuration options:
ANTHROPIC_API_KEY=YOUR_API_KEY
To use the app, follow these steps:
- Open your terminal and navigate to the project directory.
- Run
npm start
to start the app. - Enter a prompt and press Enter to submit it.
- The app will make a request to the Anthropic API and return the completed prompt.
You can exit the app at any time by typing "exit" and pressing Enter.
Note: This app uses the text completion API e.g. make a request and get a response. It does not remember context and therefore is not a chatbot
This app uses the following Node.js libraries:
dotenv
: Loads environment variables from a.env
file.node-fetch
: Makes HTTP requests to the Anthropic API.readline
: Provides an interface for reading input from the command line.
This app was created by Roger Kibbe @rogerkibbe.