nucliadb 6.3.7.post4068__py3-none-any.whl → 6.3.7.post4071__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/search/search/chat/query.py +1 -3
- nucliadb/search/search/find.py +3 -8
- nucliadb/search/search/query_parser/parsers/find.py +3 -4
- {nucliadb-6.3.7.post4068.dist-info → nucliadb-6.3.7.post4071.dist-info}/METADATA +6 -6
- {nucliadb-6.3.7.post4068.dist-info → nucliadb-6.3.7.post4071.dist-info}/RECORD +8 -8
- {nucliadb-6.3.7.post4068.dist-info → nucliadb-6.3.7.post4071.dist-info}/WHEEL +0 -0
- {nucliadb-6.3.7.post4068.dist-info → nucliadb-6.3.7.post4071.dist-info}/entry_points.txt +0 -0
- {nucliadb-6.3.7.post4068.dist-info → nucliadb-6.3.7.post4071.dist-info}/top_level.txt +0 -0
@@ -108,7 +108,6 @@ async def get_find_results(
|
|
108
108
|
x_ndb_client=ndb_client,
|
109
109
|
x_nucliadb_user=user,
|
110
110
|
x_forwarded_for=origin,
|
111
|
-
generative_model=item.generative_model,
|
112
111
|
metrics=metrics,
|
113
112
|
)
|
114
113
|
prefilter_matching_resources = {
|
@@ -210,6 +209,7 @@ def find_request_from_ask_request(item: AskRequest, query: str) -> FindRequest:
|
|
210
209
|
# We don't support pagination, we always get the top_k results.
|
211
210
|
find_request.top_k = item.top_k
|
212
211
|
find_request.show_hidden = item.show_hidden
|
212
|
+
find_request.generative_model = item.generative_model
|
213
213
|
|
214
214
|
# this executes the model validators, that can tweak some fields
|
215
215
|
return FindRequest.model_validate(find_request)
|
@@ -232,7 +232,6 @@ async def run_main_query(
|
|
232
232
|
ndb_client,
|
233
233
|
user,
|
234
234
|
origin,
|
235
|
-
generative_model=item.generative_model,
|
236
235
|
metrics=metrics,
|
237
236
|
)
|
238
237
|
if incomplete:
|
@@ -469,7 +468,6 @@ async def run_prequeries(
|
|
469
468
|
x_ndb_client,
|
470
469
|
x_nucliadb_user,
|
471
470
|
x_forwarded_for,
|
472
|
-
generative_model=generative_model,
|
473
471
|
metrics=metrics,
|
474
472
|
)
|
475
473
|
return prequery, find_results
|
nucliadb/search/search/find.py
CHANGED
@@ -19,7 +19,6 @@
|
|
19
19
|
#
|
20
20
|
import logging
|
21
21
|
from time import time
|
22
|
-
from typing import Optional
|
23
22
|
|
24
23
|
from nucliadb.common.external_index_providers.base import ExternalIndexManager
|
25
24
|
from nucliadb.common.external_index_providers.manager import get_external_index_manager
|
@@ -65,7 +64,6 @@ async def find(
|
|
65
64
|
x_ndb_client: NucliaDBClientType,
|
66
65
|
x_nucliadb_user: str,
|
67
66
|
x_forwarded_for: str,
|
68
|
-
generative_model: Optional[str] = None,
|
69
67
|
metrics: RAGMetrics = RAGMetrics(),
|
70
68
|
) -> tuple[KnowledgeboxFindResults, bool, ParsedQuery]:
|
71
69
|
external_index_manager = await get_external_index_manager(kbid=kbid)
|
@@ -74,11 +72,10 @@ async def find(
|
|
74
72
|
kbid,
|
75
73
|
item,
|
76
74
|
external_index_manager,
|
77
|
-
generative_model,
|
78
75
|
)
|
79
76
|
else:
|
80
77
|
return await _index_node_retrieval(
|
81
|
-
kbid, item, x_ndb_client, x_nucliadb_user, x_forwarded_for,
|
78
|
+
kbid, item, x_ndb_client, x_nucliadb_user, x_forwarded_for, metrics
|
82
79
|
)
|
83
80
|
|
84
81
|
|
@@ -88,14 +85,13 @@ async def _index_node_retrieval(
|
|
88
85
|
x_ndb_client: NucliaDBClientType,
|
89
86
|
x_nucliadb_user: str,
|
90
87
|
x_forwarded_for: str,
|
91
|
-
generative_model: Optional[str] = None,
|
92
88
|
metrics: RAGMetrics = RAGMetrics(),
|
93
89
|
) -> tuple[KnowledgeboxFindResults, bool, ParsedQuery]:
|
94
90
|
audit = get_audit()
|
95
91
|
start_time = time()
|
96
92
|
|
97
93
|
with metrics.time("query_parse"):
|
98
|
-
parsed = await parse_find(kbid, item
|
94
|
+
parsed = await parse_find(kbid, item)
|
99
95
|
rank_fusion = get_rank_fusion(parsed.retrieval.rank_fusion)
|
100
96
|
reranker = get_reranker(parsed.retrieval.reranker)
|
101
97
|
pb_query, incomplete_results, autofilters, rephrased_query = await convert_retrieval_to_proto(
|
@@ -179,13 +175,12 @@ async def _external_index_retrieval(
|
|
179
175
|
kbid: str,
|
180
176
|
item: FindRequest,
|
181
177
|
external_index_manager: ExternalIndexManager,
|
182
|
-
generative_model: Optional[str] = None,
|
183
178
|
) -> tuple[KnowledgeboxFindResults, bool, ParsedQuery]:
|
184
179
|
"""
|
185
180
|
Parse the query, query the external index, and hydrate the results.
|
186
181
|
"""
|
187
182
|
# Parse query
|
188
|
-
parsed = await parse_find(kbid, item
|
183
|
+
parsed = await parse_find(kbid, item)
|
189
184
|
reranker = get_reranker(parsed.retrieval.reranker)
|
190
185
|
search_request, incomplete_results, _, rephrased_query = await convert_retrieval_to_proto(parsed)
|
191
186
|
|
@@ -61,17 +61,16 @@ from .common import (
|
|
61
61
|
async def parse_find(
|
62
62
|
kbid: str,
|
63
63
|
item: FindRequest,
|
64
|
-
generative_model: Optional[str] = None,
|
65
64
|
*,
|
66
65
|
fetcher: Optional[Fetcher] = None,
|
67
66
|
) -> ParsedQuery:
|
68
|
-
fetcher = fetcher or fetcher_for_find(kbid, item
|
67
|
+
fetcher = fetcher or fetcher_for_find(kbid, item)
|
69
68
|
parser = _FindParser(kbid, item, fetcher)
|
70
69
|
retrieval = await parser.parse()
|
71
70
|
return ParsedQuery(fetcher=fetcher, retrieval=retrieval, generation=None)
|
72
71
|
|
73
72
|
|
74
|
-
def fetcher_for_find(kbid: str, item: FindRequest
|
73
|
+
def fetcher_for_find(kbid: str, item: FindRequest) -> Fetcher:
|
75
74
|
return Fetcher(
|
76
75
|
kbid=kbid,
|
77
76
|
query=item.query,
|
@@ -79,7 +78,7 @@ def fetcher_for_find(kbid: str, item: FindRequest, generative_model: Optional[st
|
|
79
78
|
vectorset=item.vectorset,
|
80
79
|
rephrase=item.rephrase,
|
81
80
|
rephrase_prompt=item.rephrase_prompt,
|
82
|
-
generative_model=generative_model,
|
81
|
+
generative_model=item.generative_model,
|
83
82
|
)
|
84
83
|
|
85
84
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: nucliadb
|
3
|
-
Version: 6.3.7.
|
3
|
+
Version: 6.3.7.post4071
|
4
4
|
Summary: NucliaDB
|
5
5
|
Author-email: Nuclia <nucliadb@nuclia.com>
|
6
6
|
License: AGPL
|
@@ -20,11 +20,11 @@ Classifier: Programming Language :: Python :: 3.12
|
|
20
20
|
Classifier: Programming Language :: Python :: 3 :: Only
|
21
21
|
Requires-Python: <4,>=3.9
|
22
22
|
Description-Content-Type: text/markdown
|
23
|
-
Requires-Dist: nucliadb-telemetry[all]>=6.3.7.
|
24
|
-
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.3.7.
|
25
|
-
Requires-Dist: nucliadb-protos>=6.3.7.
|
26
|
-
Requires-Dist: nucliadb-models>=6.3.7.
|
27
|
-
Requires-Dist: nidx-protos>=6.3.7.
|
23
|
+
Requires-Dist: nucliadb-telemetry[all]>=6.3.7.post4071
|
24
|
+
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.3.7.post4071
|
25
|
+
Requires-Dist: nucliadb-protos>=6.3.7.post4071
|
26
|
+
Requires-Dist: nucliadb-models>=6.3.7.post4071
|
27
|
+
Requires-Dist: nidx-protos>=6.3.7.post4071
|
28
28
|
Requires-Dist: nucliadb-admin-assets>=1.0.0.post1224
|
29
29
|
Requires-Dist: nuclia-models>=0.24.2
|
30
30
|
Requires-Dist: uvicorn[standard]
|
@@ -233,7 +233,7 @@ nucliadb/search/search/cut.py,sha256=ytY0_GY7ocNjfxTb4aosxEp4ZfhQNDP--JkhEMGD298
|
|
233
233
|
nucliadb/search/search/exceptions.py,sha256=klGLgAGGrXcSGix_W6418ZBMqDchAIGjN77ofkOScEI,1039
|
234
234
|
nucliadb/search/search/fetch.py,sha256=XJHIFnZmXM_8Kb37lb4lg1GYG7cZ1plT-qAIb_QziX4,6184
|
235
235
|
nucliadb/search/search/filters.py,sha256=1MkHlJjAQqoRCj7e5cEzK2HvBxGLE17I_omsjiklbtw,6476
|
236
|
-
nucliadb/search/search/find.py,sha256=
|
236
|
+
nucliadb/search/search/find.py,sha256=p1W_7cmtpmhIJOX2ttlnMAfBRdn85YkF6vJjeh5aOOA,7904
|
237
237
|
nucliadb/search/search/find_merge.py,sha256=sS_0ZeTDs7AiWWuDmYos8mThG5XvaTE92DBoQOPHGTQ,17964
|
238
238
|
nucliadb/search/search/graph_merge.py,sha256=OiUNiXOWwrUVKqStuRcoUJwvDbDYamqIgiAy_FwPdMI,3405
|
239
239
|
nucliadb/search/search/graph_strategy.py,sha256=hwof-jxYELI6EYmvccDViDda3urE6E7v24-_-IsEF3E,32916
|
@@ -255,7 +255,7 @@ nucliadb/search/search/chat/ask.py,sha256=nGReEt6MRfBibMxWuH3H7jw5ktK3OmSW9ixzx-
|
|
255
255
|
nucliadb/search/search/chat/exceptions.py,sha256=Siy4GXW2L7oPhIR86H3WHBhE9lkV4A4YaAszuGGUf54,1356
|
256
256
|
nucliadb/search/search/chat/images.py,sha256=PA8VWxT5_HUGfW1ULhKTK46UBsVyINtWWqEM1ulzX1E,3095
|
257
257
|
nucliadb/search/search/chat/prompt.py,sha256=Jnja-Ss7skgnnDY8BymVfdeYsFPnIQFL8tEvcRXTKUE,47356
|
258
|
-
nucliadb/search/search/chat/query.py,sha256=
|
258
|
+
nucliadb/search/search/chat/query.py,sha256=YZCp4rrc1wSQevHixXT6eUz4ylF7pZ55L15K6yoGn-U,16705
|
259
259
|
nucliadb/search/search/query_parser/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
260
260
|
nucliadb/search/search/query_parser/exceptions.py,sha256=szAOXUZ27oNY-OSa9t2hQ5HHkQQC0EX1FZz_LluJHJE,1224
|
261
261
|
nucliadb/search/search/query_parser/fetcher.py,sha256=SkvBRDfSKmuz-QygNKLAU4AhZhhDo1dnOZmt1zA28RA,16851
|
@@ -266,7 +266,7 @@ nucliadb/search/search/query_parser/parsers/__init__.py,sha256=ySCNSdbesLXGZyR88
|
|
266
266
|
nucliadb/search/search/query_parser/parsers/ask.py,sha256=eTz8wS-EJHuAagR384h6TT64itymFZRpfZJGX8r6aZM,2771
|
267
267
|
nucliadb/search/search/query_parser/parsers/catalog.py,sha256=XdBiTweGTQkj8m_V_i2xbwp7P5pPO8K1Tud692XKhMw,7149
|
268
268
|
nucliadb/search/search/query_parser/parsers/common.py,sha256=InUWq5cL_LBDptuibQiSMw-9OeByqymTTqW0dzp7rM0,6265
|
269
|
-
nucliadb/search/search/query_parser/parsers/find.py,sha256=
|
269
|
+
nucliadb/search/search/query_parser/parsers/find.py,sha256=EM60bCJ49TyIz2VLITHXP4fdVxzolkzqnFE9pPOBJ1A,11172
|
270
270
|
nucliadb/search/search/query_parser/parsers/graph.py,sha256=QJs-pybNXPsMSEkIHctb0Q0xQG-aArks8BtUxbJL5rU,9386
|
271
271
|
nucliadb/search/search/query_parser/parsers/search.py,sha256=Qh_xVdLW-jGyD2xDfiRU0K7vDuPu_3JsZEWJn81TLHw,9805
|
272
272
|
nucliadb/search/search/query_parser/parsers/unit_retrieval.py,sha256=2NS11DnSUqj3A58mZVMsVRkH00ah9S1lXgUvJZF8NCI,6773
|
@@ -365,8 +365,8 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
|
|
365
365
|
nucliadb/writer/tus/s3.py,sha256=vF0NkFTXiXhXq3bCVXXVV-ED38ECVoUeeYViP8uMqcU,8357
|
366
366
|
nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
|
367
367
|
nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
|
368
|
-
nucliadb-6.3.7.
|
369
|
-
nucliadb-6.3.7.
|
370
|
-
nucliadb-6.3.7.
|
371
|
-
nucliadb-6.3.7.
|
372
|
-
nucliadb-6.3.7.
|
368
|
+
nucliadb-6.3.7.post4071.dist-info/METADATA,sha256=3JJuljpgyjrUSi8gWfBiqjVqgpdLZL_2mLGZ2q0y-jQ,4301
|
369
|
+
nucliadb-6.3.7.post4071.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
|
370
|
+
nucliadb-6.3.7.post4071.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
|
371
|
+
nucliadb-6.3.7.post4071.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
|
372
|
+
nucliadb-6.3.7.post4071.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|