nucliadb-agentic-api 1.0.0.post279__tar.gz → 1.0.0.post286__tar.gz
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_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/PKG-INFO +1 -1
- nucliadb_agentic_api-1.0.0.post286/VERSION +1 -0
- nucliadb_agentic_api-1.0.0.post286/alembic/versions/0fe6c7b5f33d_migrate_sonnet_and_gpt_5_6_models.py +35 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/pyproject.toml +1 -1
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/pyproject.toml.orig +1 -1
- nucliadb_agentic_api-1.0.0.post286/src/nucliadb_agentic_api/db/llm_migration_utils.py +64 -0
- nucliadb_agentic_api-1.0.0.post279/VERSION +0 -1
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/README.md +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/alembic/README +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/alembic/env.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/alembic/script.py.mako +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/alembic/versions/7f3b2f92a8c1_add_agentic_config_table.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/alembic/versions/b3c4d5e6f7a8_add_sources_table.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/alembic/versions/c4d5e6f7a8b9_add_agentic_config_soft_deletion.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/alembic.ini +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/VERSION +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/__init__.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/agentic/__init__.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/agentic/ask_handler.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/agentic/ask_result.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/agentic/ask_transform_to_interaction.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/app.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/commands.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/db/__init__.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/db/agentic_configs.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/db/settings.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/db/sources.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/db/transform.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/exceptions.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/logging.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/models.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/py.typed +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/server/__init__.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/server/server.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/server/session.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/server/settings.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/settings.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/utils.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/v1/__init__.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/v1/agentic_configs.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/v1/ask.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/v1/ask_websocket.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/v1/mcp_content.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/v1/mcp_nucliadb.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/v1/oauth.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/v1/router.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/v1/sources.py +0 -0
- {nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/src/nucliadb_agentic_api/v1/utils.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.0.0.post286
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"""migrate sonnet and gpt 5 6 models
|
|
2
|
+
|
|
3
|
+
Revision ID: 0fe6c7b5f33d
|
|
4
|
+
Revises: c4d5e6f7a8b9
|
|
5
|
+
Create Date: 2026-09-21 10:28:51.980835
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from typing import Sequence, Union
|
|
10
|
+
|
|
11
|
+
from alembic import op
|
|
12
|
+
from nucliadb_agentic_api.db.llm_migration_utils import migrate_llm_models
|
|
13
|
+
|
|
14
|
+
# revision identifiers, used by Alembic.
|
|
15
|
+
revision: str = "0fe6c7b5f33d"
|
|
16
|
+
down_revision: Union[str, Sequence[str], None] = "c4d5e6f7a8b9"
|
|
17
|
+
branch_labels: Union[str, Sequence[str], None] = None
|
|
18
|
+
depends_on: Union[str, Sequence[str], None] = None
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def upgrade() -> None:
|
|
22
|
+
migrate_llm_models(
|
|
23
|
+
op.get_bind(),
|
|
24
|
+
{
|
|
25
|
+
"claude-4-5-sonnet": "claude-5-sonnet",
|
|
26
|
+
"chatgpt-azure-4o": "chatgpt-azure-5.6-terra",
|
|
27
|
+
"chatgpt-azure-4o-mini": "chatgpt-azure-5.6-luna",
|
|
28
|
+
"chatgpt-azure-o3-mini": "chatgpt-azure-5.6-luna",
|
|
29
|
+
},
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def downgrade() -> None:
|
|
34
|
+
"""Downgrade schema."""
|
|
35
|
+
pass
|
{nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/pyproject.toml.orig
RENAMED
|
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "nucliadb_agentic_api"
|
|
7
|
-
version = "1.0.0.
|
|
7
|
+
version = "1.0.0.post286"
|
|
8
8
|
authors = [{ name = "AI Data Team", email = "learning@nuclia.com" }]
|
|
9
9
|
description = "NucliaDB Agentic API for Hyperforge"
|
|
10
10
|
readme = "README.md"
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
from sqlalchemy import text
|
|
5
|
+
from sqlalchemy.engine import Connection
|
|
6
|
+
|
|
7
|
+
AGENTIC_LLM_TABLES = [
|
|
8
|
+
("agentic_config_table", "config", ("account", "kbid", "agentic_id")),
|
|
9
|
+
("sources_table", "config", ("account", "kbid", "source_id")),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def walk_and_replace(obj: Any, replacements: dict[str, str]) -> bool:
|
|
14
|
+
"""Replace exact model IDs in recursively nested LLMConfig objects."""
|
|
15
|
+
modified = False
|
|
16
|
+
if isinstance(obj, dict):
|
|
17
|
+
model_id = obj.get("model_id")
|
|
18
|
+
if (
|
|
19
|
+
obj.get("_type") == "llm_config"
|
|
20
|
+
and isinstance(model_id, str)
|
|
21
|
+
and "/" not in model_id
|
|
22
|
+
and model_id in replacements
|
|
23
|
+
):
|
|
24
|
+
obj["model_id"] = replacements[model_id]
|
|
25
|
+
modified = True
|
|
26
|
+
|
|
27
|
+
for value in obj.values():
|
|
28
|
+
modified = walk_and_replace(value, replacements) or modified
|
|
29
|
+
elif isinstance(obj, list):
|
|
30
|
+
for value in obj:
|
|
31
|
+
modified = walk_and_replace(value, replacements) or modified
|
|
32
|
+
return modified
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def migrate_llm_models(conn: Connection, replacements: dict[str, str]) -> int:
|
|
36
|
+
"""Migrate LLMConfig model IDs in agentic and source JSONB configs."""
|
|
37
|
+
modified_rows = 0
|
|
38
|
+
for table, column, key_columns in AGENTIC_LLM_TABLES:
|
|
39
|
+
selected_columns = ", ".join((*key_columns, column))
|
|
40
|
+
rows = conn.execute(
|
|
41
|
+
text(
|
|
42
|
+
f"SELECT {selected_columns} FROM {table} "
|
|
43
|
+
f'WHERE {column}::text LIKE \'%"_type": "llm_config"%\''
|
|
44
|
+
)
|
|
45
|
+
).fetchall()
|
|
46
|
+
for row in rows:
|
|
47
|
+
config = row[-1]
|
|
48
|
+
if isinstance(config, str):
|
|
49
|
+
config = json.loads(config)
|
|
50
|
+
if config is None or not walk_and_replace(config, replacements):
|
|
51
|
+
continue
|
|
52
|
+
|
|
53
|
+
where = " AND ".join(f"{key} = :{key}" for key in key_columns)
|
|
54
|
+
params = dict(zip(key_columns, row[:-1], strict=True))
|
|
55
|
+
params["config"] = json.dumps(config)
|
|
56
|
+
conn.execute(
|
|
57
|
+
text(
|
|
58
|
+
f"UPDATE {table} SET {column} = CAST(:config AS jsonb) "
|
|
59
|
+
f"WHERE {where}"
|
|
60
|
+
),
|
|
61
|
+
params,
|
|
62
|
+
)
|
|
63
|
+
modified_rows += 1
|
|
64
|
+
return modified_rows
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.0.0.post279
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nucliadb_agentic_api-1.0.0.post279 → nucliadb_agentic_api-1.0.0.post286}/alembic/script.py.mako
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|