Private documents per end user
Most documents are shared: every question in the project can use them. A private document
belongs to one end user, your own id for one of your customers. Only questions asked with that same
end_user_id can use it.
Upload a private document
Section titled “Upload a private document”Add end_user_id to the upload.
curl https://api.beru.airesearchlabs.si/v1/documents \ -H "Authorization: Bearer $BERU_API_KEY" \ -F file=@treatment-plan.pdf \ -F end_user_id=customer_4821with open("treatment-plan.pdf", "rb") as f: beru.documents.upload(f, filename="treatment-plan.pdf", end_user_id="customer_4821")await beru.documents.upload({ file: new Blob([await readFile("treatment-plan.pdf")]), filename: "treatment-plan.pdf", end_user_id: "customer_4821",});Ask as that person
Section titled “Ask as that person”Send the same end_user_id with the question. Beru searches the shared documents plus that
person’s private ones, and recalls their memories.
curl https://api.beru.airesearchlabs.si/v1/answer \ -H "Authorization: Bearer $BERU_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "When is my next appointment?", "end_user_id": "customer_4821"}'Without end_user_id, or with anyone else’s, the private document is never searched, cited or
mentioned. This is enforced in the database and tested on every release.
List and delete
Section titled “List and delete”# Only this person's private documentscurl "https://api.beru.airesearchlabs.si/v1/documents?end_user_id=customer_4821" \ -H "Authorization: Bearer $BERU_API_KEY"
# Delete one: the file and everything learned from it go at oncecurl -X DELETE https://api.beru.airesearchlabs.si/v1/documents/DOCUMENT_ID \ -H "Authorization: Bearer $BERU_API_KEY"