-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to remove or replace a file from the Document? #31
Comments
Currently there's no API to directly edit the content of a document, and we use the We'll improve this area soon :-) |
We added the ability to delete documents. It doesn't fully address your question but it might help if you put one file per document. |
In my use case, I am trying to use Document as a knowledge database that can be managed in the form of maintaining files. I wonder if this scenario can be supported from semantic memory or if there are better practical methods available? |
@xbotter have you considere using tags and filters? E.g. rather than multiple files in the one document, uploading multiple documents with the same tag: var knowledgeBase1 = "001":
var knowledgeBase2 = "ABC":
await memory.ImportDocumentAsync(new Document()
.AddFile("file1.pdf").AddTag("KnowledgeBase", knowledgeBase1));
await memory.ImportDocumentAsync(new Document()
.AddFile("file2.pdf").AddTag("KnowledgeBase", knowledgeBase1));
await memory.ImportDocumentAsync(new Document()
.AddFile("file3.pdf").AddTag("KnowledgeBase", knowledgeBase1));
await memory.ImportDocumentAsync(new Document()
.AddFile("foobar.docx").AddTag("KnowledgeBase", knowledgeBase2));
var answer = await memory.AskAsync(question,
MemoryFilters.ByTag("KnowledgeBase", knowledgeBase1)); |
Thanks @dluc , I have successfully fulfilled my use case based on your suggestions and reference documents. |
Delete and then re-upload, it worked. |
If the file has changed or is no longer needed to be accessed in the current memory.
The text was updated successfully, but these errors were encountered: