Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/styczynski/chatdb
ChatGPT-based database, wait... WHAT?
https://github.com/styczynski/chatdb
ai chatgpt cli database gpt-3 gpt3 gptchat key-value-database key-value-store library ml
Last synced: 3 months ago
JSON representation
ChatGPT-based database, wait... WHAT?
- Host: GitHub
- URL: https://github.com/styczynski/chatdb
- Owner: styczynski
- Created: 2022-12-08T20:35:58.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-08T21:05:13.000Z (almost 2 years ago)
- Last Synced: 2024-05-30T06:01:59.947Z (6 months ago)
- Topics: ai, chatgpt, cli, database, gpt-3, gpt3, gptchat, key-value-database, key-value-store, library, ml
- Language: Python
- Homepage:
- Size: 2.99 MB
- Stars: 75
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🖥️💬 ChatDB
**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!*](https://medium.com/@styczynski/probably-the-worst-database-ever-but-hey-it-can-write-poems-539b7757ad6d)[📚 Please can read full Medium article here](https://medium.com/@styczynski/probably-the-worst-database-ever-but-hey-it-can-write-poems-539b7757ad6d)
## How does it work?
1. We clone the repo: `git clone https://github.com/styczynski/chatdb.git`
2. We install dependencies: `poetry install`
3. Now we need to open the browser and navigate to https://chat.openai.com/chat and log in or sign up
4. We need to open console with F12
5. Open Application tab > Cookies
6. Copy the value for `__Secure-next-auth.session-token` and paste that into `OpenAPIAuth(session_token="YOUR SESSION TOKEN")` inside `demo.py`
7. Now the last step is to execute `poetry run python3 demo.py`![Chrome token](https://github.com/styczynski/chatdb/blob/main/static/token.png?raw=true)
## Supported features
* 🔁 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)`