naas-abi-core 1.7.0__py3-none-any.whl → 1.7.2__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/engine/engine_loaders/EngineOntologyLoader.py +3 -1
- naas_abi_core/modules/templatablesparqlquery/__init__.py +7 -10
- naas_abi_core/services/agent/Agent.py +16 -5
- {naas_abi_core-1.7.0.dist-info → naas_abi_core-1.7.2.dist-info}/METADATA +1 -1
- {naas_abi_core-1.7.0.dist-info → naas_abi_core-1.7.2.dist-info}/RECORD +7 -7
- {naas_abi_core-1.7.0.dist-info → naas_abi_core-1.7.2.dist-info}/WHEEL +0 -0
- {naas_abi_core-1.7.0.dist-info → naas_abi_core-1.7.2.dist-info}/entry_points.txt +0 -0
|
@@ -2,7 +2,8 @@ from typing import List
|
|
|
2
2
|
|
|
3
3
|
from naas_abi_core import logger
|
|
4
4
|
from naas_abi_core.module.Module import BaseModule
|
|
5
|
-
from naas_abi_core.services.triple_store.TripleStoreService import
|
|
5
|
+
from naas_abi_core.services.triple_store.TripleStoreService import \
|
|
6
|
+
TripleStoreService
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
class EngineOntologyLoader:
|
|
@@ -13,4 +14,5 @@ class EngineOntologyLoader:
|
|
|
13
14
|
logger.debug("Loading ontologies")
|
|
14
15
|
for module in modules:
|
|
15
16
|
for ontology in module.ontologies:
|
|
17
|
+
logger.debug(f"Loading ontology: {ontology}")
|
|
16
18
|
triple_store.load_schema(ontology)
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
from naas_abi_core.module.Module import (
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
TemplatableSparqlQueryLoader,
|
|
8
|
-
)
|
|
9
|
-
from naas_abi_core.services.triple_store.TripleStoreService import TripleStoreService
|
|
1
|
+
from naas_abi_core.module.Module import (BaseModule, ModuleConfiguration,
|
|
2
|
+
ModuleDependencies)
|
|
3
|
+
from naas_abi_core.modules.templatablesparqlquery.workflows.TemplatableSparqlQueryLoader import \
|
|
4
|
+
TemplatableSparqlQueryLoader
|
|
5
|
+
from naas_abi_core.services.triple_store.TripleStoreService import \
|
|
6
|
+
TripleStoreService
|
|
10
7
|
|
|
11
8
|
|
|
12
9
|
class ABIModule(BaseModule):
|
|
@@ -32,7 +29,7 @@ class ABIModule(BaseModule):
|
|
|
32
29
|
def get_workflows(self):
|
|
33
30
|
return self.__workflows
|
|
34
31
|
|
|
35
|
-
def get_tools(self, tool_names: list[str] = []):
|
|
32
|
+
def get_tools(self, tool_names: list[str] = []) -> list:
|
|
36
33
|
if len(tool_names) == 0:
|
|
37
34
|
return self.__tools
|
|
38
35
|
else:
|
|
@@ -182,8 +182,9 @@ class AgentSharedState:
|
|
|
182
182
|
def set_requesting_help(self, requesting_help: bool):
|
|
183
183
|
self._requesting_help = requesting_help
|
|
184
184
|
|
|
185
|
+
|
|
185
186
|
class ABIAgentState(MessagesState):
|
|
186
|
-
system_prompt: str
|
|
187
|
+
system_prompt: str
|
|
187
188
|
|
|
188
189
|
|
|
189
190
|
@dataclass
|
|
@@ -227,7 +228,11 @@ class AgentConfiguration:
|
|
|
227
228
|
)
|
|
228
229
|
|
|
229
230
|
def get_system_prompt(self, messages: list[AnyMessage]) -> str:
|
|
230
|
-
return
|
|
231
|
+
return (
|
|
232
|
+
self.system_prompt(messages)
|
|
233
|
+
if callable(self.system_prompt)
|
|
234
|
+
else self.system_prompt
|
|
235
|
+
)
|
|
231
236
|
|
|
232
237
|
|
|
233
238
|
class CompletionQuery(BaseModel):
|
|
@@ -867,12 +872,18 @@ AGENT SYSTEM PROMPT:
|
|
|
867
872
|
from datetime import datetime
|
|
868
873
|
|
|
869
874
|
current_date_str = f"CURRENT_DATE: The current date is {datetime.now().strftime('%Y-%m-%d')}\n"
|
|
870
|
-
#self._system_prompt = self._system_prompt + "\n" + current_date_str
|
|
875
|
+
# self._system_prompt = self._system_prompt + "\n" + current_date_str
|
|
871
876
|
updated_system_prompt = updated_system_prompt + "\n" + current_date_str
|
|
872
|
-
return Command(
|
|
877
|
+
return Command(
|
|
878
|
+
goto="current_active_agent",
|
|
879
|
+
update={"system_prompt": updated_system_prompt},
|
|
880
|
+
)
|
|
873
881
|
|
|
874
882
|
# logger.debug(f"💬 System prompt: {self._system_prompt}")
|
|
875
|
-
return Command(
|
|
883
|
+
return Command(
|
|
884
|
+
goto="continue_conversation",
|
|
885
|
+
update={"system_prompt": updated_system_prompt},
|
|
886
|
+
)
|
|
876
887
|
|
|
877
888
|
def continue_conversation(self, state: ABIAgentState) -> Command:
|
|
878
889
|
return Command(goto="call_model")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: naas-abi-core
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.2
|
|
4
4
|
Summary: Abi framework allowing you to build your AI system.
|
|
5
5
|
Project-URL: Homepage, https://github.com/jupyter-naas/abi
|
|
6
6
|
Project-URL: Repository, https://github.com/jupyter-naas/abi/tree/main/libs/naas-abi-core
|
|
@@ -26,7 +26,7 @@ naas_abi_core/engine/engine_configuration/EngineConfiguration_VectorStoreService
|
|
|
26
26
|
naas_abi_core/engine/engine_configuration/EngineConfiguration_test.py,sha256=PL4A4Dawq6tfyHsiIkqbHhovc7wkIHcVZra6llRI-CY,286
|
|
27
27
|
naas_abi_core/engine/engine_configuration/utils/PydanticModelValidator.py,sha256=jZzLqLvR8HawpyGYiUJEng3NlebLHiN3mVFOzNDSWs8,504
|
|
28
28
|
naas_abi_core/engine/engine_loaders/EngineModuleLoader.py,sha256=4VsGtPsaeslej2JuyksHUbHJEY6J096cnr3iuTrhnpY,12043
|
|
29
|
-
naas_abi_core/engine/engine_loaders/EngineOntologyLoader.py,sha256=
|
|
29
|
+
naas_abi_core/engine/engine_loaders/EngineOntologyLoader.py,sha256=eAHdQ3CL3vkZW0DbdPdT3T-wtEh2-TJ2TSq4z0OCuIM,595
|
|
30
30
|
naas_abi_core/engine/engine_loaders/EngineServiceLoader.py,sha256=OPBTFG1c-QAFulXqNMwEh58IZ0ynClP5fFHdW3pS9PU,1772
|
|
31
31
|
naas_abi_core/integration/__init__.py,sha256=bB7l26o_ksuEo8O5dggIaZcolJbveJxGZe0-J_UzL3Y,305
|
|
32
32
|
naas_abi_core/integration/integration.py,sha256=tbdAV63Uisml9G8diZl20_JDlgJVFuLQpK_7VE4qgSw,811
|
|
@@ -37,14 +37,14 @@ naas_abi_core/module/Module.py,sha256=fyZBU0rUwWuPR3LGjUm5v6eWNXrCWvv_QDkWVu9n_y
|
|
|
37
37
|
naas_abi_core/module/ModuleAgentLoader.py,sha256=9FXcK8h0_0h4hU3gEjImUbNBBeYJ9HOEjYqKVdTl3ik,2050
|
|
38
38
|
naas_abi_core/module/ModuleUtils.py,sha256=6wUHpbdl0y_16xvz7W-NSOaRyLW9N9zx2Lg_Jkg0eMM,707
|
|
39
39
|
naas_abi_core/modules/templatablesparqlquery/README.md,sha256=Cpz3FPMc1q-P5HmQ7848er5_MRTHLDLqYqq0nFrs7Dw,6991
|
|
40
|
-
naas_abi_core/modules/templatablesparqlquery/__init__.py,sha256
|
|
40
|
+
naas_abi_core/modules/templatablesparqlquery/__init__.py,sha256=-eOtGG7ETc_4wB-8L_ZBqmVucyfYZokvCXRIRbYJqOE,1262
|
|
41
41
|
naas_abi_core/modules/templatablesparqlquery/ontologies/TemplatableSparqlQueryOntology.ttl,sha256=P8c4ZlWV6nzXZ7DiOlY1aDE39cKh0rlmjKp03Wc7U-8,4933
|
|
42
42
|
naas_abi_core/modules/templatablesparqlquery/workflows/GenericWorkflow.py,sha256=1wo9KAlNkSGXfZtQVJTi4XvDNTEMiyB9OCthkTMjeZY,1617
|
|
43
43
|
naas_abi_core/modules/templatablesparqlquery/workflows/TemplatableSparqlQueryLoader.py,sha256=_NU6RN1VZnv5N5GAYCsYCqRv07IgxemwZPd0fCxkGFI,7351
|
|
44
44
|
naas_abi_core/pipeline/__init__.py,sha256=4de6BzXJI6nTSI7baeqe4IoN-Q95idsADchU6Eiv55Q,309
|
|
45
45
|
naas_abi_core/pipeline/pipeline.py,sha256=m1QWXwdy_0yr8hxILNwoPSK2-vIz4P9WeZ6pDm9gJSg,2186
|
|
46
46
|
naas_abi_core/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
|
-
naas_abi_core/services/agent/Agent.py,sha256=
|
|
47
|
+
naas_abi_core/services/agent/Agent.py,sha256=786elqXQOUthNHudE1_oZhY-pdd-KsB_vO-_MtwMhWQ,64241
|
|
48
48
|
naas_abi_core/services/agent/AgentMemory_test.py,sha256=sSqDkr0o0MgeHudsX5s3u2oFLaAX7GVgyQPwdsD76Cs,650
|
|
49
49
|
naas_abi_core/services/agent/Agent_test.py,sha256=VITdYn0fSK-7dq67qVQbirkwZBIRBwtRqdaWy9E87VY,6343
|
|
50
50
|
naas_abi_core/services/agent/IntentAgent.py,sha256=KwILHZYFqbVGo0AoEZrSgFk64_Cd1q02SQ_81gVZ6jE,46139
|
|
@@ -118,7 +118,7 @@ naas_abi_core/workflow/__init__.py,sha256=hZD58mCB1PApxITqftP_xgjxL7NeLvOfI-rJEN
|
|
|
118
118
|
naas_abi_core/workflow/workflow.py,sha256=ZufSS073JztVl0OQRTqNyK7FepFvv7gXlc4j5FAEZCI,1216
|
|
119
119
|
assets/favicon.ico,sha256=nWk8wrHZiJV3DeuWrP2MqilXxCuoNWKGtMZfYmEVQLw,666
|
|
120
120
|
assets/logo.png,sha256=zUu9sNgMmtzJhfNCinDs85GP1LDNVfTy8kYLKRT_pxA,9334
|
|
121
|
-
naas_abi_core-1.7.
|
|
122
|
-
naas_abi_core-1.7.
|
|
123
|
-
naas_abi_core-1.7.
|
|
124
|
-
naas_abi_core-1.7.
|
|
121
|
+
naas_abi_core-1.7.2.dist-info/METADATA,sha256=dbt1fNxkP8YjZCOhXl9shRLnRCkVnWvPga4KzjKgU-Y,17567
|
|
122
|
+
naas_abi_core-1.7.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
123
|
+
naas_abi_core-1.7.2.dist-info/entry_points.txt,sha256=IX0WUFxZuo1JU6H66fcRR6y7gYChMVw_XA9suPk9_1Q,70
|
|
124
|
+
naas_abi_core-1.7.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|