nucliadb-utils 5.1.2.post1427__py3-none-any.whl → 5.1.2.post1445__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.
@@ -105,3 +105,16 @@ class AuditStorage:
105
105
 
106
106
  def delete_kb(self, kbid: str):
107
107
  raise NotImplementedError
108
+
109
+ def feedback(
110
+ self,
111
+ kbid: str,
112
+ user: str,
113
+ client_type: int,
114
+ origin: str,
115
+ learning_id: str,
116
+ good: bool,
117
+ task: int,
118
+ feedback: Optional[str],
119
+ ):
120
+ raise NotImplementedError
@@ -106,3 +106,16 @@ class BasicAuditStorage(AuditStorage):
106
106
 
107
107
  def delete_kb(self, kbid: str):
108
108
  logger.debug(f"DELETE_KB {kbid}")
109
+
110
+ def feedback(
111
+ self,
112
+ kbid: str,
113
+ user: str,
114
+ client_type: int,
115
+ origin: str,
116
+ learning_id: str,
117
+ good: bool,
118
+ task: int,
119
+ feedback: Optional[str],
120
+ ):
121
+ logger.debug(f"FEEDBACK {kbid} {user} {client_type} {origin}")
@@ -410,3 +410,31 @@ class StreamAuditStorage(AuditStorage):
410
410
  if answer is not None:
411
411
  auditrequest.chat.answer = answer
412
412
  auditrequest.chat.status_code = status_code
413
+
414
+ def feedback(
415
+ self,
416
+ kbid: str,
417
+ user: str,
418
+ client_type: int,
419
+ origin: str,
420
+ learning_id: str,
421
+ good: bool,
422
+ task: int,
423
+ feedback: Optional[str],
424
+ ):
425
+ rcontext = get_request_context()
426
+ if rcontext is None:
427
+ return
428
+
429
+ auditrequest = rcontext.audit_request
430
+
431
+ auditrequest.origin = origin
432
+ auditrequest.client_type = client_type # type: ignore
433
+ auditrequest.userid = user
434
+ auditrequest.kbid = kbid
435
+
436
+ auditrequest.feedback.learning_id = learning_id
437
+ auditrequest.feedback.good = good
438
+ auditrequest.feedback.task = task # type: ignore
439
+ if feedback is not None:
440
+ auditrequest.feedback.feedback = feedback
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nucliadb_utils
3
- Version: 5.1.2.post1427
3
+ Version: 5.1.2.post1445
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.1.2.post1427
28
- Requires-Dist: nucliadb-telemetry>=5.1.2.post1427
27
+ Requires-Dist: nucliadb-protos>=5.1.2.post1445
28
+ Requires-Dist: nucliadb-telemetry>=5.1.2.post1445
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=MPyHnDXwhukJr7U3CJh7BpsekfSuOkyM4g5b
22
22
  nucliadb_utils/aiopynecone/exceptions.py,sha256=fUErx3ceKQK1MUbOnYcZhIzpNe8UVAptZE9JIRDLXDE,4000
23
23
  nucliadb_utils/aiopynecone/models.py,sha256=XkNIZx4bxdbVo9zYVn8IRp70q4DWUMWN79ybGloFj2Q,3492
24
24
  nucliadb_utils/audit/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
25
- nucliadb_utils/audit/audit.py,sha256=25Tzwmh0l8e4MvYGlmhHNt9awSb-gDAUdEjvtqFODnc,3049
26
- nucliadb_utils/audit/basic.py,sha256=_iZl7u5QB-Vl0ar5ZpmxppeFV0OdNHdcs6o0_W32eEw,3660
27
- nucliadb_utils/audit/stream.py,sha256=ww11OmqKZ8AOXVrN1sizIfEqJbEjkqldV1ts8od_6cY,13845
25
+ nucliadb_utils/audit/audit.py,sha256=-mkN8gkTc6QPvbJtKxhILtSPLS9SH0augctx5HpYWWM,3306
26
+ nucliadb_utils/audit/basic.py,sha256=BoXeJgG-TpFNcOl2Yjt-RRMOEMwmKCaHDopZiNSirWE,3954
27
+ nucliadb_utils/audit/stream.py,sha256=Mr4G06_mBYUGP0OxnCdGz0maRKqa3MnlQz5PvHl_KyQ,14617
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
@@ -59,8 +59,8 @@ nucliadb_utils/tests/indexing.py,sha256=YW2QhkhO9Q_8A4kKWJaWSvXvyQ_AiAwY1VylcfVQ
59
59
  nucliadb_utils/tests/local.py,sha256=7nuP8EFUAiA8ZH50R1iPV9EUXBySQxOanVm3Zht_e0g,1835
60
60
  nucliadb_utils/tests/nats.py,sha256=xqpww4jZjTKY9oPGlJdDJG67L3FIBQsa9qDHxILR8r8,7687
61
61
  nucliadb_utils/tests/s3.py,sha256=IdMxK_cNdSHLvO1u8BwsKFzD87Hk1MVPDZ57zx6h-rA,3656
62
- nucliadb_utils-5.1.2.post1427.dist-info/METADATA,sha256=CRgr6u1fkOUXX0-JCBYGkJqcrXDFQH4H4_DuB-TMHxA,2071
63
- nucliadb_utils-5.1.2.post1427.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
64
- nucliadb_utils-5.1.2.post1427.dist-info/top_level.txt,sha256=fE3vJtALTfgh7bcAWcNhcfXkNPp_eVVpbKK-2IYua3E,15
65
- nucliadb_utils-5.1.2.post1427.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
66
- nucliadb_utils-5.1.2.post1427.dist-info/RECORD,,
62
+ nucliadb_utils-5.1.2.post1445.dist-info/METADATA,sha256=SSFeJEfdB2ZL1ZxAevoHZu858ck5ABM3C9mJ_-Nuc74,2071
63
+ nucliadb_utils-5.1.2.post1445.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
64
+ nucliadb_utils-5.1.2.post1445.dist-info/top_level.txt,sha256=fE3vJtALTfgh7bcAWcNhcfXkNPp_eVVpbKK-2IYua3E,15
65
+ nucliadb_utils-5.1.2.post1445.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
66
+ nucliadb_utils-5.1.2.post1445.dist-info/RECORD,,