naas-abi-core 1.1.2__tar.gz → 1.2.0__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.
- naas_abi_core-1.2.0/=0.9.13 +6 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/CHANGELOG.md +27 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/PKG-INFO +1 -1
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/engine/engine_configuration/EngineConfiguration.py +37 -4
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/engine/engine_configuration/EngineConfiguration_TripleStoreService.py +48 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/models/OpenRouter.py +5 -2
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/module/ModuleAgentLoader.py +1 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/agent/IntentAgent.py +9 -1
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/agent/beta/Embeddings.py +3 -2
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/agent/beta/IntentMapper.py +4 -3
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/secret/adaptors/secondary/dotenv_secret_secondaryadaptor.py +4 -1
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/utils/Logger.py +1 -1
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/pyproject.toml +1 -2
- naas_abi_core-1.1.2/=0.9.13 +0 -6
- naas_abi_core-1.1.2/naas_abi_core/cli/__init__.py +0 -54
- naas_abi_core-1.1.2/naas_abi_core/cli/agent.py +0 -30
- naas_abi_core-1.1.2/naas_abi_core/cli/chat.py +0 -26
- naas_abi_core-1.1.2/naas_abi_core/cli/config.py +0 -49
- naas_abi_core-1.1.2/naas_abi_core/cli/deploy.py +0 -198
- naas_abi_core-1.1.2/naas_abi_core/cli/init.py +0 -13
- naas_abi_core-1.1.2/naas_abi_core/cli/module.py +0 -28
- naas_abi_core-1.1.2/naas_abi_core/cli/new.py +0 -13
- naas_abi_core-1.1.2/naas_abi_core/cli/secret.py +0 -79
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/.gitignore +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/README.md +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/assets/favicon.ico +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/__init__.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/apps/api/api.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/apps/api/api_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/apps/api/openapi_doc.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/apps/mcp/Dockerfile.mcp +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/apps/mcp/mcp_server.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/apps/mcp/mcp_server_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/apps/terminal_agent/main.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/apps/terminal_agent/terminal_style.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/engine/Engine.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/engine/EngineProxy.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/engine/Engine_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/engine/IEngine.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/engine/conftest.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/engine/engine_configuration/EngineConfiguration_Deploy.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/engine/engine_configuration/EngineConfiguration_GenericLoader.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/engine/engine_configuration/EngineConfiguration_ObjectStorageService.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/engine/engine_configuration/EngineConfiguration_ObjectStorageService_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/engine/engine_configuration/EngineConfiguration_SecretService.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/engine/engine_configuration/EngineConfiguration_VectorStoreService.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/engine/engine_configuration/EngineConfiguration_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/engine/engine_configuration/utils/PydanticModelValidator.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/engine/engine_loaders/EngineModuleLoader.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/engine/engine_loaders/EngineOntologyLoader.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/engine/engine_loaders/EngineServiceLoader.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/integration/__init__.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/integration/integration.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/models/Model.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/models/OpenRouter_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/module/Module.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/module/ModuleUtils.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/modules/templatablesparqlquery/README.md +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/modules/templatablesparqlquery/__init__.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/modules/templatablesparqlquery/ontologies/TemplatableSparqlQueryOntology.ttl +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/modules/templatablesparqlquery/workflows/GenericWorkflow.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/modules/templatablesparqlquery/workflows/TemplatableSparqlQueryLoader.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/pipeline/__init__.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/pipeline/pipeline.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/__init__.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/agent/Agent.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/agent/AgentMemory_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/agent/Agent_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/agent/IntentAgent_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/agent/beta/LocalModel.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/agent/beta/VectorStore.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/agent/test_agent_memory.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/agent/test_postgres_integration.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/cache/CacheFactory.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/cache/CachePort.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/cache/CacheService.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/cache/CacheService_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/cache/adapters/secondary/CacheFSAdapter.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/object_storage/ObjectStorageFactory.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/object_storage/ObjectStoragePort.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/object_storage/ObjectStorageService.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/object_storage/adapters/secondary/ObjectStorageSecondaryAdapterFS.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/object_storage/adapters/secondary/ObjectStorageSecondaryAdapterNaas.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/object_storage/adapters/secondary/ObjectStorageSecondaryAdapterS3.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/ontology/OntologyPorts.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/ontology/OntologyService.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/ontology/adaptors/secondary/OntologyService_SecondaryAdaptor_NERPort.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/secret/Secret.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/secret/SecretPorts.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/secret/Secret_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/secret/adaptors/secondary/Base64Secret.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/secret/adaptors/secondary/Base64Secret_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/secret/adaptors/secondary/NaasSecret.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/secret/adaptors/secondary/NaasSecret_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/triple_store/TripleStoreFactory.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/triple_store/TripleStorePorts.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/triple_store/TripleStoreService.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/triple_store/adaptors/secondary/AWSNeptune.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/triple_store/adaptors/secondary/AWSNeptune_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/triple_store/adaptors/secondary/Oxigraph.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/triple_store/adaptors/secondary/Oxigraph_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/triple_store/adaptors/secondary/TripleStoreService__SecondaryAdaptor__Filesystem.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/triple_store/adaptors/secondary/TripleStoreService__SecondaryAdaptor__ObjectStorage.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/triple_store/adaptors/secondary/base/TripleStoreService__SecondaryAdaptor__FileBase.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/vector_store/IVectorStorePort.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/vector_store/IVectorStorePort_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/vector_store/VectorStoreFactory.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/vector_store/VectorStoreService.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/vector_store/VectorStoreService_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/vector_store/__init__.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/vector_store/adapters/QdrantAdapter.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/vector_store/adapters/QdrantAdapter_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/tests/test_services_imports.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/utils/Expose.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/utils/Graph.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/utils/JSON.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/utils/LazyLoader.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/utils/OntologyReasoner.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/utils/OntologyYaml.disabled.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/utils/SPARQL.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/utils/Storage.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/utils/StorageUtils.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/utils/String.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/utils/Workers.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/utils/__init__.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/utils/onto2py/README.md +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/utils/onto2py/__init__.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/utils/onto2py/__main__.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/utils/onto2py/onto2py.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/utils/onto2py/tests/ttl2py_test.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/workflow/__init__.py +0 -0
- {naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/workflow/workflow.py +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Collecting uv
|
|
2
|
+
Downloading uv-0.9.18-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)
|
|
3
|
+
Downloading uv-0.9.18-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (22.2 MB)
|
|
4
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 22.2/22.2 MB 185.4 MB/s 0:00:00
|
|
5
|
+
Installing collected packages: uv
|
|
6
|
+
Successfully installed uv-0.9.18
|
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- version list -->
|
|
4
4
|
|
|
5
|
+
## v1.2.0 (2025-12-19)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- Inject naas_abi_core.modules.templatablesparqlquery by default
|
|
10
|
+
([`b6dc785`](https://github.com/jupyter-naas/abi/commit/b6dc78519e71afb46dd2ffc401539fab19fb865f))
|
|
11
|
+
|
|
12
|
+
- Review
|
|
13
|
+
([`6301a5f`](https://github.com/jupyter-naas/abi/commit/6301a5fcda63875b2748a625727903f236772966))
|
|
14
|
+
|
|
15
|
+
- Review
|
|
16
|
+
([`1ad319b`](https://github.com/jupyter-naas/abi/commit/1ad319ba2e47463ab84cabf7edbd2b721b053e3b))
|
|
17
|
+
|
|
18
|
+
### Chores
|
|
19
|
+
|
|
20
|
+
- Remove comments
|
|
21
|
+
([`05868ff`](https://github.com/jupyter-naas/abi/commit/05868ff0c60ccb3e7da46cdd8903d207622d5e8c))
|
|
22
|
+
|
|
23
|
+
- Remove duplicate logger
|
|
24
|
+
([`8438450`](https://github.com/jupyter-naas/abi/commit/84384505a88b9645e56628b39bfda8da054792cc))
|
|
25
|
+
|
|
26
|
+
### Features
|
|
27
|
+
|
|
28
|
+
- Workin on naas-abi-cli
|
|
29
|
+
([`16cd62d`](https://github.com/jupyter-naas/abi/commit/16cd62d77879d94c83fae9218bd451c1909554e4))
|
|
30
|
+
|
|
31
|
+
|
|
5
32
|
## v1.1.2 (2025-12-05)
|
|
6
33
|
|
|
7
34
|
### Bug Fixes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: naas-abi-core
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
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
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import os
|
|
2
|
+
import sys
|
|
2
3
|
from io import StringIO
|
|
3
4
|
from typing import List
|
|
4
5
|
|
|
5
6
|
import yaml
|
|
6
7
|
from jinja2 import Template
|
|
7
8
|
from naas_abi_core import logger
|
|
9
|
+
from naas_abi_core.engine.engine_configuration.EngineConfiguration_Deploy import (
|
|
10
|
+
DeployConfiguration,
|
|
11
|
+
)
|
|
8
12
|
from naas_abi_core.engine.engine_configuration.EngineConfiguration_ObjectStorageService import (
|
|
9
13
|
ObjectStorageServiceConfiguration,
|
|
10
14
|
)
|
|
@@ -19,8 +23,9 @@ from naas_abi_core.engine.engine_configuration.EngineConfiguration_VectorStoreSe
|
|
|
19
23
|
)
|
|
20
24
|
from naas_abi_core.services.secret.Secret import Secret
|
|
21
25
|
from pydantic import BaseModel, model_validator
|
|
22
|
-
from
|
|
23
|
-
from
|
|
26
|
+
from rich.prompt import Prompt
|
|
27
|
+
from typing_extensions import Literal, Self
|
|
28
|
+
|
|
24
29
|
|
|
25
30
|
class ServicesConfiguration(BaseModel):
|
|
26
31
|
object_storage: ObjectStorageServiceConfiguration
|
|
@@ -80,7 +85,7 @@ class GlobalConfig(BaseModel):
|
|
|
80
85
|
|
|
81
86
|
class EngineConfiguration(BaseModel):
|
|
82
87
|
api: ApiConfiguration
|
|
83
|
-
|
|
88
|
+
|
|
84
89
|
deploy: DeployConfiguration | None = None
|
|
85
90
|
|
|
86
91
|
services: ServicesConfiguration
|
|
@@ -89,6 +94,25 @@ class EngineConfiguration(BaseModel):
|
|
|
89
94
|
|
|
90
95
|
modules: List[ModuleConfig]
|
|
91
96
|
|
|
97
|
+
def ensure_default_modules(self) -> None:
|
|
98
|
+
if not any(
|
|
99
|
+
m.path == "naas_abi_core.modules.templatablesparqlquery"
|
|
100
|
+
or m.module == "naas_abi_core.modules.templatablesparqlquery"
|
|
101
|
+
for m in self.modules
|
|
102
|
+
):
|
|
103
|
+
self.modules.append(
|
|
104
|
+
ModuleConfig(
|
|
105
|
+
module="naas_abi_core.modules.templatablesparqlquery",
|
|
106
|
+
enabled=True,
|
|
107
|
+
config={},
|
|
108
|
+
)
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
@model_validator(mode="after")
|
|
112
|
+
def validate_modules(self) -> Self:
|
|
113
|
+
self.ensure_default_modules()
|
|
114
|
+
return self
|
|
115
|
+
|
|
92
116
|
@classmethod
|
|
93
117
|
def from_yaml(cls, yaml_path: str) -> "EngineConfiguration":
|
|
94
118
|
with open(yaml_path, "r") as file:
|
|
@@ -108,7 +132,16 @@ class EngineConfiguration(BaseModel):
|
|
|
108
132
|
return 0
|
|
109
133
|
secret = self.secret_service.get(name)
|
|
110
134
|
if secret is None:
|
|
111
|
-
|
|
135
|
+
if not sys.stdin.isatty():
|
|
136
|
+
raise ValueError(
|
|
137
|
+
f"Secret '{name}' not found and no TTY available to prompt. Please provide it via the configured secret service or environment."
|
|
138
|
+
)
|
|
139
|
+
value = Prompt.ask(
|
|
140
|
+
f"[bold yellow]Secret '{name}' not found.[/bold yellow] Please enter the value for [cyan]{name}[/cyan]",
|
|
141
|
+
password=False,
|
|
142
|
+
)
|
|
143
|
+
self.secret_service.set(name, value)
|
|
144
|
+
return value
|
|
112
145
|
return secret
|
|
113
146
|
|
|
114
147
|
def get(self, key, default=None):
|
|
@@ -20,11 +20,29 @@ if TYPE_CHECKING:
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class OxigraphAdapterConfiguration(BaseModel):
|
|
23
|
+
"""Oxigraph adapter configuration.
|
|
24
|
+
|
|
25
|
+
triple_store_adapter:
|
|
26
|
+
adapter: "oxigraph"
|
|
27
|
+
config:
|
|
28
|
+
oxigraph_url: "http://localhost:7878"
|
|
29
|
+
timeout: 60
|
|
30
|
+
"""
|
|
23
31
|
oxigraph_url: str = "http://localhost:7878"
|
|
24
32
|
timeout: int = 60
|
|
25
33
|
|
|
26
34
|
|
|
27
35
|
class AWSNeptuneAdapterConfiguration(BaseModel):
|
|
36
|
+
"""AWS Neptune adapter configuration.
|
|
37
|
+
|
|
38
|
+
triple_store_adapter:
|
|
39
|
+
adapter: "aws_neptune"
|
|
40
|
+
config:
|
|
41
|
+
aws_region_name: "eu-west-3"
|
|
42
|
+
aws_access_key_id: "{{ secret.AWS_ACCESS_KEY_ID }}"
|
|
43
|
+
aws_secret_access_key: "{{ secret.AWS_SECRET_ACCESS_KEY }}"
|
|
44
|
+
db_instance_identifier: "{{ secret.DB_INSTANCE_IDENTIFIER }}"
|
|
45
|
+
"""
|
|
28
46
|
aws_region_name: str
|
|
29
47
|
aws_access_key_id: str
|
|
30
48
|
aws_secret_access_key: str
|
|
@@ -32,6 +50,20 @@ class AWSNeptuneAdapterConfiguration(BaseModel):
|
|
|
32
50
|
|
|
33
51
|
|
|
34
52
|
class AWSNeptuneSSHTunnelAdapterConfiguration(AWSNeptuneAdapterConfiguration):
|
|
53
|
+
"""AWS Neptune SSH tunnel adapter configuration.
|
|
54
|
+
|
|
55
|
+
triple_store_adapter:
|
|
56
|
+
adapter: "aws_neptune_sshtunnel"
|
|
57
|
+
config:
|
|
58
|
+
aws_region_name: "eu-west-3"
|
|
59
|
+
aws_access_key_id: "{{ secret.AWS_ACCESS_KEY_ID }}"
|
|
60
|
+
aws_secret_access_key: "{{ secret.AWS_SECRET_ACCESS_KEY }}"
|
|
61
|
+
db_instance_identifier: "{{ secret.DB_INSTANCE_IDENTIFIER }}"
|
|
62
|
+
bastion_host: "bastion.example.com"
|
|
63
|
+
bastion_port: 22
|
|
64
|
+
bastion_user: "ubuntu"
|
|
65
|
+
bastion_private_key: "{{ secret.BASTION_PRIVATE_KEY }}"
|
|
66
|
+
"""
|
|
35
67
|
bastion_host: str
|
|
36
68
|
bastion_port: int
|
|
37
69
|
bastion_user: str
|
|
@@ -39,11 +71,27 @@ class AWSNeptuneSSHTunnelAdapterConfiguration(AWSNeptuneAdapterConfiguration):
|
|
|
39
71
|
|
|
40
72
|
|
|
41
73
|
class TripleStoreAdapterFilesystemConfiguration(BaseModel):
|
|
74
|
+
"""Filesystem adapter configuration.
|
|
75
|
+
|
|
76
|
+
triple_store_adapter:
|
|
77
|
+
adapter: "fs"
|
|
78
|
+
config:
|
|
79
|
+
store_path: "storage/triplestore"
|
|
80
|
+
triples_path: "triples"
|
|
81
|
+
"""
|
|
42
82
|
store_path: str
|
|
43
83
|
triples_path: str = "triples"
|
|
44
84
|
|
|
45
85
|
|
|
46
86
|
class TripleStoreAdapterObjectStorageConfiguration(BaseModel):
|
|
87
|
+
"""Object storage adapter configuration.
|
|
88
|
+
|
|
89
|
+
triple_store_adapter:
|
|
90
|
+
adapter: "object_storage"
|
|
91
|
+
config:
|
|
92
|
+
object_storage_service: *object_storage_service
|
|
93
|
+
triples_prefix: "triples"
|
|
94
|
+
"""
|
|
47
95
|
object_storage_service: ObjectStorageServiceConfiguration
|
|
48
96
|
triples_prefix: str = "triples"
|
|
49
97
|
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import os
|
|
2
|
+
|
|
3
|
+
# from dotenv import load_dotenv
|
|
2
4
|
from langchain_openai import ChatOpenAI # using the OpenAI LLM class as wrapper
|
|
3
5
|
from pydantic import SecretStr
|
|
4
|
-
|
|
5
|
-
load_dotenv()
|
|
6
|
+
|
|
7
|
+
# load_dotenv()
|
|
8
|
+
|
|
6
9
|
|
|
7
10
|
class ChatOpenRouter(ChatOpenAI):
|
|
8
11
|
def __init__(self, model_name: str, **kwargs):
|
|
@@ -23,6 +23,7 @@ class ModuleAgentLoader:
|
|
|
23
23
|
agent_module_path = (
|
|
24
24
|
f"{class_.__module__}.agents.{file.replace('.py', '')}"
|
|
25
25
|
)
|
|
26
|
+
logger.debug(f"Importing agent module from {agent_module_path}")
|
|
26
27
|
agent_module = importlib.import_module(agent_module_path)
|
|
27
28
|
for key, value in agent_module.__dict__.items():
|
|
28
29
|
if (
|
|
@@ -13,6 +13,7 @@ from langgraph.graph.message import MessagesState
|
|
|
13
13
|
from langgraph.types import Command
|
|
14
14
|
from naas_abi_core import logger
|
|
15
15
|
from naas_abi_core.models.Model import ChatModel
|
|
16
|
+
from spacy.cli import download as spacy_download
|
|
16
17
|
|
|
17
18
|
from .Agent import Agent, AgentConfiguration, AgentSharedState, create_checkpointer
|
|
18
19
|
from .beta.IntentMapper import Intent, IntentMapper, IntentScope, IntentType
|
|
@@ -23,7 +24,14 @@ _nlp = None
|
|
|
23
24
|
def get_nlp():
|
|
24
25
|
global _nlp
|
|
25
26
|
if _nlp is None:
|
|
26
|
-
|
|
27
|
+
try:
|
|
28
|
+
_nlp = spacy.load("en_core_web_sm")
|
|
29
|
+
except OSError:
|
|
30
|
+
logger.warning(
|
|
31
|
+
"Downloading spacy model en_core_web_sm as it is not installed. This is a one time operation and can take a few seconds to complete based on your internet connection speed."
|
|
32
|
+
)
|
|
33
|
+
spacy_download("en_core_web_sm")
|
|
34
|
+
_nlp = spacy.load("en_core_web_sm")
|
|
27
35
|
return _nlp
|
|
28
36
|
|
|
29
37
|
|
|
@@ -2,13 +2,14 @@ import hashlib
|
|
|
2
2
|
import os
|
|
3
3
|
|
|
4
4
|
import requests
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
# from dotenv import load_dotenv
|
|
6
7
|
from naas_abi_core.services.cache.CacheFactory import CacheFactory
|
|
7
8
|
from naas_abi_core.services.cache.CachePort import DataType
|
|
8
9
|
from pydantic import SecretStr
|
|
9
10
|
from tqdm import tqdm
|
|
10
11
|
|
|
11
|
-
load_dotenv()
|
|
12
|
+
# load_dotenv()
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
cache = CacheFactory.CacheFS_find_storage(subpath="intent_mapping")
|
{naas_abi_core-1.1.2 → naas_abi_core-1.2.0}/naas_abi_core/services/agent/beta/IntentMapper.py
RENAMED
|
@@ -3,16 +3,17 @@ from dataclasses import dataclass
|
|
|
3
3
|
from enum import Enum
|
|
4
4
|
from typing import Any, Optional, Tuple
|
|
5
5
|
|
|
6
|
-
from dotenv import load_dotenv
|
|
6
|
+
# from dotenv import load_dotenv
|
|
7
7
|
from langchain_openai import ChatOpenAI
|
|
8
8
|
from pydantic import SecretStr
|
|
9
9
|
|
|
10
|
-
from .Embeddings import EMBEDDINGS_MODELS_DIMENSIONS_MAP
|
|
10
|
+
from .Embeddings import EMBEDDINGS_MODELS_DIMENSIONS_MAP
|
|
11
11
|
from .Embeddings import _model_name as embeddings_model_name
|
|
12
12
|
from .Embeddings import embeddings as embeddings
|
|
13
|
+
from .Embeddings import embeddings_batch
|
|
13
14
|
from .VectorStore import VectorStore
|
|
14
15
|
|
|
15
|
-
load_dotenv()
|
|
16
|
+
# load_dotenv()
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
class IntentScope(Enum):
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import os
|
|
2
2
|
from typing import Any, Dict
|
|
3
3
|
|
|
4
|
-
from dotenv import dotenv_values, set_key
|
|
4
|
+
from dotenv import dotenv_values, find_dotenv, set_key
|
|
5
5
|
from naas_abi_core.services.secret.SecretPorts import ISecretAdapter
|
|
6
|
+
from naas_abi_core.utils.Logger import logger
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
class DotenvSecretSecondaryAdaptor(ISecretAdapter):
|
|
9
10
|
def __init__(self):
|
|
11
|
+
logger.debug(f"dotenv is using the file: {find_dotenv()}")
|
|
12
|
+
|
|
10
13
|
self.secrets = dotenv_values()
|
|
11
14
|
|
|
12
15
|
def get(self, key: str, default: Any = None) -> str:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "naas-abi-core"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.2.0"
|
|
4
4
|
description = "Abi framework allowing you to build your AI system."
|
|
5
5
|
authors = [{ name = "Maxime Jublou", email = "maxime@naas.ai" },{ name = "Florent Ravenel", email = "florent@naas.ai" }, { name = "Jeremy Ravenel", email = "jeremy@naas.ai" }]
|
|
6
6
|
requires-python = ">=3.10,<4"
|
|
@@ -56,7 +56,6 @@ openrouter = [
|
|
|
56
56
|
"langchain-openai>=0.3.35",
|
|
57
57
|
]
|
|
58
58
|
[project.scripts]
|
|
59
|
-
abi = "naas_abi_core.cli:main"
|
|
60
59
|
onto2py = "naas_abi_core.utils.onto2py.__main__:main"
|
|
61
60
|
|
|
62
61
|
[build-system]
|
naas_abi_core-1.1.2/=0.9.13
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
Collecting uv
|
|
2
|
-
Downloading uv-0.9.15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)
|
|
3
|
-
Downloading uv-0.9.15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.7 MB)
|
|
4
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 21.7/21.7 MB 263.5 MB/s 0:00:00
|
|
5
|
-
Installing collected packages: uv
|
|
6
|
-
Successfully installed uv-0.9.15
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import click
|
|
2
|
-
|
|
3
|
-
from .agent import agent
|
|
4
|
-
from .chat import chat
|
|
5
|
-
from .config import config
|
|
6
|
-
from .init import init
|
|
7
|
-
from .module import module
|
|
8
|
-
from .new import new
|
|
9
|
-
from .secret import secrets
|
|
10
|
-
from .deploy import deploy
|
|
11
|
-
# from dotenv import load_dotenv
|
|
12
|
-
|
|
13
|
-
# load_dotenv()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@click.group("abi")
|
|
17
|
-
def main():
|
|
18
|
-
pass
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
# @main.command("chat")
|
|
22
|
-
# @click.option("--module-name", type=str, required=True, default="chatgpt")
|
|
23
|
-
# @click.option("--agent-name", type=str, required=True, default="ChatGPTAgent")
|
|
24
|
-
# def chat(module_name: str, agent_name: str):
|
|
25
|
-
# from naas_abi_core.engine.Engine import Engine
|
|
26
|
-
|
|
27
|
-
# engine = Engine()
|
|
28
|
-
# engine.load(module_names=[module_name])
|
|
29
|
-
|
|
30
|
-
# from naas_abi_core.apps.terminal_agent.main import run_agent
|
|
31
|
-
|
|
32
|
-
# logger.debug(f"Module agents: {engine.modules[module_name].agents}")
|
|
33
|
-
|
|
34
|
-
# for agent_class in engine.modules[module_name].agents:
|
|
35
|
-
# logger.debug(f"Agent class: {agent_class.__name__}")
|
|
36
|
-
# if agent_class.__name__ == agent_name:
|
|
37
|
-
# run_agent(agent_class.New())
|
|
38
|
-
# break
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
# Add the secrets group to the main abi group
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
main.add_command(secrets)
|
|
45
|
-
main.add_command(config)
|
|
46
|
-
main.add_command(module)
|
|
47
|
-
main.add_command(agent)
|
|
48
|
-
main.add_command(chat)
|
|
49
|
-
main.add_command(new)
|
|
50
|
-
main.add_command(init)
|
|
51
|
-
main.add_command(deploy)
|
|
52
|
-
|
|
53
|
-
# if __name__ == "__main__":
|
|
54
|
-
main()
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import click
|
|
2
|
-
from rich.console import Console
|
|
3
|
-
from rich.table import Table
|
|
4
|
-
|
|
5
|
-
from naas_abi_core.engine.Engine import Engine
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@click.group("agent")
|
|
9
|
-
def agent():
|
|
10
|
-
pass
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
@agent.command("list")
|
|
14
|
-
def list():
|
|
15
|
-
engine = Engine()
|
|
16
|
-
engine.load()
|
|
17
|
-
|
|
18
|
-
console = Console()
|
|
19
|
-
table = Table(
|
|
20
|
-
title="Available Agents", show_header=True, header_style="bold magenta"
|
|
21
|
-
)
|
|
22
|
-
table.add_column("Module", style="cyan", no_wrap=True)
|
|
23
|
-
table.add_column("Agent", style="green")
|
|
24
|
-
|
|
25
|
-
modules = engine.modules
|
|
26
|
-
for module in modules:
|
|
27
|
-
for agent in modules[module].agents:
|
|
28
|
-
table.add_row(module, agent.__name__)
|
|
29
|
-
|
|
30
|
-
console.print(table)
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import click
|
|
2
|
-
|
|
3
|
-
from naas_abi_core import logger
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@click.command("chat")
|
|
7
|
-
@click.argument("module-name", type=str, required=True, default="naas_abi")
|
|
8
|
-
@click.argument("agent-name", type=str, required=True, default="AbiAgent")
|
|
9
|
-
def chat(module_name: str, agent_name: str):
|
|
10
|
-
from naas_abi_core.engine.Engine import Engine
|
|
11
|
-
|
|
12
|
-
engine = Engine()
|
|
13
|
-
engine.load(module_names=[module_name])
|
|
14
|
-
|
|
15
|
-
from naas_abi_core.apps.terminal_agent.main import run_agent
|
|
16
|
-
|
|
17
|
-
if module_name not in engine.modules:
|
|
18
|
-
raise ValueError(f"Module {module_name} not found")
|
|
19
|
-
|
|
20
|
-
logger.debug(f"Module agents: {engine.modules[module_name].agents}")
|
|
21
|
-
|
|
22
|
-
for agent_class in engine.modules[module_name].agents:
|
|
23
|
-
logger.debug(f"Agent class: {agent_class.__name__}")
|
|
24
|
-
if agent_class.__name__ == agent_name:
|
|
25
|
-
run_agent(agent_class.New())
|
|
26
|
-
break
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
|
|
3
|
-
import click
|
|
4
|
-
import yaml
|
|
5
|
-
|
|
6
|
-
from naas_abi_core.engine.engine_configuration.EngineConfiguration import (
|
|
7
|
-
EngineConfiguration,
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@click.group("config")
|
|
12
|
-
def config():
|
|
13
|
-
pass
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@config.command("validate")
|
|
17
|
-
@click.option("--configuration-file", type=str, required=False, default=None)
|
|
18
|
-
def validate(configuration_file: str | None):
|
|
19
|
-
configuration_content: str | None = None
|
|
20
|
-
|
|
21
|
-
if configuration_file is not None:
|
|
22
|
-
if not os.path.exists(configuration_file):
|
|
23
|
-
raise FileNotFoundError(
|
|
24
|
-
f"Configuration file {configuration_file} not found"
|
|
25
|
-
)
|
|
26
|
-
with open(configuration_file, "r") as file:
|
|
27
|
-
configuration_content = file.read()
|
|
28
|
-
|
|
29
|
-
EngineConfiguration.load_configuration(configuration_content)
|
|
30
|
-
print("Configuration is valid")
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
@config.command("render")
|
|
34
|
-
@click.option("--configuration-file", type=str, required=False, default=None)
|
|
35
|
-
def render(configuration_file: str | None):
|
|
36
|
-
configuration_content: str | None = None
|
|
37
|
-
|
|
38
|
-
if configuration_file is not None:
|
|
39
|
-
if not os.path.exists(configuration_file):
|
|
40
|
-
raise FileNotFoundError(
|
|
41
|
-
f"Configuration file {configuration_file} not found"
|
|
42
|
-
)
|
|
43
|
-
with open(configuration_file, "r") as file:
|
|
44
|
-
configuration_content = file.read()
|
|
45
|
-
|
|
46
|
-
configuration: EngineConfiguration = EngineConfiguration.load_configuration(
|
|
47
|
-
configuration_content
|
|
48
|
-
)
|
|
49
|
-
print(yaml.dump(configuration.model_dump(), indent=2))
|