This is a demonstration of using OpenAI's GPT natural language models to generate suggestions & auto-completions for searches.
NOTE: This project is under development so functionality is not guaranteed!
A website said it was doing this which made me want to try it out for myself 😛
The recommended way to use this project is via the Docker image.
Run the following command to download the image and create a container:
docker run \
--name ai-auto-complete \
--env OPENAI_API_KEY=YOUR_API_KEY_HERE \
--publish 6900:6900 \
--detach \
ghcr.io/viral32111/ai-auto-complete:latest
Ensure to replace YOUR_API_KEY_HERE
with your OpenAI API key (see configuration).
The following environment variables are used to configure functionality:
EXPRESS_BROWSER_DIRECTORY
- The path to the browser directory.
- Defaults to
./browser
.
EXPRESS_ADDRESS
- The IP address to listen for web requests on.
- Defaults to
127.0.0.1
.
EXPRESS_PORT
- The port number to listen for web requests on.
- Defaults to
6900
.
OPENAI_API_KEY
- Your OpenAI account API key.
OPENAI_MODEL
- The name of an OpenAI model your account has access to.
- Defaults to
text-davinci-003
.
MAX_COMPLETIONS
- The maximum number of completions to generate.
- Defaults to
5
.
MAX_QUERY_LENGTH
- The maximum character length of a search query.
- Defaults to
100
.
- Clone this repository via
git clone https://github.com/viral32111/ai-auto-complete
. - Open a terminal in the repository's directory.
- Install production & development dependencies via
npm install
. - Create an environment variables file (
.env
) with the required properties. - Launch via
npm start
. - Open your web browser & navigate to the configured address.
- Tailwind CSS documentation
- Webpack configuration documentation
- OpenAI completion guide
- OpenAI completions API reference
- Express guide
- NPM log4js package
- NPM dotenv package
- NPM openai package
Copyright (C) 2023 viral32111.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses.