From f3888cc7a8719a1ad03618c24e8340d831b98a90 Mon Sep 17 00:00:00 2001 From: cachho Date: Thu, 6 Jul 2023 21:15:01 +0200 Subject: [PATCH] feat: reset (#169) --- README.md | 9 +++++++++ embedchain/embedchain.py | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/README.md b/README.md index e28aedef..4636f841 100644 --- a/README.md +++ b/README.md @@ -323,6 +323,15 @@ All options for query and... *coming soon* +## Other methods + +### Reset +Resets the database and deletes all embeddings. Irreversible. Requires reinitialization afterwards. + +```python +app.reset() +``` + # How does it work? Creating a chat bot over any dataset needs the following steps to happen diff --git a/embedchain/embedchain.py b/embedchain/embedchain.py index 12a6697a..2835171e 100644 --- a/embedchain/embedchain.py +++ b/embedchain/embedchain.py @@ -299,6 +299,14 @@ class EmbedChain: return prompt + def reset(self): + """ + Resets the database. Deletes all embeddings irreversibly. + `App` has to be reinitialized after using this method. + """ + self.db_client.reset() + + class App(EmbedChain): """ The EmbedChain app.