Browse Source

feat: reset (#169)

cachho 2 năm trước cách đây
mục cha
commit
f3888cc7a8
2 tập tin đã thay đổi với 17 bổ sung0 xóa
  1. 9 0
      README.md
  2. 8 0
      embedchain/embedchain.py

+ 9 - 0
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

+ 8 - 0
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.