nucliadb 6.2.1.post3223__py3-none-any.whl → 6.2.1.post3239__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/ingest/orm/resource.py +7 -0
- nucliadb/search/search/chat/ask.py +1 -0
- nucliadb/search/search/chat/prompt.py +5 -0
- {nucliadb-6.2.1.post3223.dist-info → nucliadb-6.2.1.post3239.dist-info}/METADATA +5 -5
- {nucliadb-6.2.1.post3223.dist-info → nucliadb-6.2.1.post3239.dist-info}/RECORD +9 -9
- {nucliadb-6.2.1.post3223.dist-info → nucliadb-6.2.1.post3239.dist-info}/WHEEL +0 -0
- {nucliadb-6.2.1.post3223.dist-info → nucliadb-6.2.1.post3239.dist-info}/entry_points.txt +0 -0
- {nucliadb-6.2.1.post3223.dist-info → nucliadb-6.2.1.post3239.dist-info}/top_level.txt +0 -0
- {nucliadb-6.2.1.post3223.dist-info → nucliadb-6.2.1.post3239.dist-info}/zip-safe +0 -0
nucliadb/ingest/orm/resource.py
CHANGED
@@ -620,6 +620,9 @@ class Resource:
|
|
620
620
|
for question_answers in message.question_answers:
|
621
621
|
await self._apply_question_answers(question_answers)
|
622
622
|
|
623
|
+
for field_id in message.delete_question_answers:
|
624
|
+
await self._delete_question_answers(field_id)
|
625
|
+
|
623
626
|
for extracted_text in message.extracted_text:
|
624
627
|
await self._apply_extracted_text(extracted_text)
|
625
628
|
|
@@ -687,6 +690,10 @@ class Resource:
|
|
687
690
|
field_obj = await self.get_field(field.field, field.field_type, load=False)
|
688
691
|
await field_obj.set_question_answers(question_answers)
|
689
692
|
|
693
|
+
async def _delete_question_answers(self, field_id: FieldID):
|
694
|
+
field_obj = await self.get_field(field_id.field, field_id.field_type, load=False)
|
695
|
+
await field_obj.delete_question_answers()
|
696
|
+
|
690
697
|
async def _apply_link_extracted_data(self, link_extracted_data: LinkExtractedData):
|
691
698
|
assert self.basic is not None
|
692
699
|
field_link: Link = await self.get_field(
|
@@ -534,6 +534,7 @@ async def ask(
|
|
534
534
|
ordered_paragraphs=[match.paragraph for match in retrieval_results.best_matches],
|
535
535
|
resource=resource,
|
536
536
|
user_context=user_context,
|
537
|
+
user_image_context=ask_request.extra_context_images,
|
537
538
|
strategies=ask_request.rag_strategies,
|
538
539
|
image_strategies=ask_request.rag_images_strategies,
|
539
540
|
max_context_characters=tokens_to_chars(max_tokens_context),
|
@@ -51,6 +51,7 @@ from nucliadb_models.search import (
|
|
51
51
|
FindParagraph,
|
52
52
|
FullResourceStrategy,
|
53
53
|
HierarchyResourceStrategy,
|
54
|
+
Image,
|
54
55
|
ImageRagStrategy,
|
55
56
|
ImageRagStrategyName,
|
56
57
|
MetadataExtensionStrategy,
|
@@ -880,6 +881,7 @@ class PromptContextBuilder:
|
|
880
881
|
ordered_paragraphs: list[FindParagraph],
|
881
882
|
resource: Optional[str] = None,
|
882
883
|
user_context: Optional[list[str]] = None,
|
884
|
+
user_image_context: Optional[list[Image]] = None,
|
883
885
|
strategies: Optional[Sequence[RagStrategy]] = None,
|
884
886
|
image_strategies: Optional[Sequence[ImageRagStrategy]] = None,
|
885
887
|
max_context_characters: Optional[int] = None,
|
@@ -889,6 +891,7 @@ class PromptContextBuilder:
|
|
889
891
|
self.ordered_paragraphs = ordered_paragraphs
|
890
892
|
self.resource = resource
|
891
893
|
self.user_context = user_context
|
894
|
+
self.user_image_context = user_image_context
|
892
895
|
self.strategies = strategies
|
893
896
|
self.image_strategies = image_strategies
|
894
897
|
self.max_context_characters = max_context_characters
|
@@ -899,6 +902,8 @@ class PromptContextBuilder:
|
|
899
902
|
# it is added first, followed by the found text blocks in order of relevance
|
900
903
|
for i, text_block in enumerate(self.user_context or []):
|
901
904
|
context[f"USER_CONTEXT_{i}"] = text_block
|
905
|
+
for i, image in enumerate(self.user_image_context or []):
|
906
|
+
context.images[f"USER_IMAGE_CONTEXT_{i}"] = image
|
902
907
|
|
903
908
|
async def build(
|
904
909
|
self,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: nucliadb
|
3
|
-
Version: 6.2.1.
|
3
|
+
Version: 6.2.1.post3239
|
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.2.1.
|
26
|
-
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.2.1.
|
27
|
-
Requires-Dist: nucliadb-protos>=6.2.1.
|
28
|
-
Requires-Dist: nucliadb-models>=6.2.1.
|
25
|
+
Requires-Dist: nucliadb-telemetry[all]>=6.2.1.post3239
|
26
|
+
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.2.1.post3239
|
27
|
+
Requires-Dist: nucliadb-protos>=6.2.1.post3239
|
28
|
+
Requires-Dist: nucliadb-models>=6.2.1.post3239
|
29
29
|
Requires-Dist: nucliadb-admin-assets>=1.0.0.post1224
|
30
30
|
Requires-Dist: nuclia-models>=0.24.2
|
31
31
|
Requires-Dist: uvicorn
|
@@ -133,7 +133,7 @@ nucliadb/ingest/orm/entities.py,sha256=sBhg8eahsWVwO34KoAJV2YRix4Uw5GINx3srJWxRC
|
|
133
133
|
nucliadb/ingest/orm/exceptions.py,sha256=k4Esv4NtL4TrGTcsQpwrSfDhPQpiYcRbB1SpYmBX5MY,1432
|
134
134
|
nucliadb/ingest/orm/knowledgebox.py,sha256=IGOPvBR1qXqDxE5DeiOdYCLdPgjzOVVpsASJ2zYvWwQ,23651
|
135
135
|
nucliadb/ingest/orm/metrics.py,sha256=OkwMSPKLZcKba0ZTwtTiIxwBgaLMX5ydhGieKvi2y7E,1096
|
136
|
-
nucliadb/ingest/orm/resource.py,sha256=
|
136
|
+
nucliadb/ingest/orm/resource.py,sha256=u1iiq0qkMPmvOD9pgNxjgm98pFSsfQ09_T28bxbQNNw,44992
|
137
137
|
nucliadb/ingest/orm/utils.py,sha256=vCe_9UxHu26JDFGLwQ0wH-XyzJIpQCTK-Ow9dtZR5Vg,2716
|
138
138
|
nucliadb/ingest/orm/processor/__init__.py,sha256=Aqd9wCNTvggkMkCY3WvoI8spdr94Jnqk-0iq9XpLs18,922
|
139
139
|
nucliadb/ingest/orm/processor/auditing.py,sha256=TeYhXGJRyQ7ROytbb2u8R0fIh_FYi3HgTu3S1ribY3U,4623
|
@@ -226,10 +226,10 @@ nucliadb/search/search/shards.py,sha256=JSRSrHgHcF4sXyuZZoJdMfK0v_LHpoSRf1lCr5-K
|
|
226
226
|
nucliadb/search/search/summarize.py,sha256=ksmYPubEQvAQgfPdZHfzB_rR19B2ci4IYZ6jLdHxZo8,4996
|
227
227
|
nucliadb/search/search/utils.py,sha256=iF2tbBA56gRMJH1TlE2hMrqeXqjoeOPt4KgRdp2m9Ek,3313
|
228
228
|
nucliadb/search/search/chat/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
229
|
-
nucliadb/search/search/chat/ask.py,sha256=
|
229
|
+
nucliadb/search/search/chat/ask.py,sha256=JQpfAd8qePI5gr9-kPWhCjzKSSfDdgwYhB9a04CHM5o,36413
|
230
230
|
nucliadb/search/search/chat/exceptions.py,sha256=Siy4GXW2L7oPhIR86H3WHBhE9lkV4A4YaAszuGGUf54,1356
|
231
231
|
nucliadb/search/search/chat/images.py,sha256=PA8VWxT5_HUGfW1ULhKTK46UBsVyINtWWqEM1ulzX1E,3095
|
232
|
-
nucliadb/search/search/chat/prompt.py,sha256=
|
232
|
+
nucliadb/search/search/chat/prompt.py,sha256=Jnja-Ss7skgnnDY8BymVfdeYsFPnIQFL8tEvcRXTKUE,47356
|
233
233
|
nucliadb/search/search/chat/query.py,sha256=rBssR6MPSx8h2DASRMTLODaz9oGE5tNVVVeDncSrEp4,15684
|
234
234
|
nucliadb/search/search/query_parser/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
235
235
|
nucliadb/search/search/query_parser/exceptions.py,sha256=szAOXUZ27oNY-OSa9t2hQ5HHkQQC0EX1FZz_LluJHJE,1224
|
@@ -332,9 +332,9 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
|
|
332
332
|
nucliadb/writer/tus/s3.py,sha256=vF0NkFTXiXhXq3bCVXXVV-ED38ECVoUeeYViP8uMqcU,8357
|
333
333
|
nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
|
334
334
|
nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
|
335
|
-
nucliadb-6.2.1.
|
336
|
-
nucliadb-6.2.1.
|
337
|
-
nucliadb-6.2.1.
|
338
|
-
nucliadb-6.2.1.
|
339
|
-
nucliadb-6.2.1.
|
340
|
-
nucliadb-6.2.1.
|
335
|
+
nucliadb-6.2.1.post3239.dist-info/METADATA,sha256=bsLJyhn8QMlMXlDJs1Fid5A7gceWy5DFQsGZcjFMdEU,4603
|
336
|
+
nucliadb-6.2.1.post3239.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
337
|
+
nucliadb-6.2.1.post3239.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
|
338
|
+
nucliadb-6.2.1.post3239.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
|
339
|
+
nucliadb-6.2.1.post3239.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
340
|
+
nucliadb-6.2.1.post3239.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|