Beru for Python
The official Python client for Beru: answers rooted in your documents, with citations and per-user memory.
pip install beru-ai # imported as `beru`
from beru import Beru
beru = Beru() # reads BERU_API_KEY; create a key in the Beru console under API keys
with open("handbook.pdf", "rb") as f:
document = beru.documents.upload(f, filename="handbook.pdf")
beru.documents.wait_until_ready(document["id"])
answer = beru.answer("How many days of annual leave do I get?", end_user_id="user_123")
print(answer["answer"])
for citation in answer["citations"]:
print(citation["number"], citation["document_title"], citation["page_from"])
# A follow-up in the same conversation
follow_up = beru.answer(
"And part-time staff?",
end_user_id="user_123",
conversation_id=answer["conversation_id"],
)
Stream an answer as it's written:
for event in beru.answer_stream("Is parking free?"):
if event.type == "delta":
print(event.text, end="", flush=True)
else:
print("\nSources:", event.answer["citations"])
AsyncBeru has the same methods, awaited:
from beru import AsyncBeru
async with AsyncBeru() as beru:
answer = await beru.answer("Is parking free?")
What's included
| Method | API |
|---|---|
documents.upload, add_url, list, get, delete, wait_until_ready |
/v1/documents |
retrieve (for your own model), answer, answer_stream, feedback |
/v1/retrieve, /v1/answer, /v1/feedback |
memories.add, extract, list, delete |
/v1/memories |
end_users.erase |
/v1/end-users/{id} |
usage |
/v1/usage |
Responses are typed dictionaries (beru.types) generated from Beru's OpenAPI file.
Errors and retries
Every error is a BeruError with code (for example plan_limit_exceeded), status, message
and request_id. Rate limits (429) are retried, honouring Retry-After; reads and uploads are also
retried after timeouts and temporary outages. Uploads carry an Idempotency-Key, so a retry never
uploads twice. Set max_retries=0 to turn retries off.
Docs: docs.airesearchlabs.si · Support: support@airesearchlabs.si
Metadata
Release files for beru-ai 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| beru_ai-0.1.0.tar.gz | 41.4 kB | Without provenance | Details for beru_ai-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| beru_ai-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for beru_ai-0.1.0-py3-none-any.whl |
Total release size: 51.9 kB
Release files / beru_ai-0.1.0.tar.gz
| Download URL | beru_ai-0.1.0.tar.gz |
|---|---|
| Size | 41.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a0571f2c9c438ef17ea030ccf50d3905b92e8777105139ac66b9f0c86dd6df4b
|
|
BLAKE2b-256 checksum How to use checksums |
8cf731c86d94716f5359927712b899b33bcf34ce880466774492cebebe793870
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / beru_ai-0.1.0-py3-none-any.whl
| Download URL | beru_ai-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
04172a5de2a4a0877390994fd221af3e446baafd925f69530a82453ebc67d9f4
|
|
BLAKE2b-256 checksum How to use checksums |
cbcc9cf5143656ca03cc416a0fb5c86543b3d7bb8731cc395be38cab6b5fc35a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for beru-ai 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.