nucliadb 6.2.1.post3165__py3-none-any.whl → 6.2.1.post3188__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/api/v1/ask.py +11 -1
- nucliadb/search/search/query_parser/fetcher.py +2 -2
- nucliadb/standalone/settings.py +4 -0
- nucliadb/writer/api/v1/export_import.py +1 -1
- {nucliadb-6.2.1.post3165.dist-info → nucliadb-6.2.1.post3188.dist-info}/METADATA +5 -5
- {nucliadb-6.2.1.post3165.dist-info → nucliadb-6.2.1.post3188.dist-info}/RECORD +10 -10
- {nucliadb-6.2.1.post3165.dist-info → nucliadb-6.2.1.post3188.dist-info}/WHEEL +0 -0
- {nucliadb-6.2.1.post3165.dist-info → nucliadb-6.2.1.post3188.dist-info}/entry_points.txt +0 -0
- {nucliadb-6.2.1.post3165.dist-info → nucliadb-6.2.1.post3188.dist-info}/top_level.txt +0 -0
- {nucliadb-6.2.1.post3165.dist-info → nucliadb-6.2.1.post3188.dist-info}/zip-safe +0 -0
nucliadb/search/api/v1/ask.py
CHANGED
@@ -36,7 +36,8 @@ from nucliadb_models.search import (
|
|
36
36
|
SyncAskResponse,
|
37
37
|
parse_max_tokens,
|
38
38
|
)
|
39
|
-
from
|
39
|
+
from nucliadb_models.security import RequestSecurity
|
40
|
+
from nucliadb_utils.authentication import NucliaUser, requires
|
40
41
|
|
41
42
|
|
42
43
|
@api.post(
|
@@ -62,6 +63,15 @@ async def ask_knowledgebox_endpoint(
|
|
62
63
|
"This is slower and requires waiting for entire answer to be ready.",
|
63
64
|
),
|
64
65
|
) -> Union[StreamingResponse, HTTPClientError, Response]:
|
66
|
+
current_user: NucliaUser = request.user
|
67
|
+
# If present, security groups from AuthorizationBackend overrides any
|
68
|
+
# security group of the payload
|
69
|
+
if current_user.security_groups:
|
70
|
+
if item.security is None:
|
71
|
+
item.security = RequestSecurity(groups=current_user.security_groups)
|
72
|
+
else:
|
73
|
+
item.security.groups = current_user.security_groups
|
74
|
+
|
65
75
|
return await create_ask_response(
|
66
76
|
kbid, item, x_nucliadb_user, x_ndb_client, x_forwarded_for, x_synchronous
|
67
77
|
)
|
@@ -306,7 +306,7 @@ class Fetcher:
|
|
306
306
|
self.rephrase,
|
307
307
|
self.rephrase_prompt,
|
308
308
|
)
|
309
|
-
except SendToPredictError:
|
309
|
+
except (SendToPredictError, TimeoutError):
|
310
310
|
query_info = None
|
311
311
|
|
312
312
|
self.cache.predict_query_info = query_info
|
@@ -318,7 +318,7 @@ class Fetcher:
|
|
318
318
|
|
319
319
|
try:
|
320
320
|
detected_entities = await detect_entities(self.kbid, self.query)
|
321
|
-
except SendToPredictError as ex:
|
321
|
+
except (SendToPredictError, TimeoutError) as ex:
|
322
322
|
logger.warning(f"Errors on Predict API detecting entities: {ex}", extra={"kbid": self.kbid})
|
323
323
|
detected_entities = []
|
324
324
|
|
nucliadb/standalone/settings.py
CHANGED
@@ -83,6 +83,10 @@ class Settings(DriverSettings, StorageSettings, ExtendedStorageSettings):
|
|
83
83
|
default="X-NUCLIADB-ROLES",
|
84
84
|
description="Only used for `upstream_naive` auth policy.",
|
85
85
|
)
|
86
|
+
auth_policy_security_groups_header: str = pydantic.Field(
|
87
|
+
default="X-NUCLIADB-SECURITY_GROUPS",
|
88
|
+
description="Only used for `upstream_naive` auth policy.",
|
89
|
+
)
|
86
90
|
auth_policy_user_default_roles: list[NucliaDBRoles] = pydantic.Field(
|
87
91
|
default=[NucliaDBRoles.READER, NucliaDBRoles.WRITER, NucliaDBRoles.MANAGER],
|
88
92
|
description="Default role to assign to user that is authenticated \
|
@@ -112,7 +112,7 @@ async def kb_create_and_import_endpoint(request: Request):
|
|
112
112
|
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
113
113
|
import_kb_config = KnowledgeBoxConfig(
|
114
114
|
title=f"Imported KB - {now}",
|
115
|
-
learning_configuration=learning_config.
|
115
|
+
learning_configuration=learning_config.model_dump(),
|
116
116
|
)
|
117
117
|
kbid, slug = await create_kb(import_kb_config)
|
118
118
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: nucliadb
|
3
|
-
Version: 6.2.1.
|
3
|
+
Version: 6.2.1.post3188
|
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.post3188
|
26
|
+
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.2.1.post3188
|
27
|
+
Requires-Dist: nucliadb-protos>=6.2.1.post3188
|
28
|
+
Requires-Dist: nucliadb-models>=6.2.1.post3188
|
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
|
@@ -188,7 +188,7 @@ nucliadb/search/settings.py,sha256=vem3EcyYlTPSim0kEK-xe-erF4BZg0CT_LAb8ZRQAE8,1
|
|
188
188
|
nucliadb/search/utilities.py,sha256=9SsRDw0rJVXVoLBfF7rBb6q080h-thZc7u8uRcTiBeY,1037
|
189
189
|
nucliadb/search/api/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
190
190
|
nucliadb/search/api/v1/__init__.py,sha256=NSbOVF6toiHX9WMpGgqpFrjJKT50EcHzOILp-2iHk5I,1249
|
191
|
-
nucliadb/search/api/v1/ask.py,sha256=
|
191
|
+
nucliadb/search/api/v1/ask.py,sha256=F2dR3-swb3Xz8MfZPYL3G65KY2R_mgef4YVBbu8kLi4,4352
|
192
192
|
nucliadb/search/api/v1/catalog.py,sha256=ubYPS1wmPHzOgH9LR0qJmmV-9ELZPtHRSs5TYJ1pA9A,7117
|
193
193
|
nucliadb/search/api/v1/feedback.py,sha256=kNLc4dHz2SXHzV0PwC1WiRAwY88fDptPcP-kO0q-FrQ,2620
|
194
194
|
nucliadb/search/api/v1/find.py,sha256=DsnWkySu_cFajDWJIxN8DYvLL_Rm2yiCjHD8TsqPfRk,9304
|
@@ -233,7 +233,7 @@ nucliadb/search/search/chat/prompt.py,sha256=r2JTiRWH3YHPdeRAG5w6gD0g0fWVxdTjYIR
|
|
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
|
236
|
-
nucliadb/search/search/query_parser/fetcher.py,sha256=
|
236
|
+
nucliadb/search/search/query_parser/fetcher.py,sha256=4ObVZSRN_dApeA2rP0yQR7l3gdvmhxY478j3pOYMssA,15528
|
237
237
|
nucliadb/search/search/query_parser/models.py,sha256=-VlCDXUCgOroAZw1Leqhj2VMgRv_CD2w40PXXOBLaUM,2332
|
238
238
|
nucliadb/search/search/query_parser/parser.py,sha256=JC6koS9Np1PzCfEk1Xy6mpP1HmovS_vIxxA9u-kwzos,6498
|
239
239
|
nucliadb/standalone/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
@@ -247,7 +247,7 @@ nucliadb/standalone/migrations.py,sha256=s9-3RSZ-O3bjEw2TnBe_YWLUEKbub0bARUxi1gA
|
|
247
247
|
nucliadb/standalone/purge.py,sha256=ZY-cebb214FFiPG7OFmXZGg0G3CK5Amw0FLLm9WJhKE,1343
|
248
248
|
nucliadb/standalone/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
249
249
|
nucliadb/standalone/run.py,sha256=d4lmi9ePObbHeDqwcoZnp5JIkBp9iIPSw9uOwxeQMOU,5623
|
250
|
-
nucliadb/standalone/settings.py,sha256=
|
250
|
+
nucliadb/standalone/settings.py,sha256=nPJ8R8yNUQD4G92zXBi5KiD6QWhXZdtLoQQUTXfuaHE,6041
|
251
251
|
nucliadb/standalone/versions.py,sha256=8CxNMNt2NgWM8ct50UsR4d44-ae7wtQI-sV-yGiFqyI,3508
|
252
252
|
nucliadb/standalone/static/favicon.ico,sha256=96pKGp6Sx457JkTfjy1dtApMhkitixfU6invCUGAYOU,2285
|
253
253
|
nucliadb/standalone/static/index.html,sha256=PEZfuEQFYnYACAL1ceN8xC0im8lBrUx838RkE8tbvgA,3833
|
@@ -307,7 +307,7 @@ nucliadb/writer/api/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20
|
|
307
307
|
nucliadb/writer/api/constants.py,sha256=qWEDjFUycrEZnSJyLnNK4PQNodU2oVmkO4NycaEZtio,1738
|
308
308
|
nucliadb/writer/api/utils.py,sha256=wIQHlU8RQiIGVLI72suvyVIKlCU44Unh0Ae0IiN6Qwo,1313
|
309
309
|
nucliadb/writer/api/v1/__init__.py,sha256=akI9A_jloNLb0dU4T5zjfdyvmSAiDeIdjAlzNx74FlU,1128
|
310
|
-
nucliadb/writer/api/v1/export_import.py,sha256=
|
310
|
+
nucliadb/writer/api/v1/export_import.py,sha256=Cv4DNtqoR_x2LMNx80C9ehyaCaFIxhq2eutEk2uzcZg,8249
|
311
311
|
nucliadb/writer/api/v1/field.py,sha256=OsWOYA0WQ6onE5Rkl20QIEdtrSi7Jgnu62fUt90Ziy8,17503
|
312
312
|
nucliadb/writer/api/v1/knowledgebox.py,sha256=MLeIuym4jPrJgfy1NTcN9CpUGwuBiqDHMcx0hY9DR7g,9530
|
313
313
|
nucliadb/writer/api/v1/learning_config.py,sha256=GaYaagjBrVG9ZxrWQyVQfqGMQV3tAJjqJ5CStaKhktU,2058
|
@@ -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.post3188.dist-info/METADATA,sha256=ZjfEN055_Ja1OkTwxEodQOkucnC5UYXMTLjD-e1dEpw,4603
|
336
|
+
nucliadb-6.2.1.post3188.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
337
|
+
nucliadb-6.2.1.post3188.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
|
338
|
+
nucliadb-6.2.1.post3188.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
|
339
|
+
nucliadb-6.2.1.post3188.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
340
|
+
nucliadb-6.2.1.post3188.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|