naas-abi-core 1.0.1__py3-none-any.whl → 1.0.3__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.
- naas_abi_core/apps/mcp/Dockerfile.mcp +35 -0
- naas_abi_core/module/Module.py +15 -8
- naas_abi_core/utils/Expose.py +4 -2
- {naas_abi_core-1.0.1.dist-info → naas_abi_core-1.0.3.dist-info}/METADATA +1 -1
- {naas_abi_core-1.0.1.dist-info → naas_abi_core-1.0.3.dist-info}/RECORD +7 -6
- {naas_abi_core-1.0.1.dist-info → naas_abi_core-1.0.3.dist-info}/WHEEL +0 -0
- {naas_abi_core-1.0.1.dist-info → naas_abi_core-1.0.3.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Production Dockerfile for ABI MCP Server
|
|
2
|
+
FROM python:3.13-slim
|
|
3
|
+
|
|
4
|
+
WORKDIR /app
|
|
5
|
+
|
|
6
|
+
# Install system dependencies
|
|
7
|
+
RUN apt-get update && apt-get install -y \
|
|
8
|
+
curl \
|
|
9
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# Copy application code
|
|
13
|
+
COPY libs/naas-abi-core/naas_abi_core/apps/mcp/mcp_server.py ./
|
|
14
|
+
# COPY lib/ ./lib/
|
|
15
|
+
# COPY src/ ./src/
|
|
16
|
+
COPY .env* ./
|
|
17
|
+
|
|
18
|
+
# Copy requirements and install Python dependencies
|
|
19
|
+
COPY README.md ./
|
|
20
|
+
# COPY pyproject.toml ./
|
|
21
|
+
RUN pip install fastmcp>=2.11.2 python-dotenv
|
|
22
|
+
|
|
23
|
+
# Set environment for production MCP deployment
|
|
24
|
+
ENV MCP_TRANSPORT=sse
|
|
25
|
+
ENV ABI_API_BASE=http://api:9879
|
|
26
|
+
|
|
27
|
+
# Expose the MCP HTTP server port
|
|
28
|
+
EXPOSE 8000
|
|
29
|
+
|
|
30
|
+
# Health check
|
|
31
|
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
32
|
+
CMD curl -f http://localhost:8000/ || exit 1
|
|
33
|
+
|
|
34
|
+
# Run the MCP server
|
|
35
|
+
CMD ["python", "mcp_server.py"]
|
naas_abi_core/module/Module.py
CHANGED
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import glob
|
|
4
4
|
import os
|
|
5
|
-
from typing import Dict, List
|
|
5
|
+
from typing import Dict, List, cast
|
|
6
6
|
|
|
7
7
|
from naas_abi_core import logger
|
|
8
8
|
from naas_abi_core.engine.engine_configuration.EngineConfiguration import GlobalConfig
|
|
@@ -13,6 +13,7 @@ from naas_abi_core.pipeline.pipeline import Pipeline
|
|
|
13
13
|
from naas_abi_core.services.agent.Agent import Agent
|
|
14
14
|
from naas_abi_core.workflow.workflow import Workflow
|
|
15
15
|
from pydantic import BaseModel, ConfigDict
|
|
16
|
+
from typing_extensions import Generic, Self, TypeVar
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
class ModuleDependencies:
|
|
@@ -46,13 +47,16 @@ class ModuleConfiguration(BaseModel):
|
|
|
46
47
|
global_config: GlobalConfig
|
|
47
48
|
|
|
48
49
|
|
|
49
|
-
|
|
50
|
+
TConfig = TypeVar("TConfig", bound=ModuleConfiguration)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class BaseModule(Generic[TConfig]):
|
|
50
54
|
"""Base interface class for ABI modules."""
|
|
51
55
|
|
|
52
|
-
_instances: Dict[type,
|
|
56
|
+
_instances: Dict[type, Self] = {}
|
|
53
57
|
|
|
54
58
|
_engine: EngineProxy
|
|
55
|
-
_configuration:
|
|
59
|
+
_configuration: TConfig
|
|
56
60
|
dependencies: ModuleDependencies = ModuleDependencies(modules=[], services=[])
|
|
57
61
|
|
|
58
62
|
__ontologies: List[str] = []
|
|
@@ -61,7 +65,7 @@ class BaseModule:
|
|
|
61
65
|
__workflows: List[Workflow] = []
|
|
62
66
|
__pipelines: List[Pipeline] = []
|
|
63
67
|
|
|
64
|
-
def __init__(self, engine: EngineProxy, configuration:
|
|
68
|
+
def __init__(self, engine: EngineProxy, configuration: TConfig):
|
|
65
69
|
assert isinstance(configuration, ModuleConfiguration), (
|
|
66
70
|
"configuration must be an instance of ModuleConfiguration"
|
|
67
71
|
)
|
|
@@ -76,7 +80,9 @@ class BaseModule:
|
|
|
76
80
|
"BaseModule.Configuration must be a subclass of ModuleConfiguration"
|
|
77
81
|
)
|
|
78
82
|
|
|
79
|
-
|
|
83
|
+
self_instance: Self = cast(Self, self)
|
|
84
|
+
|
|
85
|
+
self._instances[self.__class__] = self_instance
|
|
80
86
|
|
|
81
87
|
@classmethod
|
|
82
88
|
def get_dependencies(cls) -> List[str]:
|
|
@@ -84,7 +90,7 @@ class BaseModule:
|
|
|
84
90
|
return getattr(cls, "dependencies", [])
|
|
85
91
|
|
|
86
92
|
@classmethod
|
|
87
|
-
def get_instance(cls) ->
|
|
93
|
+
def get_instance(cls) -> Self:
|
|
88
94
|
if cls not in cls._instances:
|
|
89
95
|
raise ValueError(f"Module {cls} not initialized")
|
|
90
96
|
return cls._instances[cls]
|
|
@@ -94,7 +100,7 @@ class BaseModule:
|
|
|
94
100
|
return self._engine
|
|
95
101
|
|
|
96
102
|
@property
|
|
97
|
-
def configuration(self) ->
|
|
103
|
+
def configuration(self) -> TConfig:
|
|
98
104
|
return self._configuration
|
|
99
105
|
|
|
100
106
|
@property
|
|
@@ -243,3 +249,4 @@ class BaseModule:
|
|
|
243
249
|
# def on_initialized(self):
|
|
244
250
|
# if hasattr(self.imported_module, "on_initialized"):
|
|
245
251
|
# self.imported_module.on_initialized()
|
|
252
|
+
# self.imported_module.on_initialized()
|
naas_abi_core/utils/Expose.py
CHANGED
|
@@ -4,8 +4,9 @@ from abc import ABC, abstractmethod
|
|
|
4
4
|
from enum import Enum
|
|
5
5
|
from typing import TYPE_CHECKING
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
from fastapi import APIRouter
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
9
10
|
from langchain_core.tools import BaseTool
|
|
10
11
|
|
|
11
12
|
|
|
@@ -51,3 +52,4 @@ class Expose(ABC):
|
|
|
51
52
|
NotImplementedError: If the concrete class does not implement this method
|
|
52
53
|
"""
|
|
53
54
|
raise NotImplementedError()
|
|
55
|
+
raise NotImplementedError()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: naas-abi-core
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.3
|
|
4
4
|
Summary: Abi framework allowing you to build your AI system.
|
|
5
5
|
Author-email: Maxime Jublou <maxime@naas.ai>, Florent Ravenel <florent@naas.ai>, Jeremy Ravenel <jeremy@naas.ai>
|
|
6
6
|
Requires-Python: <4,>=3.10
|
|
@@ -2,6 +2,7 @@ naas_abi_core/__init__.py,sha256=kR93ywABUBo8-tAWCHMbRcCDCJZjqq4hWwxMk3Cr9fI,56
|
|
|
2
2
|
naas_abi_core/apps/api/api.py,sha256=CMast2FEo6S7WbXkeELaM4QHEv_-uDLVkieZcXGGolo,7027
|
|
3
3
|
naas_abi_core/apps/api/api_test.py,sha256=7H_VgnbsGqu6oGY-apAHjJr_yjIcGHY0heaEThWBsUk,10537
|
|
4
4
|
naas_abi_core/apps/api/openapi_doc.py,sha256=JbwzcmSP-Yl1rbN0QvUwOSmOFf-yKXECZ-2ptI7fWoU,11834
|
|
5
|
+
naas_abi_core/apps/mcp/Dockerfile.mcp,sha256=936qaoMFGbMvTARjzkNHMgRfGVWnolpVCrz0fBJYrLA,826
|
|
5
6
|
naas_abi_core/apps/mcp/mcp_server.py,sha256=U-wDl8rswMk4nefGg2SUByw4x8CM10M59FfLHxIKC-o,8391
|
|
6
7
|
naas_abi_core/apps/mcp/mcp_server_test.py,sha256=8jixnDyERM_HjjDTRtPDQcJ_rzA0ESAn147sl2Gk8gw,5636
|
|
7
8
|
naas_abi_core/apps/terminal_agent/main.py,sha256=ucrNCGjjixyiO47Eily1yAmrwznS6KOcB1kk02yt_m8,19631
|
|
@@ -36,7 +37,7 @@ naas_abi_core/integration/integration.py,sha256=tbdAV63Uisml9G8diZl20_JDlgJVFuLQ
|
|
|
36
37
|
naas_abi_core/models/Model.py,sha256=s1Aj8Mcy113uhgYR4-lSfoyLnucOzOlnxKu6QKSwfeY,8223
|
|
37
38
|
naas_abi_core/models/OpenRouter.py,sha256=6bvn_Dl4mQB1J-XTMoF1rD8F4FNszLAA0358fzJDBxs,485
|
|
38
39
|
naas_abi_core/models/OpenRouter_test.py,sha256=nLlVdBaBan0mkdbnF3vrWGJYr8zQAC7Fl3wLUc37Mvw,1168
|
|
39
|
-
naas_abi_core/module/Module.py,sha256=
|
|
40
|
+
naas_abi_core/module/Module.py,sha256=UGNXZkwgD0xv7HrxTHH9eRXYPv8kuxqfMGAHgfgQJlM,9096
|
|
40
41
|
naas_abi_core/module/ModuleAgentLoader.py,sha256=Tc2KYODt8cGeK__QLk7h0J5QZ0EM-ZsQZTDeCJ4ip38,1965
|
|
41
42
|
naas_abi_core/module/ModuleUtils.py,sha256=6wUHpbdl0y_16xvz7W-NSOaRyLW9N9zx2Lg_Jkg0eMM,707
|
|
42
43
|
naas_abi_core/modules/templatablesparqlquery/README.md,sha256=Cpz3FPMc1q-P5HmQ7848er5_MRTHLDLqYqq0nFrs7Dw,6991
|
|
@@ -98,7 +99,7 @@ naas_abi_core/services/vector_store/VectorStoreService_test.py,sha256=LKGdUJoayV
|
|
|
98
99
|
naas_abi_core/services/vector_store/__init__.py,sha256=tuRLebTOVhH5UF8JRke3rVTze1V3WK1DFT4k9ZYHqeA,407
|
|
99
100
|
naas_abi_core/services/vector_store/adapters/QdrantAdapter.py,sha256=rlgjwbPXxFU1sAiNX8_57ia-5svN3e5kAkE6p42kJRI,7981
|
|
100
101
|
naas_abi_core/services/vector_store/adapters/QdrantAdapter_test.py,sha256=JyKNfx-e4M7VybWViWrGWG8KiAnBa0oOwT-W_Yg23Uw,1891
|
|
101
|
-
naas_abi_core/utils/Expose.py,sha256=
|
|
102
|
+
naas_abi_core/utils/Expose.py,sha256=ycxiz2tOXkRco_fiNM281e85RWHWi2xUT82PEE_Hdjk,1746
|
|
102
103
|
naas_abi_core/utils/Graph.py,sha256=FoBuiTrcLw4dzhROnd7JHp-LMxMuwJISFbtdrwpoM24,6288
|
|
103
104
|
naas_abi_core/utils/JSON.py,sha256=onIs-E3GWz4fvRuWBQpyb9qRNXCOJPf9x1yV1-jDlqU,1687
|
|
104
105
|
naas_abi_core/utils/LazyLoader.py,sha256=rWrnFVuKCK1WrtNgeiegT_i7AkxGy9qK2hfhsXV4dCY,1120
|
|
@@ -118,7 +119,7 @@ naas_abi_core/utils/onto2py/onto2py.py,sha256=_wn9qrrsWd8gO-BY4_jQJVfY87e9MJ2Er2
|
|
|
118
119
|
naas_abi_core/utils/onto2py/tests/ttl2py_test.py,sha256=5OZqSxPffjJYiX9T4rT1mV0PT1Qhf6goqEYT_mAPnaI,8055
|
|
119
120
|
naas_abi_core/workflow/__init__.py,sha256=hZD58mCB1PApxITqftP_xgjxL7NeLvOfI-rJENg1ENs,250
|
|
120
121
|
naas_abi_core/workflow/workflow.py,sha256=ZufSS073JztVl0OQRTqNyK7FepFvv7gXlc4j5FAEZCI,1216
|
|
121
|
-
naas_abi_core-1.0.
|
|
122
|
-
naas_abi_core-1.0.
|
|
123
|
-
naas_abi_core-1.0.
|
|
124
|
-
naas_abi_core-1.0.
|
|
122
|
+
naas_abi_core-1.0.3.dist-info/METADATA,sha256=hEUFnGbiGe5bEW4UuDH70It81jn7udcWYO_IeAX6wxw,3192
|
|
123
|
+
naas_abi_core-1.0.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
124
|
+
naas_abi_core-1.0.3.dist-info/entry_points.txt,sha256=R6N3E2Hh92nTrji34JIwBgc6c-wVpfBYBTwkU0xe64E,79
|
|
125
|
+
naas_abi_core-1.0.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|