Skip to content

Search auto-completion for random topics using AI.

License

Notifications You must be signed in to change notification settings

viral32111/ai-auto-complete

Repository files navigation

AI Auto-Complete

CI CodeQL GitHub tag (with filter) GitHub repository size GitHub release downloads GitHub commit activity

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!

📜 Background

A website said it was doing this which made me want to try it out for myself 😛

📥 Usage

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).

⚙️ Configuration

The following environment variables are used to configure functionality:

  • EXPRESS_BROWSER_DIRECTORY
  • 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
  • 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.

🏗️ Building

  1. Clone this repository via git clone https://github.com/viral32111/ai-auto-complete.
  2. Open a terminal in the repository's directory.
  3. Install production & development dependencies via npm install.
  4. Create an environment variables file (.env) with the required properties.
  5. Launch via npm start.
  6. Open your web browser & navigate to the configured address.

🔗 Useful Links

⚖️ License

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.