nucliadb-utils 5.0.1.post1075__py3-none-any.whl → 5.0.1.post1091__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.
@@ -94,7 +94,7 @@ class AuditStorage:
94
94
  ):
95
95
  raise NotImplementedError
96
96
 
97
- def report_fields_and_paragraphs(self, kbid: str, paragraphs: int, fields: int):
97
+ def report_storage(self, kbid: str, paragraphs: int, fields: int, bytes: int):
98
98
  raise NotImplementedError
99
99
 
100
100
  def report_resources(
@@ -95,7 +95,7 @@ class BasicAuditStorage(AuditStorage):
95
95
  ):
96
96
  logger.debug(f"CHAT {kbid} {user} {origin}")
97
97
 
98
- def report_fields_and_paragraphs(self, kbid: str, paragraphs: int, fields: int):
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(
@@ -280,13 +280,13 @@ class StreamAuditStorage(AuditStorage):
280
280
 
281
281
  self.send(auditrequest)
282
282
 
283
- def report_fields_and_paragraphs(self, kbid: str, paragraphs: int, fields: int):
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
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
39
- 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"w\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\x42\r\n\x0b_paragraphsB\t\n\x07_fieldsB\x0c\n\n_resources"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'
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, "protos.kb_usage_pb2", _globals)
42
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'protos.kb_usage_pb2', _globals)
45
43
  if _descriptor._USE_C_DESCRIPTORS == False:
46
- DESCRIPTOR._options = None
47
- _globals["_PROCESS"].fields_by_name["media_files"]._options = None
48
- _globals["_PROCESS"].fields_by_name["media_files"]._serialized_options = b"\030\001"
49
- _globals["_KBSOURCE"]._serialized_start = 1153
50
- _globals["_KBSOURCE"]._serialized_end = 1187
51
- _globals["_SERVICE"]._serialized_start = 1189
52
- _globals["_SERVICE"]._serialized_end = 1242
53
- _globals["_SEARCHTYPE"]._serialized_start = 1244
54
- _globals["_SEARCHTYPE"]._serialized_end = 1281
55
- _globals["_PREDICTTYPE"]._serialized_start = 1284
56
- _globals["_PREDICTTYPE"]._serialized_end = 1444
57
- _globals["_CLIENTTYPE"]._serialized_start = 1446
58
- _globals["_CLIENTTYPE"]._serialized_end = 1552
59
- _globals["_PROCESS"]._serialized_start = 69
60
- _globals["_PROCESS"]._serialized_end = 311
61
- _globals["_STORAGE"]._serialized_start = 313
62
- _globals["_STORAGE"]._serialized_end = 432
63
- _globals["_SEARCH"]._serialized_start = 434
64
- _globals["_SEARCH"]._serialized_end = 554
65
- _globals["_PREDICT"]._serialized_start = 557
66
- _globals["_PREDICT"]._serialized_end = 724
67
- _globals["_KBUSAGE"]._serialized_start = 727
68
- _globals["_KBUSAGE"]._serialized_end = 1092
69
- _globals["_KBUSAGEAGGREGATED"]._serialized_start = 1094
70
- _globals["_KBUSAGEAGGREGATED"]._serialized_end = 1151
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
- self,
245
- field_name: typing_extensions.Literal[
246
- "_fields",
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
- self,
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
@@ -17,6 +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
+ # flake8: noqa
20
21
  """
21
22
  @generated by mypy-protobuf. Do not edit manually!
22
23
  isort:skip_file
@@ -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
- if storage.HasField("fields"):
114
- usage.storage.fields = storage.fields
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nucliadb_utils
3
- Version: 5.0.1.post1075
3
+ Version: 5.0.1.post1091
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.post1075
28
- Requires-Dist: nucliadb-telemetry>=5.0.1.post1075
27
+ Requires-Dist: nucliadb-protos>=5.0.1.post1091
28
+ Requires-Dist: nucliadb-telemetry>=5.0.1.post1091
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"
@@ -22,9 +22,9 @@ nucliadb_utils/aiopynecone/client.py,sha256=EFAQbNp-OHZ55vyXWzdzzp_59FGacGs_nfM2
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=2OyAQ3sUfFfVqBgaA3xiAby3eSIwpey2wg7Ctf0wDxc,2968
26
- nucliadb_utils/audit/basic.py,sha256=NC3bEuEKS1EV2v7HuH0zt8YobK_xdpM45L9SBsR-GFU,3579
27
- nucliadb_utils/audit/stream.py,sha256=Zysj70rwxCziJtptDCc4fHoACHyC5FVjkG47NaKx214,13661
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=7jBWh5aFkNOU6rF_rdp-twZONgrJe3ztJdqKvRWcMM4,5934
42
- nucliadb_utils/nuclia_usage/protos/kb_usage_pb2.pyi,sha256=xhyc3jJBh0KZuWcgmIbwSkWYfoUKHDC8Fqa7GBjwkmE,15983
43
- nucliadb_utils/nuclia_usage/protos/kb_usage_pb2_grpc.py,sha256=dhop8WwjplPfORYPYb9HtcS9gHMzqXPJQGqXYRjV-6M,1008
44
- nucliadb_utils/nuclia_usage/protos/kb_usage_pb2_grpc.pyi,sha256=6RIsZ2934iodEckflpBStgLKEkFhKfNmZ72UKg2Bwb4,911
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=P1fKvrcYdSPNJ1ycd0ArSXOqhUcvz1BaQhxAWHo0kcc,3847
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.post1075.dist-info/METADATA,sha256=5p7gO6sOPQ7sB8B_KiftcxYaq36LbZux-OgdslnKF8Q,2071
68
- nucliadb_utils-5.0.1.post1075.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
69
- nucliadb_utils-5.0.1.post1075.dist-info/top_level.txt,sha256=fE3vJtALTfgh7bcAWcNhcfXkNPp_eVVpbKK-2IYua3E,15
70
- nucliadb_utils-5.0.1.post1075.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
71
- nucliadb_utils-5.0.1.post1075.dist-info/RECORD,,
67
+ nucliadb_utils-5.0.1.post1091.dist-info/METADATA,sha256=36ObBdcAROkELutBroI5F89yEBH8CxZ5B2Gj90RA9_c,2071
68
+ nucliadb_utils-5.0.1.post1091.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
69
+ nucliadb_utils-5.0.1.post1091.dist-info/top_level.txt,sha256=fE3vJtALTfgh7bcAWcNhcfXkNPp_eVVpbKK-2IYua3E,15
70
+ nucliadb_utils-5.0.1.post1091.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
71
+ nucliadb_utils-5.0.1.post1091.dist-info/RECORD,,