nucliadb 6.3.5.post4017__py3-none-any.whl → 6.3.5.post4023__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.
@@ -17,10 +17,12 @@
17
17
  # You should have received a copy of the GNU Affero General Public License
18
18
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
19
  #
20
+ import json
20
21
  from typing import Optional, Union
21
22
 
22
23
  from fastapi import Header, Request, Response
23
24
  from fastapi_versioning import version
25
+ from pydantic import ValidationError
24
26
  from starlette.responses import StreamingResponse
25
27
 
26
28
  from nucliadb.common import datamanagers
@@ -86,9 +88,13 @@ async def ask_knowledgebox_endpoint(
86
88
  status_code=400, detail="This search configuration is not valid for `ask`"
87
89
  )
88
90
 
89
- item = AskRequest.model_validate(
90
- search_config.config.model_dump(exclude_unset=True) | item.model_dump(exclude_unset=True)
91
- )
91
+ try:
92
+ item = AskRequest.model_validate(
93
+ search_config.config.model_dump(exclude_unset=True) | item.model_dump(exclude_unset=True)
94
+ )
95
+ except ValidationError as e:
96
+ detail = json.loads(e.json())
97
+ return HTTPClientError(status_code=422, detail=detail)
92
98
 
93
99
  return await create_ask_response(
94
100
  kbid, item, x_nucliadb_user, x_ndb_client, x_forwarded_for, x_synchronous
@@ -220,9 +220,13 @@ async def _find_endpoint(
220
220
  status_code=400, detail="This search configuration is not valid for `find`"
221
221
  )
222
222
 
223
- item = FindRequest.model_validate(
224
- search_config.config.model_dump(exclude_unset=True) | item.model_dump(exclude_unset=True)
225
- )
223
+ try:
224
+ item = FindRequest.model_validate(
225
+ search_config.config.model_dump(exclude_unset=True) | item.model_dump(exclude_unset=True)
226
+ )
227
+ except ValidationError as e:
228
+ detail = json.loads(e.json())
229
+ return HTTPClientError(status_code=422, detail=detail)
226
230
 
227
231
  try:
228
232
  maybe_log_request_payload(kbid, "/find", item)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nucliadb
3
- Version: 6.3.5.post4017
3
+ Version: 6.3.5.post4023
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.5.post4017
24
- Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.3.5.post4017
25
- Requires-Dist: nucliadb-protos>=6.3.5.post4017
26
- Requires-Dist: nucliadb-models>=6.3.5.post4017
27
- Requires-Dist: nidx-protos>=6.3.5.post4017
23
+ Requires-Dist: nucliadb-telemetry[all]>=6.3.5.post4023
24
+ Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.3.5.post4023
25
+ Requires-Dist: nucliadb-protos>=6.3.5.post4023
26
+ Requires-Dist: nucliadb-models>=6.3.5.post4023
27
+ Requires-Dist: nidx-protos>=6.3.5.post4023
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]
@@ -207,10 +207,10 @@ nucliadb/search/settings.py,sha256=vem3EcyYlTPSim0kEK-xe-erF4BZg0CT_LAb8ZRQAE8,1
207
207
  nucliadb/search/utilities.py,sha256=9SsRDw0rJVXVoLBfF7rBb6q080h-thZc7u8uRcTiBeY,1037
208
208
  nucliadb/search/api/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
209
209
  nucliadb/search/api/v1/__init__.py,sha256=DH16OYnw9jQ38OpKlmdXeoq2j40ZPXZRtGvClKOkMhw,1239
210
- nucliadb/search/api/v1/ask.py,sha256=SFNjvhY3xAVniMChitILdtzwn7HmgV_k_ecn71egca0,5117
210
+ nucliadb/search/api/v1/ask.py,sha256=b4tz33HNsfT5DXv_2DMc_jirnFsHuobreWkbAKkzj5o,5337
211
211
  nucliadb/search/api/v1/catalog.py,sha256=Nw4wIj4AjGp-p64FFVQFN4v2LFcV3A0UJIxfo3_XGmY,7670
212
212
  nucliadb/search/api/v1/feedback.py,sha256=kNLc4dHz2SXHzV0PwC1WiRAwY88fDptPcP-kO0q-FrQ,2620
213
- nucliadb/search/api/v1/find.py,sha256=OOeqCVE88o4t1XzWgcknTWR0e3WcwzLDcnUhCeA1Pcc,10495
213
+ nucliadb/search/api/v1/find.py,sha256=xK-79QUlfXZKD7wG61vWEPtojg90ASc0PvCzI9yvjjs,10666
214
214
  nucliadb/search/api/v1/graph.py,sha256=ItVpzJbqfDLjoIo2fTb2mKGCM1Z34sx7CBb3gNmj6IQ,4274
215
215
  nucliadb/search/api/v1/knowledgebox.py,sha256=rWhx3PYWryingu19qwwFDbVvVYynq5Ky23FSlzmTutQ,8721
216
216
  nucliadb/search/api/v1/predict_proxy.py,sha256=QrGzo0hKjtmyGZ6pjlJHYAh4hxwVUIOTcVcerRCw7eE,3047
@@ -360,8 +360,8 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
360
360
  nucliadb/writer/tus/s3.py,sha256=vF0NkFTXiXhXq3bCVXXVV-ED38ECVoUeeYViP8uMqcU,8357
361
361
  nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
362
362
  nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
363
- nucliadb-6.3.5.post4017.dist-info/METADATA,sha256=gNYKlvOaFEGAhUCfp7SsQFLiV1jBxfY0ubquS-teEjo,4301
364
- nucliadb-6.3.5.post4017.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
365
- nucliadb-6.3.5.post4017.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
366
- nucliadb-6.3.5.post4017.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
367
- nucliadb-6.3.5.post4017.dist-info/RECORD,,
363
+ nucliadb-6.3.5.post4023.dist-info/METADATA,sha256=wqYdZmrMCVh5aJdvQ0wreuv7Iy3QOL8LAmLuMCeeP40,4301
364
+ nucliadb-6.3.5.post4023.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
365
+ nucliadb-6.3.5.post4023.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
366
+ nucliadb-6.3.5.post4023.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
367
+ nucliadb-6.3.5.post4023.dist-info/RECORD,,