This is my private thing that I use everyday, deployed at www.nevdelap.com/chat (behind auth), because it does exactly what I want and nothing else.
paru -Sy unzip
mkdir -p ~/miniconda3 &&
cd ~/miniconda3 &&
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
-O miniconda.sh &&
bash miniconda.sh -b -u -p ~/miniconda3 &&
rm miniconda.sh &&
mkdir ~/nevschat &&
cd ~/nevschat &&
git clone git@github.com:nevdelap/droplet.git &&
git clone git@github.com:nevdelap/nevschat.git &&
cd nevschat &&
git submodule init &&
git submodule update &&
scripts/install_dev
cd reflex &&
git fetch &&
git checkout v0.4.6 &&
cd .. &&
git add reflex &&
git commit -m 'Update reflex.' &&
pip install -e reflex
cd app &&
reflex run # Test at http://localhost:3000/
This shows scripts/lint
being run manually though it can be run automatically
with scripts/install_hooks
.
git add . &&
git commit -m 'whatever' &&
scripts/lint &&
git push --force origin HEAD:master --no-verify &&
git tag --force latest &&
git push --force origin latest --no-verify &&
ssh_droplet "cd ~/nevschat && scripts/deploy && sleep 30 && scripts/logs"
The OpenAI key is supplied in the OPENAI_API_KEY environment variable. It should be configured with a monthly budget and email notification when it is exceeded.
The Google TTS API key is supplied the GOOGLE_TTS_KEY environment variable. It should be restricted to be usable only for the Cloud Text-to-Speech API, only only from the production and development IP addresses.
- nevschat.py
- vstack
- title
- chat (in chat.py)
- cancel X
- vstack
- chat.py
- chat
- vstack contains
- wrap with the checkboxes, radio buttons, and dropdowns.
- foreach has the previous prompts_responses each rendered by prompt_response_box.
- hstack has the next prompt with buttons.
- vstack contains
- prompt_response_box
- has a conditional, rendering a prompt as being edited, or not edited with buttons.
- if not being edited and is being generated renders a cancel button next to the response.
- chat