naas-abi 1.0.3.dev2__py3-none-any.whl → 1.0.5__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/__init__.py CHANGED
@@ -15,21 +15,20 @@ class ABIModule(BaseModule):
15
15
  modules=[
16
16
  "naas_abi_marketplace.ai.chatgpt",
17
17
  "naas_abi_marketplace.ai.claude#soft",
18
- # "naas_abi_core.modules.templatablesparqlquery",
18
+ "naas_abi_core.modules.templatablesparqlquery",
19
19
  ],
20
20
  services=[Secret, TripleStoreService, ObjectStorageService],
21
21
  )
22
22
 
23
23
  class Configuration(ModuleConfiguration):
24
- pass
25
- # openai_api_key: str | None = None
26
- # anthropic_api_key: str | None = None
24
+ openai_api_key: str
25
+ anthropic_api_key: str | None = None
27
26
 
28
- # def on_initialized(self):
29
- # if (
30
- # self.configuration.anthropic_api_key is not None
31
- # and "naas_abi_marketplace.ai.claude" not in self.engine.modules
32
- # ):
33
- # raise ValueError(
34
- # "anthropic_api_key is provided but naas_abi_marketplace.ai.claude is not available"
35
- # )
27
+ def on_initialized(self):
28
+ if (
29
+ self.configuration.anthropic_api_key is not None
30
+ and "naas_abi_marketplace.ai.claude" not in self.engine.modules
31
+ ):
32
+ raise ValueError(
33
+ "anthropic_api_key is provided but naas_abi_marketplace.ai.claude is not available"
34
+ )
@@ -149,19 +149,19 @@ You can browse the data and run queries there."""
149
149
 
150
150
  tools.append(open_knowledge_graph_explorer)
151
151
 
152
- # templatable_sparql_query_module = ABIModule.get_instance().engine.modules[
153
- # "naas_abi_core.modules.templatablesparqlquery"
154
- # ]
155
-
156
- # agent_recommendation_tools = [
157
- # "find_business_proposal_agents",
158
- # "find_coding_agents",
159
- # "find_math_agents",
160
- # "find_best_value_agents",
161
- # "find_fastest_agents",
162
- # "find_cheapest_agents",
163
- # ]
164
- # tools.extend(templatable_sparql_query_module.get_tools(agent_recommendation_tools))
152
+ templatable_sparql_query_module = ABIModule.get_instance().engine.modules[
153
+ "naas_abi_core.modules.templatablesparqlquery"
154
+ ]
155
+
156
+ agent_recommendation_tools = [
157
+ "find_business_proposal_agents",
158
+ "find_coding_agents",
159
+ "find_math_agents",
160
+ "find_best_value_agents",
161
+ "find_fastest_agents",
162
+ "find_cheapest_agents",
163
+ ]
164
+ tools.extend(templatable_sparql_query_module.get_tools(agent_recommendation_tools))
165
165
 
166
166
  shared_state = agent_shared_state or AgentSharedState(
167
167
  thread_id="0", supervisor_agent=NAME
@@ -5,13 +5,13 @@ from naas_abi_core.models.Model import ChatModel
5
5
 
6
6
 
7
7
  def get_model() -> ChatModel:
8
- from naas_abi_marketplace.ai.chatgpt import ABIModule as ChatGPTABIModule
9
8
  ai_mode: Literal["cloud", "local", "airgap"] = (
10
9
  ABIModule.get_instance().configuration.global_config.ai_mode
11
10
  )
12
11
  if (
13
12
  ai_mode == "airgap"
14
- or not ChatGPTABIModule.get_instance().configuration.openai_api_key
13
+ or not ABIModule.get_instance().configuration.openai_api_key
14
+ and not ABIModule.get_instance().configuration.openrouter_api_key
15
15
  ):
16
16
  from naas_abi.models.airgap_qwen import model as airgap_model
17
17
 
@@ -22,3 +22,4 @@ def get_model() -> ChatModel:
22
22
  )
23
23
 
24
24
  return cloud_model
25
+ return cloud_model
@@ -0,0 +1,26 @@
1
+ from langchain_openai import ChatOpenAI
2
+ from naas_abi import ABIModule
3
+ from naas_abi_core.models.Model import ChatModel
4
+ from pydantic import SecretStr
5
+
6
+ ID = "gpt-4.1"
7
+ NAME = "gpt-4.1"
8
+ DESCRIPTION = "GPT-4.1 excels at instruction following and tool calling, with broad knowledge across domains. It features a 1M token context window, and low latency without a reasoning step."
9
+ IMAGE = "https://naasai-public.s3.eu-west-3.amazonaws.com/abi-demo/ontology_ABI.png"
10
+ CONTEXT_WINDOW = 1047576
11
+ OWNER = "openai"
12
+
13
+ model: ChatModel = ChatModel(
14
+ model_id=ID,
15
+ provider=OWNER,
16
+ name=NAME,
17
+ description=DESCRIPTION,
18
+ image=IMAGE,
19
+ owner=OWNER,
20
+ model=ChatOpenAI(
21
+ model=ID,
22
+ temperature=0,
23
+ api_key=SecretStr(ABIModule.get_instance().configuration.openai_api_key),
24
+ ),
25
+ context_window=CONTEXT_WINDOW,
26
+ )
@@ -3,7 +3,8 @@ from enum import Enum
3
3
  from typing import Annotated, List
4
4
 
5
5
  from langchain_core.tools import BaseTool, StructuredTool
6
- from naas_abi import ABIModule, logger
6
+ from naas_abi import ABIModule
7
+ from naas_abi_core import logger
7
8
  from naas_abi_core.pipeline import Pipeline, PipelineConfiguration, PipelineParameters
8
9
  from naas_abi_core.services.triple_store.TripleStorePorts import ITripleStoreService
9
10
  from naas_abi_core.utils.Expose import APIRouter
@@ -1,9 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: naas-abi
3
- Version: 1.0.3.dev2
3
+ Version: 1.0.5
4
4
  Summary: Add your description here
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
7
7
  Description-Content-Type: text/markdown
8
8
  Requires-Dist: naas-abi-core>=1.0.0-dev.1
9
9
  Requires-Dist: naas-abi-marketplace>=1.0.0-dev.1
10
+ Requires-Dist: thefuzz>=0.22.1
@@ -1,8 +1,8 @@
1
- naas_abi/__init__.py,sha256=Zqi9WxG8fsjWNxGHt_LZi7tVx8kEBUug6RqLOst0Gzs,1209
1
+ naas_abi/__init__.py,sha256=X1SuoUFhRyOWCx3VfKcEYQStJJqZO1cM9V3Jsxob7GU,1160
2
2
  naas_abi/cli.py,sha256=bfCcxGoQ_iSMhQDDX0-dRCyhc53Nawsy3WAruCNCL7M,27549
3
3
  naas_abi/mappings.py,sha256=qu17k8cPwPNKRIqchDMnxViDx0Kn0MTy2XT8XYUIW34,4872
4
4
  naas_abi/triggers.py,sha256=ljkgZP2zsTlmkK02ivTPW-yV02pn2TdyRk5CP4kUtvo,4658
5
- naas_abi/agents/AbiAgent.py,sha256=mjOCpMncEuDm-y7ZcFg_IEaSSTYJLkt6ICkljD2DK30,18095
5
+ naas_abi/agents/AbiAgent.py,sha256=xbpjtsGIqIOMrg5jL8acpKRCAE2Ik_us5sr8ttbnQRk,18071
6
6
  naas_abi/agents/AbiAgent_test.py,sha256=AKggG5RS3zDWnql1DFE7cF7riAHeOdKTZp44WN65Arg,5906
7
7
  naas_abi/agents/EntitytoSPARQLAgent.py,sha256=KNBQUIANT1nuQ62zBySm1izGSEl6SCsfwm9l_SGCDGs,57105
8
8
  naas_abi/agents/EntitytoSPARQLAgent_test.py,sha256=kx0gkbJoQZqt2_f_RINajwQU5EnHR1PsQx53rh7wJvA,2267
@@ -18,7 +18,8 @@ naas_abi/apps/terminal_agent/main.py,sha256=7MN88mivIV7gP1lELnqNxP_huwTbavhnTjkN
18
18
  naas_abi/apps/terminal_agent/terminal_style.py,sha256=YOpfvBlKU52wNyGEKbZPiRQVKxug-hI92H8ScV5L8Ew,5254
19
19
  naas_abi/models/airgap_gemma.py,sha256=I9pWN_DSgy4h6rT7OiYWDVijyTMoEgONm4xfZYWvp6I,8469
20
20
  naas_abi/models/airgap_qwen.py,sha256=EQZ-0tAKZCTCqnovLiGCx4ss0yh2Jjk0xh7wCwDomG8,682
21
- naas_abi/models/default.py,sha256=XZ4--FmFjvO99fQdV0I7niJtHNgSFZuCKPb95pyhLns,721
21
+ naas_abi/models/default.py,sha256=R7QmR3-IrNwvsm_l0NDhawrWqTYDY6S_w0cr6TbHic4,737
22
+ naas_abi/models/gpt_4_1.py,sha256=0luDssCvt8BoK_iVDRI7wkZ5GYn1d--G3GtnN6jiPIg,838
22
23
  naas_abi/pipelines/AIAgentOntologyGenerationPipeline.py,sha256=QWrooZ_xJy0uX92Tzw7fBOs_uME2nLhsjeWi0EGTUBA,24640
23
24
  naas_abi/pipelines/AIAgentOntologyGenerationPipeline_test.py,sha256=lDsuZKfQlCtLNKQ09nkSHemsvjSNdeZAhaDw-cPYbjo,4130
24
25
  naas_abi/pipelines/AddIndividualPipeline.py,sha256=EKrJX4ODXBMSFUl0R2UsaSmLaj0cUJ3AdIhhtU0Fhso,8445
@@ -27,7 +28,7 @@ naas_abi/pipelines/InsertDataSPARQLPipeline.py,sha256=yo-GaAW4Od1503iG_3BHCUzRE3
27
28
  naas_abi/pipelines/InsertDataSPARQLPipeline_test.py,sha256=AdYonpWm2oL4CfJkAtFQRb3XPyFiGCqaxwsfx0vr1yg,3250
28
29
  naas_abi/pipelines/MergeIndividualsPipeline.py,sha256=PMCU_f0u689I6l93-VpgNkGgWxeUByLVpakVKmFG1rY,9206
29
30
  naas_abi/pipelines/MergeIndividualsPipeline_test.py,sha256=G__YPaHPAup3_PwAsjy3qJWmQNYFXUjl4BvgqsYw2uw,2995
30
- naas_abi/pipelines/RemoveIndividualPipeline.py,sha256=9-zAjV9tgOx-xMeBsJceNZNWEuaL9P4XLWbaTJ9PMdI,5533
31
+ naas_abi/pipelines/RemoveIndividualPipeline.py,sha256=rgoel5Gbtl99E2jlDzBr7-bMk7Wgd0mLuuf-GOzz_Ys,5558
31
32
  naas_abi/pipelines/RemoveIndividualPipeline_test.py,sha256=RMxBoDFcU7eHJsmK7kjnhXNLlFrJE7KgwHoJez-Fvto,1702
32
33
  naas_abi/pipelines/UpdateCommercialOrganizationPipeline.py,sha256=TDboVTlOpsbrixRkp-b9dA6Cm194D4ZVUOeQX_uSMe4,6768
33
34
  naas_abi/pipelines/UpdateDataPropertyPipeline.py,sha256=m6wef4tVfBllt4pkflkkKB_Ncw9aEkTHV75ADvUjZcE,6723
@@ -55,7 +56,7 @@ naas_abi/workflows/GetSubjectGraphWorkflow.py,sha256=EkgrFQPyaUVeC8sd7oVcxT9LUka
55
56
  naas_abi/workflows/GetSubjectGraphWorkflow_test.py,sha256=fzzFYUwojM39x5Ld-59jHMDbGy4Lcq6uO8_BAvZV0ug,1886
56
57
  naas_abi/workflows/SearchIndividualWorkflow.py,sha256=6vWwywKNBlaosopPxiw0OpQnrn99wuiji0uA7jwKOn4,6572
57
58
  naas_abi/workflows/SearchIndividualWorkflow_test.py,sha256=KBhd58TATMSWWdThYPg7veAySR4hts5LuoygQqQIiaU,2749
58
- naas_abi-1.0.3.dev2.dist-info/METADATA,sha256=aVHl3WXp7QpgoRc_UNwZ5xWHAkdtkSFUHfKvHD_xNho,363
59
- naas_abi-1.0.3.dev2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
60
- naas_abi-1.0.3.dev2.dist-info/top_level.txt,sha256=Dhf3mhATB9-JuvBR8Y55OabvI-PCeQUqb5ae3EMmbeA,9
61
- naas_abi-1.0.3.dev2.dist-info/RECORD,,
59
+ naas_abi-1.0.5.dist-info/METADATA,sha256=KV5l5EWuEQ989b2fxTCxP7hYdlDwxm0kfPylzKlyw_Q,389
60
+ naas_abi-1.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
61
+ naas_abi-1.0.5.dist-info/top_level.txt,sha256=Dhf3mhATB9-JuvBR8Y55OabvI-PCeQUqb5ae3EMmbeA,9
62
+ naas_abi-1.0.5.dist-info/RECORD,,