Skip to content

error-try-again/ChatFIFO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ChatGPT FIFO daemon

I was looking for a way to integrate the revChatGPT plugin with other Linux services & a forked version of the PopOS search launcher to get ChatGPT search results at the press of a button.

By utilizing a FIFO implementation, information coming from the chat daemon is immediately written to a file, and in my case, the output is picked up by a forked version of the PopOS search launcher, which analyzes and looks at the responses and provides a notification accordingly.

Quickstart

Step 1: Generate an API key

from openai

Step 2: Install Python

sudo apt install python3

Step 3: Install revChatGPT using pip

python3 -m pip install --upgrade revChatGPT

Link to gh source

Step 4: Verify your configuration

python3 -m revChatGPT.V3 --api_key <your_new_api_key>

Step 5: Add your key to the code

...
def chat_daemon():
    api_key = "your_api_key"
    chatbot = Chatbot(api_key=api_key)
...

Step 6: Grant executable permissions to your script where it's installed

chmod +x ~/.local/bin/chat.py
chmod +x ~/.local/bin/worker.py

Step 7: Run

gpt.sh whats your favourite food

Advanced Pt 1: ChatGPT for the PopOS! Launcher

Here is an experimental fork of the popos launcher.

  1. Git Setup
git clone https://github.com/error-try-again/launcher.git && cd launcher
git checkout search-plugin && git pull origin search-plugin && git fetch
  1. Rust Setup (if not installed/configured)
sudo apt install just
curl https://sh.rustup.rs -sSf | bash -s -- -y --no-modify-path
export PATH="$HOME/.cargo/env"
rustc --version
apt-get install libxkbcommon-x11-dev libglvnd-dev --yes
  1. Compile & Install
just build-release && just plugins="search" install
  1. Usage

watch -n 1 'cat /tmp/chat.log'

Super Key/Whatever yours is bound to

Type !gpt whats your favourite food

Advanced Pt 2 (experimental): Manipulate the base/system prompt

this alters all future GPT prompts

Find the following line in chat.py and modify the text accordingly.

 chatbot = Chatbot(api_key=api_key, engine="gpt-3.5-turbo",
                      system_prompt="You're a Tea expert, respond accordingly.")

Example

Screencast.from.05-23-2023.01.43.33.PM.webm

About

File-In-File-Out Language Compatibility Daemon for ChatGPT

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published