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.
sudo apt install python3
python3 -m pip install --upgrade revChatGPT
python3 -m revChatGPT.V3 --api_key <your_new_api_key>
...
def chat_daemon():
api_key = "your_api_key"
chatbot = Chatbot(api_key=api_key)
...
chmod +x ~/.local/bin/chat.py
chmod +x ~/.local/bin/worker.py
gpt.sh whats your favourite food
Here is an experimental fork of the popos launcher.
- 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
- 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
- Compile & Install
just build-release && just plugins="search" install
- Usage
watch -n 1 'cat /tmp/chat.log'
Super Key/Whatever yours is bound to
Type
!gpt whats your favourite food
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.")