nucliadb-utils 6.2.1.post2716__py3-none-any.whl → 6.2.1.post2730__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.

Potentially problematic release.


This version of nucliadb-utils might be problematic. Click here for more details.

@@ -58,6 +58,7 @@ class RequestContext:
58
58
  def __init__(self):
59
59
  self.audit_request: AuditRequest = AuditRequest()
60
60
  self.start_time: float = time.monotonic()
61
+ self.path: str = ""
61
62
 
62
63
 
63
64
  request_context_var = contextvars.ContextVar[Optional[RequestContext]]("request_context", default=None)
@@ -88,6 +89,7 @@ class AuditMiddleware(BaseHTTPMiddleware):
88
89
  token = request_context_var.set(context)
89
90
  context.audit_request.time.FromDatetime(datetime.now(tz=timezone.utc))
90
91
  context.audit_request.trace_id = get_trace_id()
92
+ context.path = request.url.path
91
93
 
92
94
  if request.url.path.split("/")[-1] in ("ask", "search", "find"):
93
95
  if request.method == "POST":
@@ -341,7 +343,10 @@ class StreamAuditStorage(AuditStorage):
341
343
  auditrequest.search.CopyFrom(search)
342
344
  auditrequest.retrieval_time = timeit
343
345
  auditrequest.resources = resources
344
- auditrequest.type = AuditRequest.SEARCH
346
+ if "/ask" in context.path:
347
+ auditrequest.type = AuditRequest.CHAT
348
+ else:
349
+ auditrequest.type = AuditRequest.SEARCH
345
350
 
346
351
  self.kb_usage_utility.send_kb_usage(
347
352
  service=Service.NUCLIA_DB,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nucliadb_utils
3
- Version: 6.2.1.post2716
3
+ Version: 6.2.1.post2730
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>=6.2.1.post2716
28
- Requires-Dist: nucliadb-telemetry>=6.2.1.post2716
27
+ Requires-Dist: nucliadb-protos>=6.2.1.post2730
28
+ Requires-Dist: nucliadb-telemetry>=6.2.1.post2730
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"
@@ -24,7 +24,7 @@ nucliadb_utils/aiopynecone/models.py,sha256=XkNIZx4bxdbVo9zYVn8IRp70q4DWUMWN79yb
24
24
  nucliadb_utils/audit/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
25
25
  nucliadb_utils/audit/audit.py,sha256=2kRG4MLyvuxwaZl1uFkRNfItHNE5r9BNxxoNKWt1pFU,3364
26
26
  nucliadb_utils/audit/basic.py,sha256=p9DB9wYaKJuzHjNkXTMcbdoIDQRVTFjbLmx7fwoRQFI,4012
27
- nucliadb_utils/audit/stream.py,sha256=MlDKPYkTE6zieEqSA7Pmf17SYrvbkD5TAcsewZBv79k,14968
27
+ nucliadb_utils/audit/stream.py,sha256=p1CBs-35G5VCCABmv9n3z9K4Je30cEEbdBvSv_NG-lI,15139
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=fXIBasrvdaFJM-sw2wk1_oiFzBcm9O10iCyC-OiXwY8,1914
60
60
  nucliadb_utils/tests/nats.py,sha256=nykEfwxPc3F3aO8n7g_V7IY3RQBXU3_R_ukwBKxYXa8,7893
61
61
  nucliadb_utils/tests/s3.py,sha256=pl-RJFjA4MH6iXkqhsh5g8gDuEhrYu1nPZ-laxlrMlE,3704
62
- nucliadb_utils-6.2.1.post2716.dist-info/METADATA,sha256=pPpkXMVwOGk63XzFzShhQfQvSpMibwDXZ0eRQH3y5Dk,2055
63
- nucliadb_utils-6.2.1.post2716.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
64
- nucliadb_utils-6.2.1.post2716.dist-info/top_level.txt,sha256=fE3vJtALTfgh7bcAWcNhcfXkNPp_eVVpbKK-2IYua3E,15
65
- nucliadb_utils-6.2.1.post2716.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
66
- nucliadb_utils-6.2.1.post2716.dist-info/RECORD,,
62
+ nucliadb_utils-6.2.1.post2730.dist-info/METADATA,sha256=sH6wMOfVCLzPOiwo1obSIgqVU1CS0cz21MBgPJnxyDo,2055
63
+ nucliadb_utils-6.2.1.post2730.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
64
+ nucliadb_utils-6.2.1.post2730.dist-info/top_level.txt,sha256=fE3vJtALTfgh7bcAWcNhcfXkNPp_eVVpbKK-2IYua3E,15
65
+ nucliadb_utils-6.2.1.post2730.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
66
+ nucliadb_utils-6.2.1.post2730.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (75.7.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5