nucliadb 6.2.1.post3365__py3-none-any.whl → 6.2.1.post3377__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/learning_proxy.py +2 -11
- nucliadb/reader/api/v1/learning_config.py +40 -0
- nucliadb/search/search/predict_proxy.py +4 -0
- nucliadb/writer/api/v1/learning_config.py +39 -0
- {nucliadb-6.2.1.post3365.dist-info → nucliadb-6.2.1.post3377.dist-info}/METADATA +6 -6
- {nucliadb-6.2.1.post3365.dist-info → nucliadb-6.2.1.post3377.dist-info}/RECORD +9 -9
- {nucliadb-6.2.1.post3365.dist-info → nucliadb-6.2.1.post3377.dist-info}/WHEEL +0 -0
- {nucliadb-6.2.1.post3365.dist-info → nucliadb-6.2.1.post3377.dist-info}/entry_points.txt +0 -0
- {nucliadb-6.2.1.post3365.dist-info → nucliadb-6.2.1.post3377.dist-info}/top_level.txt +0 -0
nucliadb/learning_proxy.py
CHANGED
@@ -236,11 +236,7 @@ async def _retriable_proxied_request(
|
|
236
236
|
params: dict[str, Any],
|
237
237
|
) -> httpx.Response:
|
238
238
|
return await client.request(
|
239
|
-
method=method.upper(),
|
240
|
-
url=url,
|
241
|
-
params=params,
|
242
|
-
content=content,
|
243
|
-
headers=headers,
|
239
|
+
method=method.upper(), url=url, params=params, content=content, headers=headers
|
244
240
|
)
|
245
241
|
|
246
242
|
|
@@ -414,12 +410,7 @@ class DummyClient(httpx.AsyncClient):
|
|
414
410
|
return self.get_config(*args, **kwargs)
|
415
411
|
|
416
412
|
async def request( # type: ignore
|
417
|
-
self,
|
418
|
-
method: str,
|
419
|
-
url: str,
|
420
|
-
params=None,
|
421
|
-
content=None,
|
422
|
-
headers=None,
|
413
|
+
self, method: str, url: str, params=None, content=None, headers=None, *args, **kwargs
|
423
414
|
) -> httpx.Response:
|
424
415
|
return self._handle_request(method, url, params=params, content=content, headers=headers)
|
425
416
|
|
@@ -17,8 +17,11 @@
|
|
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
|
+
from typing import Dict
|
21
|
+
|
20
22
|
from fastapi import Request
|
21
23
|
from fastapi_versioning import version
|
24
|
+
from nuclia_models.config.proto import ExtractConfig
|
22
25
|
|
23
26
|
from nucliadb.learning_proxy import learning_config_proxy
|
24
27
|
from nucliadb.models.responses import HTTPClientError
|
@@ -143,3 +146,40 @@ async def get_schema_for_configuration_creation(
|
|
143
146
|
if not is_onprem_nucliadb():
|
144
147
|
return HTTPClientError(status_code=404, detail="Endpoint not available for Hosted NucliaDB")
|
145
148
|
return await learning_config_proxy(request, "GET", f"/schema")
|
149
|
+
|
150
|
+
|
151
|
+
@api.get(
|
152
|
+
path=f"/{KB_PREFIX}/{{kbid}}/extract_strategies",
|
153
|
+
status_code=200,
|
154
|
+
summary="Learning extract strategies",
|
155
|
+
description="Get available extract strategies ",
|
156
|
+
response_model=Dict[str, ExtractConfig],
|
157
|
+
tags=["Extract Strategies"],
|
158
|
+
)
|
159
|
+
@requires(NucliaDBRoles.READER)
|
160
|
+
@version(1)
|
161
|
+
async def get_extract_strategies(
|
162
|
+
request: Request,
|
163
|
+
kbid: str,
|
164
|
+
):
|
165
|
+
return await learning_config_proxy(request, "GET", f"/extract_strategies/{kbid}")
|
166
|
+
|
167
|
+
|
168
|
+
@api.get(
|
169
|
+
path=f"/{KB_PREFIX}/{{kbid}}/extract_strategies/strategy/{{strategy_id}}",
|
170
|
+
status_code=200,
|
171
|
+
summary="Extract strategy configuration",
|
172
|
+
description="Get extract strategy for a given id",
|
173
|
+
response_model=None,
|
174
|
+
tags=["Extract Strategies"],
|
175
|
+
)
|
176
|
+
@requires(NucliaDBRoles.READER)
|
177
|
+
@version(1)
|
178
|
+
async def get_extract_strategy_from_id(
|
179
|
+
request: Request,
|
180
|
+
kbid: str,
|
181
|
+
strategy_id: str,
|
182
|
+
):
|
183
|
+
return await learning_config_proxy(
|
184
|
+
request, "GET", f"/extract_strategies/{kbid}/strategies/{strategy_id}"
|
185
|
+
)
|
@@ -19,6 +19,7 @@
|
|
19
19
|
#
|
20
20
|
from fastapi import Request
|
21
21
|
from fastapi_versioning import version
|
22
|
+
from nuclia_models.config.proto import ExtractConfig
|
22
23
|
|
23
24
|
from nucliadb.learning_proxy import learning_config_proxy
|
24
25
|
from nucliadb.writer.api.v1.router import KB_PREFIX, api
|
@@ -58,3 +59,41 @@ async def patch_configuration(
|
|
58
59
|
kbid: str,
|
59
60
|
):
|
60
61
|
return await learning_config_proxy(request, "PATCH", f"/config/{kbid}")
|
62
|
+
|
63
|
+
|
64
|
+
@api.post(
|
65
|
+
path=f"/{KB_PREFIX}/{{kbid}}/extract_strategies",
|
66
|
+
status_code=200,
|
67
|
+
summary="Add a extract strategy to a KB",
|
68
|
+
description="Add a extract strategy to a KB",
|
69
|
+
response_model=str,
|
70
|
+
tags=["Extract Strategies"],
|
71
|
+
)
|
72
|
+
@requires(NucliaDBRoles.WRITER)
|
73
|
+
@version(1)
|
74
|
+
async def add_strategy(
|
75
|
+
request: Request,
|
76
|
+
kbid: str,
|
77
|
+
item: ExtractConfig,
|
78
|
+
):
|
79
|
+
return await learning_config_proxy(request, "POST", f"/extract_strategies/{kbid}")
|
80
|
+
|
81
|
+
|
82
|
+
@api.delete(
|
83
|
+
path=f"/{KB_PREFIX}/{{kbid}}/extract_strategies/strategy/{{strategy_id}}",
|
84
|
+
status_code=204,
|
85
|
+
summary="Remove a extract strategy from a KB",
|
86
|
+
description="Removes a extract strategy from a KB",
|
87
|
+
response_model=None,
|
88
|
+
tags=["Extract Strategies"],
|
89
|
+
)
|
90
|
+
@requires(NucliaDBRoles.WRITER)
|
91
|
+
@version(1)
|
92
|
+
async def delete_strategy(
|
93
|
+
request: Request,
|
94
|
+
kbid: str,
|
95
|
+
strategy_id: str,
|
96
|
+
):
|
97
|
+
return await learning_config_proxy(
|
98
|
+
request, "POST", f"/extract_strategies/{kbid}/strategies/{strategy_id}"
|
99
|
+
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: nucliadb
|
3
|
-
Version: 6.2.1.
|
3
|
+
Version: 6.2.1.post3377
|
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.2.1.
|
24
|
-
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.2.1.
|
25
|
-
Requires-Dist: nucliadb-protos>=6.2.1.
|
26
|
-
Requires-Dist: nucliadb-models>=6.2.1.
|
27
|
-
Requires-Dist: nidx-protos>=6.2.1.
|
23
|
+
Requires-Dist: nucliadb-telemetry[all]>=6.2.1.post3377
|
24
|
+
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.2.1.post3377
|
25
|
+
Requires-Dist: nucliadb-protos>=6.2.1.post3377
|
26
|
+
Requires-Dist: nucliadb-models>=6.2.1.post3377
|
27
|
+
Requires-Dist: nidx-protos>=6.2.1.post3377
|
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
|
@@ -33,7 +33,7 @@ migrations/pg/0003_catalog_kbid_index.py,sha256=uKq_vtnuf73GVf0mtl2rhzdk_czAoEU1
|
|
33
33
|
migrations/pg/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
34
34
|
nucliadb/__init__.py,sha256=_abCmDJ_0ku483Os4UAjPX7Nywm39cQgAV_DiyjsKeQ,891
|
35
35
|
nucliadb/health.py,sha256=UIxxA4oms4HIsCRZM_SZsdkIZIlgzmOxw-qSHLlWuak,3465
|
36
|
-
nucliadb/learning_proxy.py,sha256=
|
36
|
+
nucliadb/learning_proxy.py,sha256=Gf76qXxjl1lrHEFaCpOUfjjf0ab6eGLNxLMJz3-M_mo,19354
|
37
37
|
nucliadb/metrics_exporter.py,sha256=Rz6G7V_C_GTZCFzd0xEtIfixtZgUuffnr4rDKCbXXWM,5595
|
38
38
|
nucliadb/openapi.py,sha256=wDiw0dVEvTpJvbatkJ0JZLkKm9RItZT5PWRHjqRfqTA,2272
|
39
39
|
nucliadb/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -170,7 +170,7 @@ nucliadb/reader/api/v1/__init__.py,sha256=ieP8lsCCwG66Jupv8II5MSTj6nh3eCtLcF4utH
|
|
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
|
173
|
-
nucliadb/reader/api/v1/learning_config.py,sha256=
|
173
|
+
nucliadb/reader/api/v1/learning_config.py,sha256=CZ7pFXzBZkJE2dXbC1wArszJw_ZLpuEb6gnsz2MKEz0,5525
|
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
|
@@ -222,7 +222,7 @@ nucliadb/search/search/merge.py,sha256=i_PTBFRqC5iTTziOMEltxLIlmokIou5hjjgR4BnoL
|
|
222
222
|
nucliadb/search/search/metrics.py,sha256=81X-tahGW4n2CLvUzCPdNxNClmZqUWZjcVOGCUHoiUM,2872
|
223
223
|
nucliadb/search/search/paragraphs.py,sha256=pNAEiYqJGGUVcEf7xf-PFMVqz0PX4Qb-WNG-_zPGN2o,7799
|
224
224
|
nucliadb/search/search/pgcatalog.py,sha256=IaNK4dAxdXs38PoIkTdgqMDuZDjeiOtcXn3LeaT-OMw,8855
|
225
|
-
nucliadb/search/search/predict_proxy.py,sha256=
|
225
|
+
nucliadb/search/search/predict_proxy.py,sha256=IFI3v_ODz2_UU1XZnyaD391fE7-2C0npSmj_HmDvzS4,3123
|
226
226
|
nucliadb/search/search/query.py,sha256=vSnnqJPB5iHI7kugaL6boH1l4j5HV6ln4EKbskJnFWw,27346
|
227
227
|
nucliadb/search/search/rank_fusion.py,sha256=tRGo_KlsFsVx1CQEy1iqQ6f0T1Dq1kf0axDXHuuzvvM,6946
|
228
228
|
nucliadb/search/search/rerankers.py,sha256=3vep4EOVNeDJGsMdx-1g6Ar4ZGJG3IHym3HkxnbwtAQ,7321
|
@@ -314,7 +314,7 @@ nucliadb/writer/api/v1/__init__.py,sha256=akI9A_jloNLb0dU4T5zjfdyvmSAiDeIdjAlzNx
|
|
314
314
|
nucliadb/writer/api/v1/export_import.py,sha256=Cv4DNtqoR_x2LMNx80C9ehyaCaFIxhq2eutEk2uzcZg,8249
|
315
315
|
nucliadb/writer/api/v1/field.py,sha256=OsWOYA0WQ6onE5Rkl20QIEdtrSi7Jgnu62fUt90Ziy8,17503
|
316
316
|
nucliadb/writer/api/v1/knowledgebox.py,sha256=MLeIuym4jPrJgfy1NTcN9CpUGwuBiqDHMcx0hY9DR7g,9530
|
317
|
-
nucliadb/writer/api/v1/learning_config.py,sha256=
|
317
|
+
nucliadb/writer/api/v1/learning_config.py,sha256=i9fkyZfHYLFEQGqdF98yWnucIES8HzMyh9OtBlxRooo,3115
|
318
318
|
nucliadb/writer/api/v1/resource.py,sha256=A8fAHlN5XFsg6XFYKhfWJS8czgNH6yXr-PsnUqz2WUE,18757
|
319
319
|
nucliadb/writer/api/v1/router.py,sha256=RjuoWLpZer6Kl2BW_wznpNo6XL3BOpdTGqXZCn3QrrQ,1034
|
320
320
|
nucliadb/writer/api/v1/services.py,sha256=THnBnRxiHrEZPpBTL-E-vplEUfcD-fZpuslKRonM6xs,10286
|
@@ -336,8 +336,8 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
|
|
336
336
|
nucliadb/writer/tus/s3.py,sha256=vF0NkFTXiXhXq3bCVXXVV-ED38ECVoUeeYViP8uMqcU,8357
|
337
337
|
nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
|
338
338
|
nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
|
339
|
-
nucliadb-6.2.1.
|
340
|
-
nucliadb-6.2.1.
|
341
|
-
nucliadb-6.2.1.
|
342
|
-
nucliadb-6.2.1.
|
343
|
-
nucliadb-6.2.1.
|
339
|
+
nucliadb-6.2.1.post3377.dist-info/METADATA,sha256=qkAN9pDnp84ZNF8ywzbwKqVjROHktWkM_KOYhfzzYK0,4291
|
340
|
+
nucliadb-6.2.1.post3377.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
341
|
+
nucliadb-6.2.1.post3377.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
|
342
|
+
nucliadb-6.2.1.post3377.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
|
343
|
+
nucliadb-6.2.1.post3377.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|