BerryDbNew 1.6.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- berrydbnew-1.6.10/PKG-INFO +57 -0
- berrydbnew-1.6.10/README.md +39 -0
- berrydbnew-1.6.10/annotation_project/__init__.py +0 -0
- berrydbnew-1.6.10/annotation_project/annotation_project.py +677 -0
- berrydbnew-1.6.10/berrydb/BerryDB.py +819 -0
- berrydbnew-1.6.10/berrydb/IngestFileType.py +7 -0
- berrydbnew-1.6.10/berrydb/IngestType.py +6 -0
- berrydbnew-1.6.10/berrydb/__init__.py +11 -0
- berrydbnew-1.6.10/berrydb/berrydb_settings.py +354 -0
- berrydbnew-1.6.10/berrydb/eval_metrics.py +11 -0
- berrydbnew-1.6.10/berrydb/llm_agent.py +455 -0
- berrydbnew-1.6.10/constants/__init__.py +1 -0
- berrydbnew-1.6.10/constants/constants.py +160 -0
- berrydbnew-1.6.10/database/__init__.py +1 -0
- berrydbnew-1.6.10/database/database.py +2375 -0
- berrydbnew-1.6.10/evaluator/__init__.py +1 -0
- berrydbnew-1.6.10/evaluator/berrydb_rag_evaluator.py +134 -0
- berrydbnew-1.6.10/fts/__init__.py +1 -0
- berrydbnew-1.6.10/fts/fts.py +94 -0
- berrydbnew-1.6.10/model_garden/__init__.py +0 -0
- berrydbnew-1.6.10/model_garden/annotations_config.py +542 -0
- berrydbnew-1.6.10/model_garden/model.py +576 -0
- berrydbnew-1.6.10/model_garden/model_config.py +1324 -0
- berrydbnew-1.6.10/model_garden/model_provider.py +9 -0
- berrydbnew-1.6.10/model_garden/model_repo.py +576 -0
- berrydbnew-1.6.10/pyproject.toml +38 -0
- berrydbnew-1.6.10/utils/__init__.py +1 -0
- berrydbnew-1.6.10/utils/berrydb_init_exception.py +11 -0
- berrydbnew-1.6.10/utils/berrydb_metrics.py +11 -0
- berrydbnew-1.6.10/utils/http_client.py +116 -0
- berrydbnew-1.6.10/utils/redaction.py +189 -0
- berrydbnew-1.6.10/utils/utils.py +161 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: BerryDbNew
|
|
3
|
+
Version: 1.6.10
|
|
4
|
+
Summary: The database for unstructured data and AI apps
|
|
5
|
+
License: Proprietary
|
|
6
|
+
Author: BerryDB
|
|
7
|
+
Requires-Python: >=3.11,<4.0
|
|
8
|
+
Classifier: License :: Other/Proprietary License
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
14
|
+
Requires-Dist: requests
|
|
15
|
+
Project-URL: Homepage, https://berrydb.io
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
## BerryDB
|
|
19
|
+
|
|
20
|
+
<!--- - [Getting Started](https://berrydb.io/blog/getting-started) -->
|
|
21
|
+
<!--- - [Why BerryDB?](https://berrydb.io/blog/why-berrydb) -->
|
|
22
|
+
- [Documentation](https://docs.berrydb.io/python-sdk/)
|
|
23
|
+
|
|
24
|
+
### Bulk writes (1.6.10+)
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from berrydb import BerryDB
|
|
28
|
+
|
|
29
|
+
BerryDB.init("app.berrydb.io")
|
|
30
|
+
db = BerryDB.connect(api_key, "MyDatabase")
|
|
31
|
+
|
|
32
|
+
# Documents: batched POST /berrydb/documents/bulk (500 per request, retries on 429/5xx).
|
|
33
|
+
# An upsert REPLACES each stored document - send complete documents.
|
|
34
|
+
result = db.bulk_upsert(documents)
|
|
35
|
+
print(result["upserted"], "written;", result["failed"], "failed")
|
|
36
|
+
|
|
37
|
+
# Annotations: async POST /berrydb/annotate-bulk job, polled until finished.
|
|
38
|
+
# Merged server-side (like add_annotations); falls back to per-document calls on older servers.
|
|
39
|
+
result = db.bulk_annotate(
|
|
40
|
+
[{"document_id": doc_id, "annotations": [annotation]} for doc_id, annotation in pairs],
|
|
41
|
+
task="ner", annotated_field="content.text",
|
|
42
|
+
)
|
|
43
|
+
print(result["status"], result["succeeded"], result["failed"], result["errors"][:5])
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`db.upsert(list)` keeps working and now batches lists longer than 500 documents;
|
|
47
|
+
`db.get_all_documents()` follows server-side pages so it still returns every document.
|
|
48
|
+
|
|
49
|
+
### Logging and API keys
|
|
50
|
+
|
|
51
|
+
The SDK never prints or logs API keys: request URLs (which carry the `apiKey`
|
|
52
|
+
query parameter), exception messages and debug output are redacted, and the SDK
|
|
53
|
+
no longer changes your root logger level. To see SDK diagnostics, set
|
|
54
|
+
`constants.constants.debug_mode = True` and enable DEBUG for the SDK's loggers.
|
|
55
|
+
|
|
56
|
+
See [CHANGELOG.md](CHANGELOG.md) for details.
|
|
57
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
## BerryDB
|
|
2
|
+
|
|
3
|
+
<!--- - [Getting Started](https://berrydb.io/blog/getting-started) -->
|
|
4
|
+
<!--- - [Why BerryDB?](https://berrydb.io/blog/why-berrydb) -->
|
|
5
|
+
- [Documentation](https://docs.berrydb.io/python-sdk/)
|
|
6
|
+
|
|
7
|
+
### Bulk writes (1.6.10+)
|
|
8
|
+
|
|
9
|
+
```python
|
|
10
|
+
from berrydb import BerryDB
|
|
11
|
+
|
|
12
|
+
BerryDB.init("app.berrydb.io")
|
|
13
|
+
db = BerryDB.connect(api_key, "MyDatabase")
|
|
14
|
+
|
|
15
|
+
# Documents: batched POST /berrydb/documents/bulk (500 per request, retries on 429/5xx).
|
|
16
|
+
# An upsert REPLACES each stored document - send complete documents.
|
|
17
|
+
result = db.bulk_upsert(documents)
|
|
18
|
+
print(result["upserted"], "written;", result["failed"], "failed")
|
|
19
|
+
|
|
20
|
+
# Annotations: async POST /berrydb/annotate-bulk job, polled until finished.
|
|
21
|
+
# Merged server-side (like add_annotations); falls back to per-document calls on older servers.
|
|
22
|
+
result = db.bulk_annotate(
|
|
23
|
+
[{"document_id": doc_id, "annotations": [annotation]} for doc_id, annotation in pairs],
|
|
24
|
+
task="ner", annotated_field="content.text",
|
|
25
|
+
)
|
|
26
|
+
print(result["status"], result["succeeded"], result["failed"], result["errors"][:5])
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`db.upsert(list)` keeps working and now batches lists longer than 500 documents;
|
|
30
|
+
`db.get_all_documents()` follows server-side pages so it still returns every document.
|
|
31
|
+
|
|
32
|
+
### Logging and API keys
|
|
33
|
+
|
|
34
|
+
The SDK never prints or logs API keys: request URLs (which carry the `apiKey`
|
|
35
|
+
query parameter), exception messages and debug output are redacted, and the SDK
|
|
36
|
+
no longer changes your root logger level. To see SDK diagnostics, set
|
|
37
|
+
`constants.constants.debug_mode = True` and enable DEBUG for the SDK's loggers.
|
|
38
|
+
|
|
39
|
+
See [CHANGELOG.md](CHANGELOG.md) for details.
|
|
File without changes
|