nucliadb 6.2.1.post3229__py3-none-any.whl → 6.2.1.post3243__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.
@@ -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.post3229
3
+ Version: 6.2.1.post3243
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.post3229
26
- Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.2.1.post3229
27
- Requires-Dist: nucliadb-protos>=6.2.1.post3229
28
- Requires-Dist: nucliadb-models>=6.2.1.post3229
25
+ Requires-Dist: nucliadb-telemetry[all]>=6.2.1.post3243
26
+ Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.2.1.post3243
27
+ Requires-Dist: nucliadb-protos>=6.2.1.post3243
28
+ Requires-Dist: nucliadb-models>=6.2.1.post3243
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
@@ -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=K85Size6WAb-q4sCn0u1drrPnqIvqCy6YbfCxQmsEt8,36348
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=r2JTiRWH3YHPdeRAG5w6gD0g0fWVxdTjYIR86qAVa7k,47106
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.post3229.dist-info/METADATA,sha256=Q_af9LYsLGbsYCTrh4hkXZtDHHZmm9VZmk6TZdUu_4Q,4603
336
- nucliadb-6.2.1.post3229.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
337
- nucliadb-6.2.1.post3229.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
338
- nucliadb-6.2.1.post3229.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
339
- nucliadb-6.2.1.post3229.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
340
- nucliadb-6.2.1.post3229.dist-info/RECORD,,
335
+ nucliadb-6.2.1.post3243.dist-info/METADATA,sha256=U5WRw_ozdq7WlDXs5S6mgPoBZY9O-wvdj97InMm2KBM,4603
336
+ nucliadb-6.2.1.post3243.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
337
+ nucliadb-6.2.1.post3243.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
338
+ nucliadb-6.2.1.post3243.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
339
+ nucliadb-6.2.1.post3243.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
340
+ nucliadb-6.2.1.post3243.dist-info/RECORD,,