nucliadb 6.1.0.post2501__py3-none-any.whl → 6.1.0.post2507__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/common/cluster/manager.py +7 -0
- nucliadb/search/search/chat/images.py +14 -7
- nucliadb/search/search/chat/prompt.py +5 -9
- {nucliadb-6.1.0.post2501.dist-info → nucliadb-6.1.0.post2507.dist-info}/METADATA +5 -5
- {nucliadb-6.1.0.post2501.dist-info → nucliadb-6.1.0.post2507.dist-info}/RECORD +9 -9
- {nucliadb-6.1.0.post2501.dist-info → nucliadb-6.1.0.post2507.dist-info}/WHEEL +0 -0
- {nucliadb-6.1.0.post2501.dist-info → nucliadb-6.1.0.post2507.dist-info}/entry_points.txt +0 -0
- {nucliadb-6.1.0.post2501.dist-info → nucliadb-6.1.0.post2507.dist-info}/top_level.txt +0 -0
- {nucliadb-6.1.0.post2501.dist-info → nucliadb-6.1.0.post2507.dist-info}/zip-safe +0 -0
@@ -579,6 +579,13 @@ class StandaloneKBShardManager(KBShardManager):
|
|
579
579
|
|
580
580
|
await nidx.index(indexpb)
|
581
581
|
|
582
|
+
# Delete indexing message (no longer needed)
|
583
|
+
try:
|
584
|
+
if storage.indexing_bucket:
|
585
|
+
await storage.delete_upload(storage_key, storage.indexing_bucket)
|
586
|
+
except Exception:
|
587
|
+
pass
|
588
|
+
|
582
589
|
|
583
590
|
def get_all_shard_nodes(
|
584
591
|
shard: writer_pb2.ShardObject,
|
@@ -18,11 +18,14 @@
|
|
18
18
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
19
|
|
20
20
|
import base64
|
21
|
+
from io import BytesIO
|
21
22
|
from typing import Optional
|
22
23
|
|
23
24
|
from nucliadb.common.ids import ParagraphId
|
25
|
+
from nucliadb.ingest.fields.file import File
|
24
26
|
from nucliadb.search import SERVICE_NAME
|
25
27
|
from nucliadb_models.search import Image
|
28
|
+
from nucliadb_utils.storages.storage import Storage
|
26
29
|
from nucliadb_utils.utilities import get_storage
|
27
30
|
|
28
31
|
|
@@ -64,14 +67,18 @@ async def get_paragraph_image(kbid: str, paragraph_id: ParagraphId, reference: s
|
|
64
67
|
return image
|
65
68
|
|
66
69
|
|
67
|
-
async def
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
70
|
+
async def get_file_thumbnail_image(file: File) -> Optional[Image]:
|
71
|
+
fed = await file.get_file_extracted_data()
|
72
|
+
if fed is None or not fed.HasField("file_thumbnail"):
|
73
|
+
return None
|
74
|
+
storage: Storage = await get_storage(service_name=SERVICE_NAME)
|
75
|
+
image_bytes: BytesIO = await storage.downloadbytescf(fed.file_thumbnail)
|
76
|
+
value = image_bytes.getvalue()
|
77
|
+
if len(value) == 0:
|
72
78
|
return None
|
73
79
|
image = Image(
|
74
|
-
b64encoded=base64.b64encode(
|
75
|
-
|
80
|
+
b64encoded=base64.b64encode(value).decode(),
|
81
|
+
# We assume the thumbnail is always generated as jpeg by Nuclia processing
|
82
|
+
content_type="image/jpeg",
|
76
83
|
)
|
77
84
|
return image
|
@@ -35,7 +35,7 @@ from nucliadb.ingest.orm.knowledgebox import KnowledgeBox as KnowledgeBoxORM
|
|
35
35
|
from nucliadb.search import logger
|
36
36
|
from nucliadb.search.search import cache
|
37
37
|
from nucliadb.search.search.chat.images import (
|
38
|
-
|
38
|
+
get_file_thumbnail_image,
|
39
39
|
get_page_image,
|
40
40
|
get_paragraph_image,
|
41
41
|
)
|
@@ -753,14 +753,10 @@ async def conversation_prompt_context(
|
|
753
753
|
file_field: File = await resource.get_field(
|
754
754
|
attachment.field_id, attachment.field_type, load=True
|
755
755
|
) # type: ignore
|
756
|
-
|
757
|
-
if
|
758
|
-
"
|
759
|
-
|
760
|
-
image = await get_file_image(kbid, rid, attachment.field_id)
|
761
|
-
if image is not None:
|
762
|
-
pid = f"{rid}/f/{attachment.field_id}/0-0"
|
763
|
-
context.images[pid] = image
|
756
|
+
image = await get_file_thumbnail_image(file_field)
|
757
|
+
if image is not None:
|
758
|
+
pid = f"{rid}/f/{attachment.field_id}/0-0"
|
759
|
+
context.images[pid] = image
|
764
760
|
|
765
761
|
analyzed_fields.append(field_unique_id)
|
766
762
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: nucliadb
|
3
|
-
Version: 6.1.0.
|
3
|
+
Version: 6.1.0.post2507
|
4
4
|
Home-page: https://docs.nuclia.dev/docs/management/nucliadb/intro
|
5
5
|
Author: NucliaDB Community
|
6
6
|
Author-email: nucliadb@nuclia.com
|
@@ -22,10 +22,10 @@ Classifier: Programming Language :: Python :: 3.12
|
|
22
22
|
Classifier: Programming Language :: Python :: 3 :: Only
|
23
23
|
Requires-Python: >=3.9, <4
|
24
24
|
Description-Content-Type: text/markdown
|
25
|
-
Requires-Dist: nucliadb-telemetry[all]>=6.1.0.
|
26
|
-
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.1.0.
|
27
|
-
Requires-Dist: nucliadb-protos>=6.1.0.
|
28
|
-
Requires-Dist: nucliadb-models>=6.1.0.
|
25
|
+
Requires-Dist: nucliadb-telemetry[all]>=6.1.0.post2507
|
26
|
+
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.1.0.post2507
|
27
|
+
Requires-Dist: nucliadb-protos>=6.1.0.post2507
|
28
|
+
Requires-Dist: nucliadb-models>=6.1.0.post2507
|
29
29
|
Requires-Dist: nucliadb-admin-assets>=1.0.0.post1224
|
30
30
|
Requires-Dist: nucliadb-node-binding>=2.26.0
|
31
31
|
Requires-Dist: uvicorn
|
@@ -45,7 +45,7 @@ nucliadb/common/cluster/base.py,sha256=kklDqyvsubNX0W494ttl9f3E58lGaX6AXqAd8XX8Z
|
|
45
45
|
nucliadb/common/cluster/exceptions.py,sha256=V3c_fgH00GyJ-a5CaGLhwTuhwhUNR9YAGvS5jaRuc_Y,1495
|
46
46
|
nucliadb/common/cluster/grpc_node_dummy.py,sha256=L85wBnfab7Rev0CfsfUjPxQC6DiHPsETKrZAOLx9XHg,3510
|
47
47
|
nucliadb/common/cluster/index_node.py,sha256=g38H1kiAliF3Y6et_CWYInpn_xPxf7THAFJ7RtgLNZo,3246
|
48
|
-
nucliadb/common/cluster/manager.py,sha256=
|
48
|
+
nucliadb/common/cluster/manager.py,sha256=cKC7ZZdI-abD9Ha5wIRlLxm4cVaF2xeZ0exMaY0s75c,27365
|
49
49
|
nucliadb/common/cluster/rebalance.py,sha256=ZlMuGRYfWQeGAAH6vbt8R9Yg80sJ_epVNPRj2cCEaM4,9167
|
50
50
|
nucliadb/common/cluster/rollover.py,sha256=Z_KILOi0uC_qEQ7Nc-9u2veoYkonL7nqQZmIB9gtG_w,28458
|
51
51
|
nucliadb/common/cluster/settings.py,sha256=RqIMJNyNcn5aV5PifUflkn4zDVX-Ruo36PXGP1CV1mc,3263
|
@@ -229,8 +229,8 @@ nucliadb/search/search/utils.py,sha256=iF2tbBA56gRMJH1TlE2hMrqeXqjoeOPt4KgRdp2m9
|
|
229
229
|
nucliadb/search/search/chat/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
230
230
|
nucliadb/search/search/chat/ask.py,sha256=2ZIz3TbCG18X0eJZSfLc8nHyKToyrlv_SPFzOOcc5wU,33865
|
231
231
|
nucliadb/search/search/chat/exceptions.py,sha256=Siy4GXW2L7oPhIR86H3WHBhE9lkV4A4YaAszuGGUf54,1356
|
232
|
-
nucliadb/search/search/chat/images.py,sha256=
|
233
|
-
nucliadb/search/search/chat/prompt.py,sha256=
|
232
|
+
nucliadb/search/search/chat/images.py,sha256=PA8VWxT5_HUGfW1ULhKTK46UBsVyINtWWqEM1ulzX1E,3095
|
233
|
+
nucliadb/search/search/chat/prompt.py,sha256=mreHIjhIWCIGDlJ2CA7kv7KLgh8d09meoMX3-bvWje8,46152
|
234
234
|
nucliadb/search/search/chat/query.py,sha256=gKtlj2ms81m417Id29-DtHFxE3M4TtJvYNB03gAgpYo,14402
|
235
235
|
nucliadb/search/search/query_parser/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
236
236
|
nucliadb/search/search/query_parser/exceptions.py,sha256=tuzl7ZyvVsRz6u0_3zMe60vx39nd3pi641prs-5nC0E,872
|
@@ -331,9 +331,9 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
|
|
331
331
|
nucliadb/writer/tus/s3.py,sha256=vF0NkFTXiXhXq3bCVXXVV-ED38ECVoUeeYViP8uMqcU,8357
|
332
332
|
nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
|
333
333
|
nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
|
334
|
-
nucliadb-6.1.0.
|
335
|
-
nucliadb-6.1.0.
|
336
|
-
nucliadb-6.1.0.
|
337
|
-
nucliadb-6.1.0.
|
338
|
-
nucliadb-6.1.0.
|
339
|
-
nucliadb-6.1.0.
|
334
|
+
nucliadb-6.1.0.post2507.dist-info/METADATA,sha256=gKMwO_dELa98uXILkFVpuVeT4F-lVyO0FZ_yg47Qja8,4390
|
335
|
+
nucliadb-6.1.0.post2507.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
336
|
+
nucliadb-6.1.0.post2507.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
|
337
|
+
nucliadb-6.1.0.post2507.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
|
338
|
+
nucliadb-6.1.0.post2507.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
339
|
+
nucliadb-6.1.0.post2507.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|