repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | --- |
| #2 | title: 🗑 delete |
| #3 | --- |
| #4 | |
| #5 | ## Delete Document |
| #6 | |
| #7 | `delete()` method allows you to delete a document previously added to the app. |
| #8 | |
| #9 | ### Usage |
| #10 | |
| #11 | ```python |
| #12 | from embedchain import App |
| #13 | |
| #14 | app = App() |
| #15 | |
| #16 | forbes_doc_id = app.add("https://www.forbes.com/profile/elon-musk") |
| #17 | wiki_doc_id = app.add("https://en.wikipedia.org/wiki/Elon_Musk") |
| #18 | |
| #19 | app.delete(forbes_doc_id) # deletes the forbes document |
| #20 | ``` |
| #21 | |
| #22 | <Note> |
| #23 | If you do not have the document id, you can use `app.db.get()` method to get the document and extract the `hash` key from `metadatas` dictionary object, which serves as the document id. |
| #24 | </Note> |
| #25 | |
| #26 | |
| #27 | ## Delete Chat Session History |
| #28 | |
| #29 | `delete_session_chat_history()` method allows you to delete all previous messages in a chat history. |
| #30 | |
| #31 | ### Usage |
| #32 | |
| #33 | ```python |
| #34 | from embedchain import App |
| #35 | |
| #36 | app = App() |
| #37 | |
| #38 | app.add("https://www.forbes.com/profile/elon-musk") |
| #39 | |
| #40 | app.chat("What is the net worth of Elon Musk?") |
| #41 | |
| #42 | app.delete_session_chat_history() |
| #43 | ``` |
| #44 | |
| #45 | <Note> |
| #46 | `delete_session_chat_history(session_id="session_1")` method also accepts `session_id` optional param for deleting chat history of a specific session. |
| #47 | It assumes the default session if no `session_id` is provided. |
| #48 | </Note> |