ChatDB (pronounced "theworstideaeverdb") is just incredibly stupid idea to convince ChatGPT instance using its API, that it's a key-value store and
use it as a database that is incredibly slow, makes mistakes and do not always repond using the same format, buuuut
at least it can write you a poem when summing up the values!
๐ Please can read full Medium article here
- We clone the repo:ย
git clone https://github.com/styczynski/chatdb.git - We install dependencies:
poetry install - Now we need to open the browser and navigate to https://chat.openai.com/chat and log in or sign up
- We need to open console with F12
- Open Application tab > Cookies
- Copy the value for
__Secure-next-auth.session-tokenand paste that intoOpenAPIAuth(session_token="YOUR SESSION TOKEN")insidedemo.py - Now the last step is to execute
poetry run python3 demo.py
- ๐ Very rough retries and function trying to convert model reponses to some form of standarized output
- โ Save values with
write("key", value) - ๐ Read value under key with
read("key") - ๐ฎ Delete key with
delete("key") - ๐ข List all key-value pairs with
all() - ๐ Filter values using regex for keys
filter("regex")(sometimes returns keys, sometimes values, sometimes both, it's okay to be undecided I guess?) - ๐ฌ
query("What is your purpose?")You can ask existential questions too! Let's be depressed together! - ๐ Get log of operations with
get_log() - โช Undo operations (that is suuuuper slow because we reconstruct the database) with
undo(2)

