nucliadb 6.8.1.post5003__py3-none-any.whl → 6.8.1.post5005__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 might be problematic. Click here for more details.

@@ -25,6 +25,7 @@ from typing import AsyncGenerator, Optional, Union, cast
25
25
  from nuclia_models.common.consumption import Consumption
26
26
  from nuclia_models.predict.generative_responses import (
27
27
  CitationsGenerativeResponse,
28
+ FootnoteCitationsGenerativeResponse,
28
29
  GenerativeChunk,
29
30
  JSONGenerativeResponse,
30
31
  MetaGenerativeResponse,
@@ -91,6 +92,7 @@ from nucliadb_models.search import (
91
92
  FindOptions,
92
93
  FindParagraph,
93
94
  FindRequest,
95
+ FootnoteCitationsAskResponseItem,
94
96
  GraphStrategy,
95
97
  JSONAskResponseItem,
96
98
  KnowledgeboxFindResults,
@@ -173,6 +175,7 @@ class AskResult:
173
175
  self._object: Optional[JSONGenerativeResponse] = None
174
176
  self._status: Optional[StatusGenerativeResponse] = None
175
177
  self._citations: Optional[CitationsGenerativeResponse] = None
178
+ self._footnote_citations: Optional[FootnoteCitationsGenerativeResponse] = None
176
179
  self._metadata: Optional[MetaGenerativeResponse] = None
177
180
  self._relations: Optional[Relations] = None
178
181
  self._consumption: Optional[Consumption] = None
@@ -303,6 +306,11 @@ class AskResult:
303
306
  yield CitationsAskResponseItem(
304
307
  citations=self._citations.citations,
305
308
  )
309
+ # Stream out the footnote citations mapping
310
+ if self._footnote_citations is not None:
311
+ yield FootnoteCitationsAskResponseItem(
312
+ footnote_to_context=self._footnote_citations.footnote_to_context,
313
+ )
306
314
 
307
315
  # Stream out generic metadata about the answer
308
316
  if self._metadata is not None:
@@ -380,6 +388,10 @@ class AskResult:
380
388
  if self._citations is not None:
381
389
  citations = self._citations.citations
382
390
 
391
+ footnote_citations = {}
392
+ if self._footnote_citations is not None:
393
+ footnote_citations = self._footnote_citations.footnote_to_context
394
+
383
395
  answer_json = None
384
396
  if self._object is not None:
385
397
  answer_json = self._object.object
@@ -408,6 +420,7 @@ class AskResult:
408
420
  retrieval_best_matches=best_matches,
409
421
  prequeries=prequeries_results,
410
422
  citations=citations,
423
+ citation_footnote_to_context=footnote_citations,
411
424
  metadata=metadata,
412
425
  consumption=self._consumption,
413
426
  learning_id=self.nuclia_learning_id or "",
@@ -467,6 +480,8 @@ class AskResult:
467
480
  self._status = item
468
481
  elif isinstance(item, CitationsGenerativeResponse):
469
482
  self._citations = item
483
+ elif isinstance(item, FootnoteCitationsGenerativeResponse):
484
+ self._footnote_citations = item
470
485
  elif isinstance(item, MetaGenerativeResponse):
471
486
  self._metadata = item
472
487
  elif isinstance(item, Consumption):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nucliadb
3
- Version: 6.8.1.post5003
3
+ Version: 6.8.1.post5005
4
4
  Summary: NucliaDB
5
5
  Author-email: Nuclia <nucliadb@nuclia.com>
6
6
  License-Expression: AGPL-3.0-or-later
@@ -19,13 +19,13 @@ Classifier: Programming Language :: Python :: 3.12
19
19
  Classifier: Programming Language :: Python :: 3 :: Only
20
20
  Requires-Python: <4,>=3.9
21
21
  Description-Content-Type: text/markdown
22
- Requires-Dist: nucliadb-telemetry[all]>=6.8.1.post5003
23
- Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.8.1.post5003
24
- Requires-Dist: nucliadb-protos>=6.8.1.post5003
25
- Requires-Dist: nucliadb-models>=6.8.1.post5003
26
- Requires-Dist: nidx-protos>=6.8.1.post5003
22
+ Requires-Dist: nucliadb-telemetry[all]>=6.8.1.post5005
23
+ Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.8.1.post5005
24
+ Requires-Dist: nucliadb-protos>=6.8.1.post5005
25
+ Requires-Dist: nucliadb-models>=6.8.1.post5005
26
+ Requires-Dist: nidx-protos>=6.8.1.post5005
27
27
  Requires-Dist: nucliadb-admin-assets>=1.0.0.post1224
28
- Requires-Dist: nuclia-models>=0.47.0
28
+ Requires-Dist: nuclia-models>=0.50.0
29
29
  Requires-Dist: uvicorn[standard]
30
30
  Requires-Dist: argdantic
31
31
  Requires-Dist: aiohttp>=3.11.11
@@ -267,7 +267,7 @@ nucliadb/search/search/shards.py,sha256=mc5DK-MoCv9AFhlXlOFHbPvetcyNDzTFOJ5rimK8
267
267
  nucliadb/search/search/summarize.py,sha256=3lLdwsM28W505bKvmK7JLXmz7kcjd8Hp70LQs391ofY,5087
268
268
  nucliadb/search/search/utils.py,sha256=ajRIXfdTF67dBVahQCXW-rSv6gJpUMPt3QhJrWqArTQ,2175
269
269
  nucliadb/search/search/chat/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
270
- nucliadb/search/search/chat/ask.py,sha256=Akq5nCl-0P9Hcil2hzuOEIlhEA9IxJtlQo4dz54BG3s,40884
270
+ nucliadb/search/search/chat/ask.py,sha256=A-XKXXMt9i2sw1thuztAVLG2hgP8eJwd3KXEBfA1CQI,41640
271
271
  nucliadb/search/search/chat/exceptions.py,sha256=Siy4GXW2L7oPhIR86H3WHBhE9lkV4A4YaAszuGGUf54,1356
272
272
  nucliadb/search/search/chat/images.py,sha256=PA8VWxT5_HUGfW1ULhKTK46UBsVyINtWWqEM1ulzX1E,3095
273
273
  nucliadb/search/search/chat/prompt.py,sha256=Bk69WVki5XIzXFYO6o1uQw1feHtuMwfEx_A1TT3piR0,54136
@@ -384,8 +384,8 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
384
384
  nucliadb/writer/tus/s3.py,sha256=vu1BGg4VqJ_x2P1u2BxqPKlSfw5orT_a3R-Ln5oPUpU,8483
385
385
  nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
386
386
  nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
387
- nucliadb-6.8.1.post5003.dist-info/METADATA,sha256=MMNHSJZnrs5r025lBiBPmfA9tVdqp0bmiatio-nGEpY,4158
388
- nucliadb-6.8.1.post5003.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
389
- nucliadb-6.8.1.post5003.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
390
- nucliadb-6.8.1.post5003.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
391
- nucliadb-6.8.1.post5003.dist-info/RECORD,,
387
+ nucliadb-6.8.1.post5005.dist-info/METADATA,sha256=fpf1lfmxPlWps30utgc-SIfOVnxaU70tLyvm1Iclxw8,4158
388
+ nucliadb-6.8.1.post5005.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
389
+ nucliadb-6.8.1.post5005.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
390
+ nucliadb-6.8.1.post5005.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
391
+ nucliadb-6.8.1.post5005.dist-info/RECORD,,