nucliadb-utils 5.0.1.post1080__py3-none-any.whl → 5.0.1.post1100__py3-none-any.whl
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.
- nucliadb_utils/aiopynecone/client.py +42 -5
- nucliadb_utils/audit/audit.py +1 -1
- nucliadb_utils/audit/basic.py +1 -1
- nucliadb_utils/audit/stream.py +2 -2
- nucliadb_utils/nuclia_usage/protos/kb_usage_pb2.py +28 -30
- nucliadb_utils/nuclia_usage/protos/kb_usage_pb2.pyi +28 -201
- nucliadb_utils/nuclia_usage/protos/kb_usage_pb2_grpc.py +1 -1
- nucliadb_utils/nuclia_usage/protos/kb_usage_pb2_grpc.pyi +1 -0
- nucliadb_utils/nuclia_usage/utils/kb_usage_report.py +2 -6
- {nucliadb_utils-5.0.1.post1080.dist-info → nucliadb_utils-5.0.1.post1100.dist-info}/METADATA +3 -3
- {nucliadb_utils-5.0.1.post1080.dist-info → nucliadb_utils-5.0.1.post1100.dist-info}/RECORD +14 -14
- {nucliadb_utils-5.0.1.post1080.dist-info → nucliadb_utils-5.0.1.post1100.dist-info}/WHEEL +0 -0
- {nucliadb_utils-5.0.1.post1080.dist-info → nucliadb_utils-5.0.1.post1100.dist-info}/top_level.txt +0 -0
- {nucliadb_utils-5.0.1.post1080.dist-info → nucliadb_utils-5.0.1.post1100.dist-info}/zip-safe +0 -0
@@ -28,7 +28,7 @@ from typing import Any, AsyncGenerator, Optional
|
|
28
28
|
import backoff
|
29
29
|
import httpx
|
30
30
|
|
31
|
-
from nucliadb_telemetry.metrics import Observer
|
31
|
+
from nucliadb_telemetry.metrics import INF, Histogram, Observer
|
32
32
|
from nucliadb_utils.aiopynecone.exceptions import (
|
33
33
|
PineconeAPIError,
|
34
34
|
PineconeRateLimitError,
|
@@ -46,6 +46,25 @@ from nucliadb_utils.aiopynecone.models import (
|
|
46
46
|
|
47
47
|
logger = logging.getLogger(__name__)
|
48
48
|
|
49
|
+
upsert_batch_size_histogram = Histogram(
|
50
|
+
"pinecone_upsert_batch_size",
|
51
|
+
buckets=[10.0, 100.0, 200.0, 500.0, 1000.0, 5000.0, INF],
|
52
|
+
)
|
53
|
+
upsert_batch_count_histogram = Histogram(
|
54
|
+
"pinecone_upsert_batch_count",
|
55
|
+
buckets=[0.0, 1.0, 2.0, 3.0, 5.0, 10.0, 15.0, 20.0, 30.0, 50.0, INF],
|
56
|
+
)
|
57
|
+
|
58
|
+
delete_batch_size_histogram = Histogram(
|
59
|
+
"pinecone_delete_batch_size",
|
60
|
+
buckets=[1.0, 5.0, 10.0, 20.0, 50.0, 100.0, 150.0, INF],
|
61
|
+
)
|
62
|
+
|
63
|
+
delete_batch_count_histogram = Histogram(
|
64
|
+
"pinecone_delete_batch_count",
|
65
|
+
buckets=[0.0, 1.0, 2.0, 3.0, 5.0, 10.0, 15.0, 20.0, 30.0, 50.0, INF],
|
66
|
+
)
|
67
|
+
|
49
68
|
|
50
69
|
pinecone_observer = Observer(
|
51
70
|
"pinecone_client",
|
@@ -57,7 +76,6 @@ pinecone_observer = Observer(
|
|
57
76
|
|
58
77
|
DEFAULT_TIMEOUT = 30
|
59
78
|
CONTROL_PLANE_BASE_URL = "https://api.pinecone.io/"
|
60
|
-
INDEX_HOST_BASE_URL = "https://{index_host}/"
|
61
79
|
BASE_API_HEADERS = {
|
62
80
|
"Content-Type": "application/json",
|
63
81
|
"Accept": "application/json",
|
@@ -198,6 +216,7 @@ class DataPlane:
|
|
198
216
|
if len(vectors) == 0:
|
199
217
|
# Nothing to upsert.
|
200
218
|
return
|
219
|
+
upsert_batch_size_histogram.observe(len(vectors))
|
201
220
|
headers = {"Api-Key": self.api_key}
|
202
221
|
payload = UpsertRequest(vectors=vectors)
|
203
222
|
post_kwargs: dict[str, Any] = {
|
@@ -261,7 +280,10 @@ class DataPlane:
|
|
261
280
|
for batch in batchify(vectors, batch_size):
|
262
281
|
tasks.append(asyncio.create_task(_upsert_batch(batch)))
|
263
282
|
|
264
|
-
|
283
|
+
upsert_batch_count_histogram.observe(len(tasks))
|
284
|
+
|
285
|
+
if len(tasks) > 0:
|
286
|
+
await asyncio.gather(*tasks)
|
265
287
|
|
266
288
|
@backoff.on_exception(
|
267
289
|
backoff.expo,
|
@@ -280,8 +302,16 @@ class DataPlane:
|
|
280
302
|
"""
|
281
303
|
if len(ids) > MAX_DELETE_BATCH_SIZE:
|
282
304
|
raise ValueError(f"Maximum number of ids in a single request is {MAX_DELETE_BATCH_SIZE}.")
|
305
|
+
if len(ids) == 0: # pragma: no cover
|
306
|
+
return
|
283
307
|
|
308
|
+
delete_batch_size_histogram.observe(len(ids))
|
284
309
|
headers = {"Api-Key": self.api_key}
|
310
|
+
|
311
|
+
# This is a temporary log info to hunt down a bug.
|
312
|
+
rids = {vid.split("/")[0] for vid in ids}
|
313
|
+
logger.info(f"Deleting vectors from resources: {list(rids)}")
|
314
|
+
|
285
315
|
payload = {"ids": ids}
|
286
316
|
post_kwargs: dict[str, Any] = {
|
287
317
|
"headers": headers,
|
@@ -428,7 +458,10 @@ class DataPlane:
|
|
428
458
|
async for batch in async_batchify(async_iterable, batch_size):
|
429
459
|
tasks.append(asyncio.create_task(_delete_batch(batch)))
|
430
460
|
|
431
|
-
|
461
|
+
delete_batch_count_histogram.observe(len(tasks))
|
462
|
+
|
463
|
+
if len(tasks) > 0:
|
464
|
+
await asyncio.gather(*tasks)
|
432
465
|
|
433
466
|
@backoff.on_exception(
|
434
467
|
backoff.expo,
|
@@ -516,8 +549,12 @@ class PineconeSession:
|
|
516
549
|
if session is not None:
|
517
550
|
return session
|
518
551
|
|
552
|
+
base_url = index_host
|
553
|
+
if not index_host.startswith("https://"):
|
554
|
+
base_url = f"https://{index_host}/"
|
555
|
+
|
519
556
|
session = httpx.AsyncClient(
|
520
|
-
base_url=
|
557
|
+
base_url=base_url,
|
521
558
|
headers=BASE_API_HEADERS,
|
522
559
|
timeout=DEFAULT_TIMEOUT,
|
523
560
|
)
|
nucliadb_utils/audit/audit.py
CHANGED
@@ -94,7 +94,7 @@ class AuditStorage:
|
|
94
94
|
):
|
95
95
|
raise NotImplementedError
|
96
96
|
|
97
|
-
def
|
97
|
+
def report_storage(self, kbid: str, paragraphs: int, fields: int, bytes: int):
|
98
98
|
raise NotImplementedError
|
99
99
|
|
100
100
|
def report_resources(
|
nucliadb_utils/audit/basic.py
CHANGED
@@ -95,7 +95,7 @@ class BasicAuditStorage(AuditStorage):
|
|
95
95
|
):
|
96
96
|
logger.debug(f"CHAT {kbid} {user} {origin}")
|
97
97
|
|
98
|
-
def
|
98
|
+
def report_storage(self, kbid: str, paragraphs: int, fields: int, bytes: int):
|
99
99
|
logger.debug(f"FIELDS & PARAGRAPHS {kbid} {paragraphs} {fields}")
|
100
100
|
|
101
101
|
def report_resources(
|
nucliadb_utils/audit/stream.py
CHANGED
@@ -280,13 +280,13 @@ class StreamAuditStorage(AuditStorage):
|
|
280
280
|
|
281
281
|
self.send(auditrequest)
|
282
282
|
|
283
|
-
def
|
283
|
+
def report_storage(self, kbid: str, paragraphs: int, fields: int, bytes: int):
|
284
284
|
self.kb_usage_utility.send_kb_usage(
|
285
285
|
service=Service.NUCLIA_DB,
|
286
286
|
account_id=None,
|
287
287
|
kb_id=kbid,
|
288
288
|
kb_source=KBSource.HOSTED,
|
289
|
-
storage=Storage(paragraphs=paragraphs, fields=fields),
|
289
|
+
storage=Storage(paragraphs=paragraphs, fields=fields, bytes=bytes),
|
290
290
|
)
|
291
291
|
|
292
292
|
def report_resources(
|
@@ -27,7 +27,6 @@ from google.protobuf import descriptor as _descriptor
|
|
27
27
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
28
28
|
from google.protobuf import symbol_database as _symbol_database
|
29
29
|
from google.protobuf.internal import builder as _builder
|
30
|
-
|
31
30
|
# @@protoc_insertion_point(imports)
|
32
31
|
|
33
32
|
_sym_db = _symbol_database.Default()
|
@@ -35,37 +34,36 @@ _sym_db = _symbol_database.Default()
|
|
35
34
|
|
36
35
|
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
)
|
37
|
+
|
38
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15protos/kb_usage.proto\x12\x08kb_usage\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf2\x01\n\x07Process\x12$\n\x06\x63lient\x18\x01 \x01(\x0e\x32\x14.kb_usage.ClientType\x12\x1c\n\x14slow_processing_time\x18\x02 \x01(\x02\x12\x1b\n\x13pre_processing_time\x18\x03 \x01(\x02\x12\r\n\x05\x62ytes\x18\x04 \x01(\x04\x12\r\n\x05\x63hars\x18\x05 \x01(\r\x12\x15\n\rmedia_seconds\x18\x06 \x01(\r\x12\r\n\x05pages\x18\x07 \x01(\r\x12\x12\n\nparagraphs\x18\x08 \x01(\r\x12\x17\n\x0bmedia_files\x18\t \x01(\rB\x02\x18\x01\x12\x15\n\rnum_processed\x18\n \x01(\r\"\x95\x01\n\x07Storage\x12\x17\n\nparagraphs\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x13\n\x06\x66ields\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12\x16\n\tresources\x18\x03 \x01(\x04H\x02\x88\x01\x01\x12\x12\n\x05\x62ytes\x18\x04 \x01(\x04H\x03\x88\x01\x01\x42\r\n\x0b_paragraphsB\t\n\x07_fieldsB\x0c\n\n_resourcesB\x08\n\x06_bytes\"x\n\x06Search\x12$\n\x06\x63lient\x18\x01 \x01(\x0e\x32\x14.kb_usage.ClientType\x12\"\n\x04type\x18\x02 \x01(\x0e\x32\x14.kb_usage.SearchType\x12\x0e\n\x06tokens\x18\x03 \x01(\r\x12\x14\n\x0cnum_searches\x18\x04 \x01(\r\"\xa7\x01\n\x07Predict\x12$\n\x06\x63lient\x18\x01 \x01(\x0e\x32\x14.kb_usage.ClientType\x12#\n\x04type\x18\x02 \x01(\x0e\x32\x15.kb_usage.PredictType\x12\r\n\x05model\x18\x03 \x01(\t\x12\r\n\x05input\x18\x04 \x01(\r\x12\x0e\n\x06output\x18\x05 \x01(\r\x12\r\n\x05image\x18\x06 \x01(\r\x12\x14\n\x0cnum_predicts\x18\x07 \x01(\r\"\xed\x02\n\x07KbUsage\x12\"\n\x07service\x18\x01 \x01(\x0e\x32\x11.kb_usage.Service\x12-\n\ttimestamp\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\naccount_id\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x12\n\x05kb_id\x18\x04 \x01(\tH\x01\x88\x01\x01\x12%\n\tkb_source\x18\x05 \x01(\x0e\x32\x12.kb_usage.KBSource\x12$\n\tprocesses\x18\x06 \x03(\x0b\x32\x11.kb_usage.Process\x12#\n\x08predicts\x18\x07 \x03(\x0b\x32\x11.kb_usage.Predict\x12\"\n\x08searches\x18\x08 \x03(\x0b\x32\x10.kb_usage.Search\x12\'\n\x07storage\x18\t \x01(\x0b\x32\x11.kb_usage.StorageH\x02\x88\x01\x01\x42\r\n\x0b_account_idB\x08\n\x06_kb_idB\n\n\x08_storage\"9\n\x11KbUsageAggregated\x12$\n\tkb_usages\x18\x01 \x03(\x0b\x32\x11.kb_usage.KbUsage*\"\n\x08KBSource\x12\n\n\x06HOSTED\x10\x00\x12\n\n\x06ONPREM\x10\x01*5\n\x07Service\x12\x0b\n\x07PREDICT\x10\x00\x12\x0e\n\nPROCESSING\x10\x01\x12\r\n\tNUCLIA_DB\x10\x02*%\n\nSearchType\x12\n\n\x06SEARCH\x10\x00\x12\x0b\n\x07SUGGEST\x10\x01*\xa0\x01\n\x0bPredictType\x12\x0c\n\x08SENTENCE\x10\x00\x12\t\n\x05TOKEN\x10\x01\x12\x13\n\x0fQUESTION_ANSWER\x10\x02\x12\x0c\n\x08REPHRASE\x10\x03\x12\r\n\tSUMMARIZE\x10\x04\x12\x12\n\x0e\x45XTRACT_TABLES\x10\x05\x12\n\n\x06RERANK\x10\x06\x12\r\n\tRELATIONS\x10\x07\x12\n\n\x06SPEECH\x10\x08\x12\x0b\n\x07\x43\x41PTION\x10\t*j\n\nClientType\x12\x07\n\x03\x41PI\x10\x00\x12\x07\n\x03WEB\x10\x01\x12\n\n\x06WIDGET\x10\x02\x12\x0b\n\x07\x44\x45SKTOP\x10\x03\x12\r\n\tDASHBOARD\x10\x04\x12\x14\n\x10\x43HROME_EXTENSION\x10\x05\x12\x0c\n\x08INTERNAL\x10\x06\x62\x06proto3')
|
41
39
|
|
42
40
|
_globals = globals()
|
43
41
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
44
|
-
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR,
|
42
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'protos.kb_usage_pb2', _globals)
|
45
43
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
44
|
+
DESCRIPTOR._options = None
|
45
|
+
_globals['_PROCESS'].fields_by_name['media_files']._options = None
|
46
|
+
_globals['_PROCESS'].fields_by_name['media_files']._serialized_options = b'\030\001'
|
47
|
+
_globals['_KBSOURCE']._serialized_start=1184
|
48
|
+
_globals['_KBSOURCE']._serialized_end=1218
|
49
|
+
_globals['_SERVICE']._serialized_start=1220
|
50
|
+
_globals['_SERVICE']._serialized_end=1273
|
51
|
+
_globals['_SEARCHTYPE']._serialized_start=1275
|
52
|
+
_globals['_SEARCHTYPE']._serialized_end=1312
|
53
|
+
_globals['_PREDICTTYPE']._serialized_start=1315
|
54
|
+
_globals['_PREDICTTYPE']._serialized_end=1475
|
55
|
+
_globals['_CLIENTTYPE']._serialized_start=1477
|
56
|
+
_globals['_CLIENTTYPE']._serialized_end=1583
|
57
|
+
_globals['_PROCESS']._serialized_start=69
|
58
|
+
_globals['_PROCESS']._serialized_end=311
|
59
|
+
_globals['_STORAGE']._serialized_start=314
|
60
|
+
_globals['_STORAGE']._serialized_end=463
|
61
|
+
_globals['_SEARCH']._serialized_start=465
|
62
|
+
_globals['_SEARCH']._serialized_end=585
|
63
|
+
_globals['_PREDICT']._serialized_start=588
|
64
|
+
_globals['_PREDICT']._serialized_end=755
|
65
|
+
_globals['_KBUSAGE']._serialized_start=758
|
66
|
+
_globals['_KBUSAGE']._serialized_end=1123
|
67
|
+
_globals['_KBUSAGEAGGREGATED']._serialized_start=1125
|
68
|
+
_globals['_KBUSAGEAGGREGATED']._serialized_end=1182
|
71
69
|
# @@protoc_insertion_point(module_scope)
|
@@ -43,10 +43,7 @@ class _KBSource:
|
|
43
43
|
ValueType = typing.NewType("ValueType", builtins.int)
|
44
44
|
V: typing_extensions.TypeAlias = ValueType
|
45
45
|
|
46
|
-
class _KBSourceEnumTypeWrapper(
|
47
|
-
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_KBSource.ValueType],
|
48
|
-
builtins.type,
|
49
|
-
):
|
46
|
+
class _KBSourceEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_KBSource.ValueType], builtins.type):
|
50
47
|
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
51
48
|
HOSTED: _KBSource.ValueType # 0
|
52
49
|
ONPREM: _KBSource.ValueType # 1
|
@@ -61,10 +58,7 @@ class _Service:
|
|
61
58
|
ValueType = typing.NewType("ValueType", builtins.int)
|
62
59
|
V: typing_extensions.TypeAlias = ValueType
|
63
60
|
|
64
|
-
class _ServiceEnumTypeWrapper(
|
65
|
-
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Service.ValueType],
|
66
|
-
builtins.type,
|
67
|
-
):
|
61
|
+
class _ServiceEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Service.ValueType], builtins.type):
|
68
62
|
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
69
63
|
PREDICT: _Service.ValueType # 0
|
70
64
|
PROCESSING: _Service.ValueType # 1
|
@@ -81,10 +75,7 @@ class _SearchType:
|
|
81
75
|
ValueType = typing.NewType("ValueType", builtins.int)
|
82
76
|
V: typing_extensions.TypeAlias = ValueType
|
83
77
|
|
84
|
-
class _SearchTypeEnumTypeWrapper(
|
85
|
-
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SearchType.ValueType],
|
86
|
-
builtins.type,
|
87
|
-
):
|
78
|
+
class _SearchTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SearchType.ValueType], builtins.type):
|
88
79
|
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
89
80
|
SEARCH: _SearchType.ValueType # 0
|
90
81
|
SUGGEST: _SearchType.ValueType # 1
|
@@ -99,10 +90,7 @@ class _PredictType:
|
|
99
90
|
ValueType = typing.NewType("ValueType", builtins.int)
|
100
91
|
V: typing_extensions.TypeAlias = ValueType
|
101
92
|
|
102
|
-
class _PredictTypeEnumTypeWrapper(
|
103
|
-
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_PredictType.ValueType],
|
104
|
-
builtins.type,
|
105
|
-
):
|
93
|
+
class _PredictTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_PredictType.ValueType], builtins.type):
|
106
94
|
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
107
95
|
SENTENCE: _PredictType.ValueType # 0
|
108
96
|
TOKEN: _PredictType.ValueType # 1
|
@@ -133,10 +121,7 @@ class _ClientType:
|
|
133
121
|
ValueType = typing.NewType("ValueType", builtins.int)
|
134
122
|
V: typing_extensions.TypeAlias = ValueType
|
135
123
|
|
136
|
-
class _ClientTypeEnumTypeWrapper(
|
137
|
-
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ClientType.ValueType],
|
138
|
-
builtins.type,
|
139
|
-
):
|
124
|
+
class _ClientTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ClientType.ValueType], builtins.type):
|
140
125
|
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
141
126
|
API: _ClientType.ValueType # 0
|
142
127
|
WEB: _ClientType.ValueType # 1
|
@@ -195,31 +180,7 @@ class Process(google.protobuf.message.Message):
|
|
195
180
|
media_files: builtins.int = ...,
|
196
181
|
num_processed: builtins.int = ...,
|
197
182
|
) -> None: ...
|
198
|
-
def ClearField(
|
199
|
-
self,
|
200
|
-
field_name: typing_extensions.Literal[
|
201
|
-
"bytes",
|
202
|
-
b"bytes",
|
203
|
-
"chars",
|
204
|
-
b"chars",
|
205
|
-
"client",
|
206
|
-
b"client",
|
207
|
-
"media_files",
|
208
|
-
b"media_files",
|
209
|
-
"media_seconds",
|
210
|
-
b"media_seconds",
|
211
|
-
"num_processed",
|
212
|
-
b"num_processed",
|
213
|
-
"pages",
|
214
|
-
b"pages",
|
215
|
-
"paragraphs",
|
216
|
-
b"paragraphs",
|
217
|
-
"pre_processing_time",
|
218
|
-
b"pre_processing_time",
|
219
|
-
"slow_processing_time",
|
220
|
-
b"slow_processing_time",
|
221
|
-
],
|
222
|
-
) -> None: ...
|
183
|
+
def ClearField(self, field_name: typing_extensions.Literal["bytes", b"bytes", "chars", b"chars", "client", b"client", "media_files", b"media_files", "media_seconds", b"media_seconds", "num_processed", b"num_processed", "pages", b"pages", "paragraphs", b"paragraphs", "pre_processing_time", b"pre_processing_time", "slow_processing_time", b"slow_processing_time"]) -> None: ...
|
223
184
|
|
224
185
|
global___Process = Process
|
225
186
|
|
@@ -230,62 +191,29 @@ class Storage(google.protobuf.message.Message):
|
|
230
191
|
PARAGRAPHS_FIELD_NUMBER: builtins.int
|
231
192
|
FIELDS_FIELD_NUMBER: builtins.int
|
232
193
|
RESOURCES_FIELD_NUMBER: builtins.int
|
194
|
+
BYTES_FIELD_NUMBER: builtins.int
|
233
195
|
paragraphs: builtins.int
|
234
196
|
fields: builtins.int
|
235
197
|
resources: builtins.int
|
198
|
+
bytes: builtins.int
|
236
199
|
def __init__(
|
237
200
|
self,
|
238
201
|
*,
|
239
202
|
paragraphs: builtins.int | None = ...,
|
240
203
|
fields: builtins.int | None = ...,
|
241
204
|
resources: builtins.int | None = ...,
|
205
|
+
bytes: builtins.int | None = ...,
|
242
206
|
) -> None: ...
|
243
|
-
def HasField(
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
b"_fields",
|
248
|
-
"_paragraphs",
|
249
|
-
b"_paragraphs",
|
250
|
-
"_resources",
|
251
|
-
b"_resources",
|
252
|
-
"fields",
|
253
|
-
b"fields",
|
254
|
-
"paragraphs",
|
255
|
-
b"paragraphs",
|
256
|
-
"resources",
|
257
|
-
b"resources",
|
258
|
-
],
|
259
|
-
) -> builtins.bool: ...
|
260
|
-
def ClearField(
|
261
|
-
self,
|
262
|
-
field_name: typing_extensions.Literal[
|
263
|
-
"_fields",
|
264
|
-
b"_fields",
|
265
|
-
"_paragraphs",
|
266
|
-
b"_paragraphs",
|
267
|
-
"_resources",
|
268
|
-
b"_resources",
|
269
|
-
"fields",
|
270
|
-
b"fields",
|
271
|
-
"paragraphs",
|
272
|
-
b"paragraphs",
|
273
|
-
"resources",
|
274
|
-
b"resources",
|
275
|
-
],
|
276
|
-
) -> None: ...
|
207
|
+
def HasField(self, field_name: typing_extensions.Literal["_bytes", b"_bytes", "_fields", b"_fields", "_paragraphs", b"_paragraphs", "_resources", b"_resources", "bytes", b"bytes", "fields", b"fields", "paragraphs", b"paragraphs", "resources", b"resources"]) -> builtins.bool: ...
|
208
|
+
def ClearField(self, field_name: typing_extensions.Literal["_bytes", b"_bytes", "_fields", b"_fields", "_paragraphs", b"_paragraphs", "_resources", b"_resources", "bytes", b"bytes", "fields", b"fields", "paragraphs", b"paragraphs", "resources", b"resources"]) -> None: ...
|
209
|
+
@typing.overload
|
210
|
+
def WhichOneof(self, oneof_group: typing_extensions.Literal["_bytes", b"_bytes"]) -> typing_extensions.Literal["bytes"] | None: ...
|
277
211
|
@typing.overload
|
278
|
-
def WhichOneof(
|
279
|
-
self, oneof_group: typing_extensions.Literal["_fields", b"_fields"]
|
280
|
-
) -> typing_extensions.Literal["fields"] | None: ...
|
212
|
+
def WhichOneof(self, oneof_group: typing_extensions.Literal["_fields", b"_fields"]) -> typing_extensions.Literal["fields"] | None: ...
|
281
213
|
@typing.overload
|
282
|
-
def WhichOneof(
|
283
|
-
self, oneof_group: typing_extensions.Literal["_paragraphs", b"_paragraphs"]
|
284
|
-
) -> typing_extensions.Literal["paragraphs"] | None: ...
|
214
|
+
def WhichOneof(self, oneof_group: typing_extensions.Literal["_paragraphs", b"_paragraphs"]) -> typing_extensions.Literal["paragraphs"] | None: ...
|
285
215
|
@typing.overload
|
286
|
-
def WhichOneof(
|
287
|
-
self, oneof_group: typing_extensions.Literal["_resources", b"_resources"]
|
288
|
-
) -> typing_extensions.Literal["resources"] | None: ...
|
216
|
+
def WhichOneof(self, oneof_group: typing_extensions.Literal["_resources", b"_resources"]) -> typing_extensions.Literal["resources"] | None: ...
|
289
217
|
|
290
218
|
global___Storage = Storage
|
291
219
|
|
@@ -309,19 +237,7 @@ class Search(google.protobuf.message.Message):
|
|
309
237
|
tokens: builtins.int = ...,
|
310
238
|
num_searches: builtins.int = ...,
|
311
239
|
) -> None: ...
|
312
|
-
def ClearField(
|
313
|
-
self,
|
314
|
-
field_name: typing_extensions.Literal[
|
315
|
-
"client",
|
316
|
-
b"client",
|
317
|
-
"num_searches",
|
318
|
-
b"num_searches",
|
319
|
-
"tokens",
|
320
|
-
b"tokens",
|
321
|
-
"type",
|
322
|
-
b"type",
|
323
|
-
],
|
324
|
-
) -> None: ...
|
240
|
+
def ClearField(self, field_name: typing_extensions.Literal["client", b"client", "num_searches", b"num_searches", "tokens", b"tokens", "type", b"type"]) -> None: ...
|
325
241
|
|
326
242
|
global___Search = Search
|
327
243
|
|
@@ -354,25 +270,7 @@ class Predict(google.protobuf.message.Message):
|
|
354
270
|
image: builtins.int = ...,
|
355
271
|
num_predicts: builtins.int = ...,
|
356
272
|
) -> None: ...
|
357
|
-
def ClearField(
|
358
|
-
self,
|
359
|
-
field_name: typing_extensions.Literal[
|
360
|
-
"client",
|
361
|
-
b"client",
|
362
|
-
"image",
|
363
|
-
b"image",
|
364
|
-
"input",
|
365
|
-
b"input",
|
366
|
-
"model",
|
367
|
-
b"model",
|
368
|
-
"num_predicts",
|
369
|
-
b"num_predicts",
|
370
|
-
"output",
|
371
|
-
b"output",
|
372
|
-
"type",
|
373
|
-
b"type",
|
374
|
-
],
|
375
|
-
) -> None: ...
|
273
|
+
def ClearField(self, field_name: typing_extensions.Literal["client", b"client", "image", b"image", "input", b"input", "model", b"model", "num_predicts", b"num_predicts", "output", b"output", "type", b"type"]) -> None: ...
|
376
274
|
|
377
275
|
global___Predict = Predict
|
378
276
|
|
@@ -397,25 +295,12 @@ class KbUsage(google.protobuf.message.Message):
|
|
397
295
|
kb_id: builtins.str
|
398
296
|
kb_source: global___KBSource.ValueType
|
399
297
|
@property
|
400
|
-
def processes(
|
401
|
-
self,
|
402
|
-
) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[
|
403
|
-
global___Process
|
404
|
-
]:
|
298
|
+
def processes(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Process]:
|
405
299
|
"""Data"""
|
406
|
-
|
407
300
|
@property
|
408
|
-
def predicts(
|
409
|
-
self,
|
410
|
-
) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[
|
411
|
-
global___Predict
|
412
|
-
]: ...
|
301
|
+
def predicts(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Predict]: ...
|
413
302
|
@property
|
414
|
-
def searches(
|
415
|
-
self,
|
416
|
-
) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[
|
417
|
-
global___Search
|
418
|
-
]: ...
|
303
|
+
def searches(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Search]: ...
|
419
304
|
@property
|
420
305
|
def storage(self) -> global___Storage: ...
|
421
306
|
def __init__(
|
@@ -431,66 +316,14 @@ class KbUsage(google.protobuf.message.Message):
|
|
431
316
|
searches: collections.abc.Iterable[global___Search] | None = ...,
|
432
317
|
storage: global___Storage | None = ...,
|
433
318
|
) -> None: ...
|
434
|
-
def HasField(
|
435
|
-
|
436
|
-
field_name: typing_extensions.Literal[
|
437
|
-
"_account_id",
|
438
|
-
b"_account_id",
|
439
|
-
"_kb_id",
|
440
|
-
b"_kb_id",
|
441
|
-
"_storage",
|
442
|
-
b"_storage",
|
443
|
-
"account_id",
|
444
|
-
b"account_id",
|
445
|
-
"kb_id",
|
446
|
-
b"kb_id",
|
447
|
-
"storage",
|
448
|
-
b"storage",
|
449
|
-
"timestamp",
|
450
|
-
b"timestamp",
|
451
|
-
],
|
452
|
-
) -> builtins.bool: ...
|
453
|
-
def ClearField(
|
454
|
-
self,
|
455
|
-
field_name: typing_extensions.Literal[
|
456
|
-
"_account_id",
|
457
|
-
b"_account_id",
|
458
|
-
"_kb_id",
|
459
|
-
b"_kb_id",
|
460
|
-
"_storage",
|
461
|
-
b"_storage",
|
462
|
-
"account_id",
|
463
|
-
b"account_id",
|
464
|
-
"kb_id",
|
465
|
-
b"kb_id",
|
466
|
-
"kb_source",
|
467
|
-
b"kb_source",
|
468
|
-
"predicts",
|
469
|
-
b"predicts",
|
470
|
-
"processes",
|
471
|
-
b"processes",
|
472
|
-
"searches",
|
473
|
-
b"searches",
|
474
|
-
"service",
|
475
|
-
b"service",
|
476
|
-
"storage",
|
477
|
-
b"storage",
|
478
|
-
"timestamp",
|
479
|
-
b"timestamp",
|
480
|
-
],
|
481
|
-
) -> None: ...
|
319
|
+
def HasField(self, field_name: typing_extensions.Literal["_account_id", b"_account_id", "_kb_id", b"_kb_id", "_storage", b"_storage", "account_id", b"account_id", "kb_id", b"kb_id", "storage", b"storage", "timestamp", b"timestamp"]) -> builtins.bool: ...
|
320
|
+
def ClearField(self, field_name: typing_extensions.Literal["_account_id", b"_account_id", "_kb_id", b"_kb_id", "_storage", b"_storage", "account_id", b"account_id", "kb_id", b"kb_id", "kb_source", b"kb_source", "predicts", b"predicts", "processes", b"processes", "searches", b"searches", "service", b"service", "storage", b"storage", "timestamp", b"timestamp"]) -> None: ...
|
482
321
|
@typing.overload
|
483
|
-
def WhichOneof(
|
484
|
-
self, oneof_group: typing_extensions.Literal["_account_id", b"_account_id"]
|
485
|
-
) -> typing_extensions.Literal["account_id"] | None: ...
|
322
|
+
def WhichOneof(self, oneof_group: typing_extensions.Literal["_account_id", b"_account_id"]) -> typing_extensions.Literal["account_id"] | None: ...
|
486
323
|
@typing.overload
|
487
|
-
def WhichOneof(
|
488
|
-
self, oneof_group: typing_extensions.Literal["_kb_id", b"_kb_id"]
|
489
|
-
) -> typing_extensions.Literal["kb_id"] | None: ...
|
324
|
+
def WhichOneof(self, oneof_group: typing_extensions.Literal["_kb_id", b"_kb_id"]) -> typing_extensions.Literal["kb_id"] | None: ...
|
490
325
|
@typing.overload
|
491
|
-
def WhichOneof(
|
492
|
-
self, oneof_group: typing_extensions.Literal["_storage", b"_storage"]
|
493
|
-
) -> typing_extensions.Literal["storage"] | None: ...
|
326
|
+
def WhichOneof(self, oneof_group: typing_extensions.Literal["_storage", b"_storage"]) -> typing_extensions.Literal["storage"] | None: ...
|
494
327
|
|
495
328
|
global___KbUsage = KbUsage
|
496
329
|
|
@@ -500,18 +333,12 @@ class KbUsageAggregated(google.protobuf.message.Message):
|
|
500
333
|
|
501
334
|
KB_USAGES_FIELD_NUMBER: builtins.int
|
502
335
|
@property
|
503
|
-
def kb_usages(
|
504
|
-
self,
|
505
|
-
) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[
|
506
|
-
global___KbUsage
|
507
|
-
]: ...
|
336
|
+
def kb_usages(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___KbUsage]: ...
|
508
337
|
def __init__(
|
509
338
|
self,
|
510
339
|
*,
|
511
340
|
kb_usages: collections.abc.Iterable[global___KbUsage] | None = ...,
|
512
341
|
) -> None: ...
|
513
|
-
def ClearField(
|
514
|
-
self, field_name: typing_extensions.Literal["kb_usages", b"kb_usages"]
|
515
|
-
) -> None: ...
|
342
|
+
def ClearField(self, field_name: typing_extensions.Literal["kb_usages", b"kb_usages"]) -> None: ...
|
516
343
|
|
517
344
|
global___KbUsageAggregated = KbUsageAggregated
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# You should have received a copy of the GNU Affero General Public License
|
18
18
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
19
|
#
|
20
|
-
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
21
20
|
# flake8: noqa
|
21
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
22
22
|
"""Client and server classes corresponding to protobuf-defined services."""
|
23
23
|
import grpc
|
@@ -110,11 +110,7 @@ class KbUsageReportUtility:
|
|
110
110
|
usage.predicts.extend(predicts)
|
111
111
|
usage.searches.extend(searches)
|
112
112
|
if storage is not None:
|
113
|
-
|
114
|
-
usage.storage.
|
115
|
-
if storage.HasField("paragraphs"):
|
116
|
-
usage.storage.paragraphs = storage.paragraphs
|
117
|
-
if storage.HasField("resources"):
|
118
|
-
usage.storage.resources = storage.resources
|
113
|
+
for field, value in storage.ListFields():
|
114
|
+
setattr(usage.storage, field.name, value)
|
119
115
|
|
120
116
|
self.send(usage)
|
{nucliadb_utils-5.0.1.post1080.dist-info → nucliadb_utils-5.0.1.post1100.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: nucliadb_utils
|
3
|
-
Version: 5.0.1.
|
3
|
+
Version: 5.0.1.post1100
|
4
4
|
Home-page: https://nuclia.com
|
5
5
|
License: BSD
|
6
6
|
Classifier: Development Status :: 4 - Beta
|
@@ -24,8 +24,8 @@ Requires-Dist: PyNaCl
|
|
24
24
|
Requires-Dist: pyjwt>=2.4.0
|
25
25
|
Requires-Dist: memorylru>=1.1.2
|
26
26
|
Requires-Dist: mrflagly>=0.2.9
|
27
|
-
Requires-Dist: nucliadb-protos>=5.0.1.
|
28
|
-
Requires-Dist: nucliadb-telemetry>=5.0.1.
|
27
|
+
Requires-Dist: nucliadb-protos>=5.0.1.post1100
|
28
|
+
Requires-Dist: nucliadb-telemetry>=5.0.1.post1100
|
29
29
|
Provides-Extra: cache
|
30
30
|
Requires-Dist: redis>=4.3.4; extra == "cache"
|
31
31
|
Requires-Dist: orjson>=3.6.7; extra == "cache"
|
@@ -18,13 +18,13 @@ nucliadb_utils/store.py,sha256=kQ35HemE0v4_Qg6xVqNIJi8vSFAYQtwI3rDtMsNy62Y,890
|
|
18
18
|
nucliadb_utils/transaction.py,sha256=mwcI3aIHAvU5KOGqd_Uz_d1XQzXhk_-NWY8NqU1lfb0,7307
|
19
19
|
nucliadb_utils/utilities.py,sha256=idajCm_4Sojh7b3HTkP0fTfG2Mb6PIB9xtMmcfB7Nl0,15758
|
20
20
|
nucliadb_utils/aiopynecone/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
21
|
-
nucliadb_utils/aiopynecone/client.py,sha256=
|
21
|
+
nucliadb_utils/aiopynecone/client.py,sha256=3DGJuHXO9Vm83atMLD4fd2FTz8SAr8RvPCGU_bXH9Ho,22333
|
22
22
|
nucliadb_utils/aiopynecone/exceptions.py,sha256=EEE0XoGs1zIB5yOJ_fy6yoG4uIb4cWIawYdJeNe4eDo,3012
|
23
23
|
nucliadb_utils/aiopynecone/models.py,sha256=ketK2IYLWiwFZ76rnJmwfcuopFJrCAtCUszdTSurm_Q,3236
|
24
24
|
nucliadb_utils/audit/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
25
|
-
nucliadb_utils/audit/audit.py,sha256=
|
26
|
-
nucliadb_utils/audit/basic.py,sha256=
|
27
|
-
nucliadb_utils/audit/stream.py,sha256=
|
25
|
+
nucliadb_utils/audit/audit.py,sha256=Tbi8poUP6BKZy4ZsaFaeTaQ1K5ys8GXym5ps389-XHE,2966
|
26
|
+
nucliadb_utils/audit/basic.py,sha256=1dIWwRWXCb_q3TZObHIMJYOllnbPxullpuqEFaWSUR8,3577
|
27
|
+
nucliadb_utils/audit/stream.py,sha256=VpwSrfPU95sqBUgMiWBX0cOC6yjuBXuh5f3uRGFJdwc,13672
|
28
28
|
nucliadb_utils/cache/__init__.py,sha256=itSI7dtTwFP55YMX4iK7JzdMHS5CQVUiB1XzQu4UBh8,833
|
29
29
|
nucliadb_utils/cache/exceptions.py,sha256=Zu-O_-0-yctOEgoDGI92gPzWfBMRrpiAyESA62ld6MA,975
|
30
30
|
nucliadb_utils/cache/nats.py,sha256=-AjCfkFgKVdJUlGR0hT9JDSNkPVFg4S6w9eW-ZIcXPM,7037
|
@@ -38,12 +38,12 @@ nucliadb_utils/fastapi/run.py,sha256=n6vOX64QqF1I5n4UlKnpm_ZJ24rmwfRGi-J9YMGpZzA
|
|
38
38
|
nucliadb_utils/fastapi/versioning.py,sha256=pwiwuesJW1jElUUI3pI5kcxkigfGBvI64IL6QCBEWS8,3805
|
39
39
|
nucliadb_utils/nuclia_usage/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
40
40
|
nucliadb_utils/nuclia_usage/protos/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
41
|
-
nucliadb_utils/nuclia_usage/protos/kb_usage_pb2.py,sha256=
|
42
|
-
nucliadb_utils/nuclia_usage/protos/kb_usage_pb2.pyi,sha256=
|
43
|
-
nucliadb_utils/nuclia_usage/protos/kb_usage_pb2_grpc.py,sha256=
|
44
|
-
nucliadb_utils/nuclia_usage/protos/kb_usage_pb2_grpc.pyi,sha256=
|
41
|
+
nucliadb_utils/nuclia_usage/protos/kb_usage_pb2.py,sha256=9pDy1QE4E6Z_q7x86_8FwHHLJYDSgmvt8LRD7NJiy88,5925
|
42
|
+
nucliadb_utils/nuclia_usage/protos/kb_usage_pb2.pyi,sha256=lA1BiWVOQWioPHPxrfzKZSrj-zyfOlO_H2IEYYdyWtU,14567
|
43
|
+
nucliadb_utils/nuclia_usage/protos/kb_usage_pb2_grpc.py,sha256=3XT17o832unN2OTBPXho5jj8mm0_8ChSr6m5Jds7SF8,1008
|
44
|
+
nucliadb_utils/nuclia_usage/protos/kb_usage_pb2_grpc.pyi,sha256=sXLWrl7G0vtMXs49h-efrwKWc6A_TU420zF9xBMv_ng,926
|
45
45
|
nucliadb_utils/nuclia_usage/utils/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
46
|
-
nucliadb_utils/nuclia_usage/utils/kb_usage_report.py,sha256=
|
46
|
+
nucliadb_utils/nuclia_usage/utils/kb_usage_report.py,sha256=lTr9CMBpdk34KtkH5K8vFxJRtF6xZpslVMNg1SD03n8,3647
|
47
47
|
nucliadb_utils/storages/__init__.py,sha256=5Qc8AUWiJv9_JbGCBpAn88AIJhwDlm0OPQpg2ZdRL4U,872
|
48
48
|
nucliadb_utils/storages/azure.py,sha256=egMDwLNIGSQyVevuySt2AswzFdNAcih05BbRg3-p8IU,16015
|
49
49
|
nucliadb_utils/storages/exceptions.py,sha256=mm_wX4YRtp7u7enkk_4pMSlX5AQQuFbq4xLmupVDt3Y,2502
|
@@ -64,8 +64,8 @@ nucliadb_utils/tests/indexing.py,sha256=YW2QhkhO9Q_8A4kKWJaWSvXvyQ_AiAwY1VylcfVQ
|
|
64
64
|
nucliadb_utils/tests/local.py,sha256=7nuP8EFUAiA8ZH50R1iPV9EUXBySQxOanVm3Zht_e0g,1835
|
65
65
|
nucliadb_utils/tests/nats.py,sha256=xqpww4jZjTKY9oPGlJdDJG67L3FIBQsa9qDHxILR8r8,7687
|
66
66
|
nucliadb_utils/tests/s3.py,sha256=IdMxK_cNdSHLvO1u8BwsKFzD87Hk1MVPDZ57zx6h-rA,3656
|
67
|
-
nucliadb_utils-5.0.1.
|
68
|
-
nucliadb_utils-5.0.1.
|
69
|
-
nucliadb_utils-5.0.1.
|
70
|
-
nucliadb_utils-5.0.1.
|
71
|
-
nucliadb_utils-5.0.1.
|
67
|
+
nucliadb_utils-5.0.1.post1100.dist-info/METADATA,sha256=n4X2-hojpwchiuLbHiT8yF4J-rCuefDxRzkOQWPdek8,2071
|
68
|
+
nucliadb_utils-5.0.1.post1100.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
69
|
+
nucliadb_utils-5.0.1.post1100.dist-info/top_level.txt,sha256=fE3vJtALTfgh7bcAWcNhcfXkNPp_eVVpbKK-2IYua3E,15
|
70
|
+
nucliadb_utils-5.0.1.post1100.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
71
|
+
nucliadb_utils-5.0.1.post1100.dist-info/RECORD,,
|
File without changes
|
{nucliadb_utils-5.0.1.post1080.dist-info → nucliadb_utils-5.0.1.post1100.dist-info}/top_level.txt
RENAMED
File without changes
|
{nucliadb_utils-5.0.1.post1080.dist-info → nucliadb_utils-5.0.1.post1100.dist-info}/zip-safe
RENAMED
File without changes
|