nucliadb 6.9.1.post5158__py3-none-any.whl → 6.9.1.post5161__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.

Potentially problematic release.


This version of nucliadb might be problematic. Click here for more details.

@@ -0,0 +1,79 @@
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
+
21
+ """Migration #40
22
+
23
+ Replaces deprecated and removed generative models from search configurations
24
+
25
+ """
26
+
27
+ import logging
28
+ from typing import cast
29
+
30
+ from nucliadb.common import datamanagers
31
+ from nucliadb.migrator.context import ExecutionContext
32
+ from nucliadb_models.configuration import SearchConfiguration
33
+ from nucliadb_models.search import AskRequest, FindRequest
34
+
35
+ logger = logging.getLogger(__name__)
36
+
37
+ REPLACEMENTS = {
38
+ "claude-3-5-small": "claude-4-5-sonnet",
39
+ "gcp-claude-3-5-sonnet-v2": "gcp-claude-4-5-sonnet",
40
+ }
41
+
42
+
43
+ async def migrate(context: ExecutionContext) -> None: ...
44
+
45
+
46
+ async def migrate_kb(context: ExecutionContext, kbid: str) -> None:
47
+ affected = await get_affected_search_configurations(kbid)
48
+ if not affected:
49
+ return
50
+
51
+ async with datamanagers.with_rw_transaction() as txn:
52
+ for name, config in affected.items():
53
+ logger.info(
54
+ "Migrating search config for kb",
55
+ extra={
56
+ "kbid": kbid,
57
+ "search_config": name,
58
+ "generative_model": config.config.generative_model, # type: ignore
59
+ },
60
+ )
61
+ config.config.generative_model = REPLACEMENTS[config.config.generative_model] # type: ignore
62
+ await datamanagers.search_configurations.set(txn, kbid=kbid, name=name, config=config)
63
+ await txn.commit()
64
+
65
+
66
+ async def get_affected_search_configurations(kbid: str) -> dict[str, SearchConfiguration]:
67
+ result: dict[str, SearchConfiguration] = {}
68
+ async with datamanagers.with_ro_transaction() as txn:
69
+ search_configs = await datamanagers.search_configurations.list(txn, kbid=kbid)
70
+ for name, config in search_configs.items():
71
+ if config.kind == "find":
72
+ find_config = cast(FindRequest, config.config)
73
+ if find_config.generative_model in REPLACEMENTS:
74
+ result[name] = config
75
+ elif config.kind == "ask":
76
+ ask_config = cast(AskRequest, config.config)
77
+ if ask_config.generative_model in REPLACEMENTS:
78
+ result[name] = config
79
+ return result
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nucliadb
3
- Version: 6.9.1.post5158
3
+ Version: 6.9.1.post5161
4
4
  Summary: NucliaDB
5
5
  Author-email: Nuclia <nucliadb@nuclia.com>
6
6
  License-Expression: AGPL-3.0-or-later
@@ -19,11 +19,11 @@ Classifier: Programming Language :: Python :: 3.12
19
19
  Classifier: Programming Language :: Python :: 3 :: Only
20
20
  Requires-Python: <4,>=3.9
21
21
  Description-Content-Type: text/markdown
22
- Requires-Dist: nucliadb-telemetry[all]>=6.9.1.post5158
23
- Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.9.1.post5158
24
- Requires-Dist: nucliadb-protos>=6.9.1.post5158
25
- Requires-Dist: nucliadb-models>=6.9.1.post5158
26
- Requires-Dist: nidx-protos>=6.9.1.post5158
22
+ Requires-Dist: nucliadb-telemetry[all]>=6.9.1.post5161
23
+ Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.9.1.post5161
24
+ Requires-Dist: nucliadb-protos>=6.9.1.post5161
25
+ Requires-Dist: nucliadb-models>=6.9.1.post5161
26
+ Requires-Dist: nidx-protos>=6.9.1.post5161
27
27
  Requires-Dist: nucliadb-admin-assets>=1.0.0.post1224
28
28
  Requires-Dist: nuclia-models>=0.50.0
29
29
  Requires-Dist: uvicorn[standard]
@@ -35,6 +35,7 @@ migrations/0036_backfill_catalog_slug.py,sha256=toYqxH_EfUFqoVn_cOdR5Fg8bWZU5BoF
35
35
  migrations/0037_backfill_catalog_facets.py,sha256=IH7H4OZ4tzws6xEh7Qro0bPDHDYOoVViEUj-JwPPe1U,2791
36
36
  migrations/0038_backfill_catalog_field_labels.py,sha256=F519nYngJDb1Mtwf-OQpweDPWKPxAlqdxy5E-DyQrhA,3492
37
37
  migrations/0039_backfill_converation_splits_metadata.py,sha256=NtL9S6Kx8mbSjNJLjIsc-6vVNymD0YKlF9vEkGUEDds,3958
38
+ migrations/0040_migrate_search_configurations.py,sha256=BWcg7F2QpGz-7AkqTDnKNSVcypWoV-dBiAUtmWzWBWk,2986
38
39
  migrations/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
39
40
  migrations/pg/0001_bootstrap.py,sha256=3O_P17l0d0h48nebN6VQLXzM_B7S7zvDpaLR0koVgWE,1274
40
41
  migrations/pg/0002_catalog.py,sha256=Rsleecu351Ty19kYZgOpqX5G3MEAY8nMxCJrAeuS2Mw,1690
@@ -384,8 +385,8 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
384
385
  nucliadb/writer/tus/s3.py,sha256=vu1BGg4VqJ_x2P1u2BxqPKlSfw5orT_a3R-Ln5oPUpU,8483
385
386
  nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
386
387
  nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
387
- nucliadb-6.9.1.post5158.dist-info/METADATA,sha256=RMDDJoDVxoEU6Jq-Q0dPXqSuFmmIaww9ij4yfE64kBs,4158
388
- nucliadb-6.9.1.post5158.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
389
- nucliadb-6.9.1.post5158.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
390
- nucliadb-6.9.1.post5158.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
391
- nucliadb-6.9.1.post5158.dist-info/RECORD,,
388
+ nucliadb-6.9.1.post5161.dist-info/METADATA,sha256=CIRTEtQ08tfmXxPtfbvgCePRvBVZYqe4QCJPiETMkaI,4158
389
+ nucliadb-6.9.1.post5161.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
390
+ nucliadb-6.9.1.post5161.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
391
+ nucliadb-6.9.1.post5161.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
392
+ nucliadb-6.9.1.post5161.dist-info/RECORD,,