nucliadb 6.2.1.post3117__py3-none-any.whl → 6.2.1.post3125__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.
@@ -23,4 +23,5 @@ from . import knowledgebox # noqa
23
23
  from . import learning_config # noqa
24
24
  from . import resource # noqa
25
25
  from . import services # noqa
26
+ from . import vectorsets # noqa
26
27
  from .router import api # noqa
@@ -0,0 +1,48 @@
1
+ # Copyright (C) 2021 Bosutech XXI S.L.
2
+ #
3
+ # nucliadb is offered under the AGPL v3.0 and as commercial software.
4
+ # For commercial licensing, contact us at info@nuclia.com.
5
+ #
6
+ # AGPL:
7
+ # This program is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU Affero General Public License as
9
+ # published by the Free Software Foundation, either version 3 of the
10
+ # License, or (at your option) any later version.
11
+ #
12
+ # This program is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU Affero General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Affero General Public License
18
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
+ from fastapi_versioning import version
21
+ from starlette.requests import Request
22
+
23
+ from nucliadb.common import datamanagers
24
+ from nucliadb.reader.api.v1.router import KB_PREFIX, api
25
+ from nucliadb_models.resource import (
26
+ NucliaDBRoles,
27
+ )
28
+ from nucliadb_models.vectorsets import VectorSetList, VectorSetListItem
29
+ from nucliadb_utils.authentication import requires_one
30
+
31
+
32
+ @api.get(
33
+ f"/{KB_PREFIX}/{{kbid}}/vectorsets",
34
+ status_code=200,
35
+ summary="List vector sets",
36
+ response_model=VectorSetList,
37
+ tags=["Vector Sets"],
38
+ # TODO: remove when the feature is mature
39
+ include_in_schema=False,
40
+ )
41
+ @requires_one([NucliaDBRoles.READER])
42
+ @version(1)
43
+ async def list_vectorsets(request: Request, kbid: str) -> VectorSetList:
44
+ vectorsets = []
45
+ async with datamanagers.with_ro_transaction() as txn:
46
+ async for vid, _ in datamanagers.vectorsets.iter(txn, kbid=kbid):
47
+ vectorsets.append(VectorSetListItem(id=vid))
48
+ return VectorSetList(vectorsets=vectorsets)
@@ -96,9 +96,13 @@ async def build_find_response(
96
96
  )
97
97
  )
98
98
 
99
- merged_text_blocks: list[TextBlockMatch] = rank_fusion_algorithm.fuse(
100
- keyword_results, semantic_results
101
- )
99
+ merged_text_blocks: list[TextBlockMatch]
100
+ if len(keyword_results) == 0:
101
+ merged_text_blocks = semantic_results
102
+ elif len(semantic_results) == 0:
103
+ merged_text_blocks = keyword_results
104
+ else:
105
+ merged_text_blocks = rank_fusion_algorithm.fuse(keyword_results, semantic_results)
102
106
 
103
107
  # cut
104
108
  # we assume pagination + predict reranker is forbidden and has been already
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: nucliadb
3
- Version: 6.2.1.post3117
3
+ Version: 6.2.1.post3125
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.post3117
26
- Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.2.1.post3117
27
- Requires-Dist: nucliadb-protos>=6.2.1.post3117
28
- Requires-Dist: nucliadb-models>=6.2.1.post3117
25
+ Requires-Dist: nucliadb-telemetry[all]>=6.2.1.post3125
26
+ Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.2.1.post3125
27
+ Requires-Dist: nucliadb-protos>=6.2.1.post3125
28
+ Requires-Dist: nucliadb-models>=6.2.1.post3125
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
@@ -166,7 +166,7 @@ nucliadb/reader/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
166
166
  nucliadb/reader/run.py,sha256=AR-iCnON3YVXgI5-KEgg99G4KAPN1BKXDg7nr4dgoDA,1447
167
167
  nucliadb/reader/api/__init__.py,sha256=c-UD29C0FVzQDGEvslebDCKtvnyEcAbiDd-3Q_QgGN4,872
168
168
  nucliadb/reader/api/models.py,sha256=UHhOPmh8xcHhDjFm8_-8t66yEggXdxRBoY0xV-hI9to,2076
169
- nucliadb/reader/api/v1/__init__.py,sha256=G1s6_1SEvv8CrC_V_tB4fvjQ8tLHivAIbK47dOT_lb4,1069
169
+ nucliadb/reader/api/v1/__init__.py,sha256=ieP8lsCCwG66Jupv8II5MSTj6nh3eCtLcF4utH9JOcU,1102
170
170
  nucliadb/reader/api/v1/download.py,sha256=rGv1c5CjrJheDgGwAnNWy76A_4V2shqqHYvwmKGFlpk,10758
171
171
  nucliadb/reader/api/v1/export_import.py,sha256=x4VBNDFjnlY1nIt5kdq0eZTB_DeRzGzT8T7uB7wUhNU,6448
172
172
  nucliadb/reader/api/v1/knowledgebox.py,sha256=Uu-yPB8KKZt1VaFrFNMMaXOvLsclBJDK9dzZ9lF2ctI,3645
@@ -174,6 +174,7 @@ nucliadb/reader/api/v1/learning_config.py,sha256=w5a_miobPGakKmyLXkmuz1e6tXyIMSa
174
174
  nucliadb/reader/api/v1/resource.py,sha256=SFIv_vpgkdJQv7L_UgYZS5FvubipJ0ligpExGDjKHV0,14064
175
175
  nucliadb/reader/api/v1/router.py,sha256=eyNmEGSP9zHkCIG5XlAXl6sukq950B7gFT3X2peMtIE,1011
176
176
  nucliadb/reader/api/v1/services.py,sha256=B8fD4zcUydZ5Fl1DDxfXGNuW6C8rhGYc920O5Zy5Yv8,11716
177
+ nucliadb/reader/api/v1/vectorsets.py,sha256=insTwaykshz442cMKa2VP74wJwvZrIYi0U7M9EM3aCM,1822
177
178
  nucliadb/reader/reader/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
178
179
  nucliadb/reader/reader/notifications.py,sha256=HVZNUlfbSuoZ9BsSs8wmzPeYurl0U0O2ooVlR9KSM3U,7792
179
180
  nucliadb/search/__init__.py,sha256=tnypbqcH4nBHbGpkINudhKgdLKpwXQCvDtPchUlsyY4,1511
@@ -210,7 +211,7 @@ nucliadb/search/search/exceptions.py,sha256=mbToQ-ghrv8ukLEv8S_-EZrgweWaIZZ5SIpo
210
211
  nucliadb/search/search/fetch.py,sha256=XJHIFnZmXM_8Kb37lb4lg1GYG7cZ1plT-qAIb_QziX4,6184
211
212
  nucliadb/search/search/filters.py,sha256=1MkHlJjAQqoRCj7e5cEzK2HvBxGLE17I_omsjiklbtw,6476
212
213
  nucliadb/search/search/find.py,sha256=yQbttt85wQFc4NEaj2RNGgozP7IQx_bjAOhHke3fXY0,9890
213
- nucliadb/search/search/find_merge.py,sha256=_R_YpHAZv5BHh3XABQ8MRd1Ci0seclGYf26yJHJ7H0I,17178
214
+ nucliadb/search/search/find_merge.py,sha256=5Aqz54E5GG8jw666KNncVHIJcs821ug-YwJ46YL6Br8,17363
214
215
  nucliadb/search/search/graph_strategy.py,sha256=Egcq_zn895gTUYmyQTsXj8YaUMa3HBKhcSa1GBvgzAM,31877
215
216
  nucliadb/search/search/hydrator.py,sha256=-R37gCrGxkyaiHQalnTWHNG_FCx11Zucd7qA1vQCxuw,6985
216
217
  nucliadb/search/search/merge.py,sha256=i_PTBFRqC5iTTziOMEltxLIlmokIou5hjjgR4BnoLBE,22635
@@ -330,9 +331,9 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
330
331
  nucliadb/writer/tus/s3.py,sha256=vF0NkFTXiXhXq3bCVXXVV-ED38ECVoUeeYViP8uMqcU,8357
331
332
  nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
332
333
  nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
333
- nucliadb-6.2.1.post3117.dist-info/METADATA,sha256=9cCdwysh7Y4f_vm4a9Z8rdLFhz5cT5XiH_56lWNOnQU,4603
334
- nucliadb-6.2.1.post3117.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
335
- nucliadb-6.2.1.post3117.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
336
- nucliadb-6.2.1.post3117.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
337
- nucliadb-6.2.1.post3117.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
338
- nucliadb-6.2.1.post3117.dist-info/RECORD,,
334
+ nucliadb-6.2.1.post3125.dist-info/METADATA,sha256=LUEjg5Ixss5lf4_mIhNwqcNI-a1q0RUfN7tWZPPnPwg,4603
335
+ nucliadb-6.2.1.post3125.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
336
+ nucliadb-6.2.1.post3125.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
337
+ nucliadb-6.2.1.post3125.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
338
+ nucliadb-6.2.1.post3125.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
339
+ nucliadb-6.2.1.post3125.dist-info/RECORD,,