naas-abi-cli 1.9.1__tar.gz → 1.10.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_cli-1.10.0/=0.9.13 +6 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/CHANGELOG.md +8 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/PKG-INFO +1 -1
- naas_abi_cli-1.10.0/naas_abi_cli/cli/new/__init__.py +9 -0
- naas_abi_cli-1.10.0/naas_abi_cli/cli/new/agent.py +42 -0
- naas_abi_cli-1.10.0/naas_abi_cli/cli/new/integration.py +36 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/module.py +35 -0
- naas_abi_cli-1.10.0/naas_abi_cli/cli/new/orchestration.py +36 -0
- naas_abi_cli-1.10.0/naas_abi_cli/cli/new/pipeline.py +36 -0
- naas_abi_cli-1.10.0/naas_abi_cli/cli/new/templates/agent/{{agent_name_pascal}}Agent.py +47 -0
- naas_abi_cli-1.10.0/naas_abi_cli/cli/new/templates/integration/{{integration_name_pascal}}Integration.py +30 -0
- naas_abi_cli-1.10.0/naas_abi_cli/cli/new/templates/module/workflows/README.md +0 -0
- naas_abi_cli-1.10.0/naas_abi_cli/cli/new/templates/orchestration/{{orchestration_name_pascal}}Orchestration.py +16 -0
- naas_abi_cli-1.10.0/naas_abi_cli/cli/new/templates/pipeline/{{pipeline_name_pascal}}Pipeline.py +69 -0
- naas_abi_cli-1.10.0/naas_abi_cli/cli/new/templates/project/README.md +0 -0
- naas_abi_cli-1.10.0/naas_abi_cli/cli/new/templates/workflow/{{workflow_name_pascal}}Workflow.py +73 -0
- naas_abi_cli-1.10.0/naas_abi_cli/cli/new/workflow.py +36 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/pyproject.toml +1 -1
- naas_abi_cli-1.9.1/=0.9.13 +0 -5
- naas_abi_cli-1.9.1/naas_abi_cli/cli/new/__init__.py +0 -4
- naas_abi_cli-1.9.1/naas_abi_cli/cli/new/templates/module/agents/{{module_name_pascal}}Agent.py +0 -52
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/.gitignore +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/Makefile +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/README.md +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/__init__.py +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/__init__.py +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/agent.py +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/chat.py +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/config.py +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/deploy.py +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/init.py +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/module.py +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/new.py +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/project.py +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/templates/module/__init__.py +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/templates/module/agents/README.md +0 -0
- {naas_abi_cli-1.9.1/naas_abi_cli/cli/new/templates/module/orchestrations → naas_abi_cli-1.10.0/naas_abi_cli/cli/new/templates/module/integrations}/README.md +0 -0
- {naas_abi_cli-1.9.1/naas_abi_cli/cli/new/templates/module/pipelines → naas_abi_cli-1.10.0/naas_abi_cli/cli/new/templates/module/ontologies}/README.md +0 -0
- {naas_abi_cli-1.9.1/naas_abi_cli/cli/new/templates/module/workflows → naas_abi_cli-1.10.0/naas_abi_cli/cli/new/templates/module/orchestrations}/README.md +0 -0
- {naas_abi_cli-1.9.1/naas_abi_cli/cli/new/templates/project → naas_abi_cli-1.10.0/naas_abi_cli/cli/new/templates/module/pipelines}/README.md +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/templates/project/.github/workflows/release.yaml +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/templates/project/.gitignore +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/templates/project/Dockerfile +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/templates/project/config.prod.yaml +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/templates/project/config.yaml +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/templates/project/pyproject.toml +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/utils.py +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/run.py +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/secret.py +0 -0
- {naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/utils/Copier.py +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Collecting uv
|
|
2
|
+
Downloading uv-0.9.28-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)
|
|
3
|
+
Downloading uv-0.9.28-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (22.7 MB)
|
|
4
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 22.7/22.7 MB 103.6 MB/s 0:00:00
|
|
5
|
+
Installing collected packages: uv
|
|
6
|
+
Successfully installed uv-0.9.28
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- version list -->
|
|
4
4
|
|
|
5
|
+
## v1.10.0 (2026-02-03)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- Working on Dagster orchestration
|
|
10
|
+
([`b970d21`](https://github.com/jupyter-naas/abi/commit/b970d21e135ab32c344122be50f292c0b44ff039))
|
|
11
|
+
|
|
12
|
+
|
|
5
13
|
## v1.9.1 (2026-01-26)
|
|
6
14
|
|
|
7
15
|
### Bug Fixes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: naas-abi-cli
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.10.0
|
|
4
4
|
Summary: Abi cli 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-cli
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import naas_abi_cli.cli.new.agent as agent # noqa: F401
|
|
2
|
+
import naas_abi_cli.cli.new.integration as integration # noqa: F401
|
|
3
|
+
import naas_abi_cli.cli.new.module as module # noqa: F401
|
|
4
|
+
import naas_abi_cli.cli.new.orchestration as orchestration # noqa: F401
|
|
5
|
+
import naas_abi_cli.cli.new.pipeline as pipeline # noqa: F401
|
|
6
|
+
import naas_abi_cli.cli.new.project as project # noqa: F401
|
|
7
|
+
import naas_abi_cli.cli.new.workflow as workflow # noqa: F401
|
|
8
|
+
|
|
9
|
+
from .new import new # noqa: F401
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
|
|
5
|
+
import naas_abi_cli
|
|
6
|
+
from naas_abi_cli.cli.utils.Copier import Copier
|
|
7
|
+
|
|
8
|
+
from .new import new
|
|
9
|
+
from .utils import to_pascal_case
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@new.command("agent")
|
|
13
|
+
@click.argument("agent_name", required=True)
|
|
14
|
+
@click.argument("agent_path", required=False, default=".")
|
|
15
|
+
def _new_agent(agent_name: str, agent_path: str = "."):
|
|
16
|
+
new_agent(agent_name, agent_path)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def new_agent(
|
|
20
|
+
agent_name: str,
|
|
21
|
+
agent_path: str = ".",
|
|
22
|
+
extra_values: dict = {},
|
|
23
|
+
):
|
|
24
|
+
agent_name = to_pascal_case(agent_name)
|
|
25
|
+
|
|
26
|
+
if agent_path == ".":
|
|
27
|
+
agent_path = os.getcwd()
|
|
28
|
+
|
|
29
|
+
if not os.path.exists(agent_path):
|
|
30
|
+
os.makedirs(agent_path, exist_ok=True)
|
|
31
|
+
|
|
32
|
+
copier = Copier(
|
|
33
|
+
templates_path=os.path.join(
|
|
34
|
+
os.path.dirname(naas_abi_cli.__file__), "cli/new/templates/agent"
|
|
35
|
+
),
|
|
36
|
+
destination_path=agent_path,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
if "module_name_snake" not in extra_values:
|
|
40
|
+
extra_values["module_name_snake"] = "your_module_name"
|
|
41
|
+
|
|
42
|
+
copier.copy(values={"agent_name_pascal": to_pascal_case(agent_name)} | extra_values)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
import naas_abi_cli
|
|
5
|
+
from naas_abi_cli.cli.utils.Copier import Copier
|
|
6
|
+
|
|
7
|
+
from .new import new
|
|
8
|
+
from .utils import to_pascal_case
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@new.command("integration")
|
|
12
|
+
@click.argument("integration_name", required=True)
|
|
13
|
+
@click.argument("integration_path", required=False, default=".")
|
|
14
|
+
def _new_integration(integration_name: str, integration_path: str = "."):
|
|
15
|
+
new_integration(integration_name, integration_path)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def new_integration(integration_name: str, integration_path: str = ".", extra_values: dict = {}):
|
|
19
|
+
integration_name = to_pascal_case(integration_name)
|
|
20
|
+
|
|
21
|
+
if integration_path == ".":
|
|
22
|
+
integration_path = os.getcwd()
|
|
23
|
+
|
|
24
|
+
if not os.path.exists(integration_path):
|
|
25
|
+
os.makedirs(integration_path, exist_ok=True)
|
|
26
|
+
|
|
27
|
+
copier = Copier(
|
|
28
|
+
templates_path=os.path.join(
|
|
29
|
+
os.path.dirname(naas_abi_cli.__file__), "cli/new/templates/integration"
|
|
30
|
+
),
|
|
31
|
+
destination_path=integration_path,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
copier.copy(
|
|
35
|
+
values={"integration_name_pascal": to_pascal_case(integration_name)} | extra_values
|
|
36
|
+
)
|
|
@@ -4,8 +4,13 @@ import click
|
|
|
4
4
|
import naas_abi_cli
|
|
5
5
|
from naas_abi_cli.cli.utils.Copier import Copier
|
|
6
6
|
|
|
7
|
+
from .agent import new_agent
|
|
8
|
+
from .integration import new_integration
|
|
7
9
|
from .new import new
|
|
10
|
+
from .orchestration import new_orchestration
|
|
11
|
+
from .pipeline import new_pipeline
|
|
8
12
|
from .utils import to_kebab_case, to_pascal_case, to_snake_case
|
|
13
|
+
from .workflow import new_workflow
|
|
9
14
|
|
|
10
15
|
|
|
11
16
|
@new.command("module")
|
|
@@ -44,6 +49,36 @@ def new_module(module_name: str, module_path: str = ".", quiet: bool = False):
|
|
|
44
49
|
}
|
|
45
50
|
)
|
|
46
51
|
|
|
52
|
+
new_agent(
|
|
53
|
+
module_name,
|
|
54
|
+
os.path.join(module_path, "agents"),
|
|
55
|
+
extra_values={"module_name_snake": to_snake_case(module_name)},
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
new_integration(
|
|
59
|
+
module_name,
|
|
60
|
+
os.path.join(module_path, "integrations"),
|
|
61
|
+
extra_values={"module_name_snake": to_snake_case(module_name)},
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
new_pipeline(
|
|
65
|
+
module_name,
|
|
66
|
+
os.path.join(module_path, "pipelines"),
|
|
67
|
+
extra_values={"module_name_snake": to_snake_case(module_name)},
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
new_workflow(
|
|
71
|
+
module_name,
|
|
72
|
+
os.path.join(module_path, "workflows"),
|
|
73
|
+
extra_values={"module_name_snake": to_snake_case(module_name)},
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
new_orchestration(
|
|
77
|
+
module_name,
|
|
78
|
+
os.path.join(module_path, "orchestrations"),
|
|
79
|
+
extra_values={"module_name_snake": to_snake_case(module_name)},
|
|
80
|
+
)
|
|
81
|
+
|
|
47
82
|
if not quiet:
|
|
48
83
|
print(f"\nModule '{module_name}' has been created at:\n {module_path}\n")
|
|
49
84
|
print("To enable this module, add the following to your config.yaml:\n")
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
import naas_abi_cli
|
|
5
|
+
from naas_abi_cli.cli.utils.Copier import Copier
|
|
6
|
+
|
|
7
|
+
from .new import new
|
|
8
|
+
from .utils import to_pascal_case
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@new.command("orchestration")
|
|
12
|
+
@click.argument("orchestration_name", required=True)
|
|
13
|
+
@click.argument("orchestration_path", required=False, default=".")
|
|
14
|
+
def _new_orchestration(orchestration_name: str, orchestration_path: str = "."):
|
|
15
|
+
new_orchestration(orchestration_name, orchestration_path)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def new_orchestration(orchestration_name: str, orchestration_path: str = ".", extra_values: dict = {}):
|
|
19
|
+
orchestration_name = to_pascal_case(orchestration_name)
|
|
20
|
+
|
|
21
|
+
if orchestration_path == ".":
|
|
22
|
+
orchestration_path = os.getcwd()
|
|
23
|
+
|
|
24
|
+
if not os.path.exists(orchestration_path):
|
|
25
|
+
os.makedirs(orchestration_path, exist_ok=True)
|
|
26
|
+
|
|
27
|
+
copier = Copier(
|
|
28
|
+
templates_path=os.path.join(
|
|
29
|
+
os.path.dirname(naas_abi_cli.__file__), "cli/new/templates/orchestration"
|
|
30
|
+
),
|
|
31
|
+
destination_path=orchestration_path,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
copier.copy(
|
|
35
|
+
values={"orchestration_name_pascal": to_pascal_case(orchestration_name)} | extra_values
|
|
36
|
+
)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
import naas_abi_cli
|
|
5
|
+
from naas_abi_cli.cli.utils.Copier import Copier
|
|
6
|
+
|
|
7
|
+
from .new import new
|
|
8
|
+
from .utils import to_pascal_case
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@new.command("pipeline")
|
|
12
|
+
@click.argument("pipeline_name", required=True)
|
|
13
|
+
@click.argument("pipeline_path", required=False, default=".")
|
|
14
|
+
def _new_pipeline(pipeline_name: str, pipeline_path: str = "."):
|
|
15
|
+
new_pipeline(pipeline_name, pipeline_path)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def new_pipeline(pipeline_name: str, pipeline_path: str = ".", extra_values: dict = {}):
|
|
19
|
+
pipeline_name = to_pascal_case(pipeline_name)
|
|
20
|
+
|
|
21
|
+
if pipeline_path == ".":
|
|
22
|
+
pipeline_path = os.getcwd()
|
|
23
|
+
|
|
24
|
+
if not os.path.exists(pipeline_path):
|
|
25
|
+
os.makedirs(pipeline_path, exist_ok=True)
|
|
26
|
+
|
|
27
|
+
copier = Copier(
|
|
28
|
+
templates_path=os.path.join(
|
|
29
|
+
os.path.dirname(naas_abi_cli.__file__), "cli/new/templates/pipeline"
|
|
30
|
+
),
|
|
31
|
+
destination_path=pipeline_path,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
copier.copy(
|
|
35
|
+
values={"pipeline_name_pascal": to_pascal_case(pipeline_name)} | extra_values
|
|
36
|
+
)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from naas_abi_core.services.agent.Agent import (
|
|
4
|
+
Agent,
|
|
5
|
+
AgentConfiguration,
|
|
6
|
+
AgentSharedState,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
NAME = "{{agent_name_pascal}}Agent"
|
|
10
|
+
DESCRIPTION = "An helpful agent that can help you with your tasks."
|
|
11
|
+
SYSTEM_PROMPT = """
|
|
12
|
+
You are {{agent_name_pascal}}Agent.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
class {{agent_name_pascal}}Agent(Agent):
|
|
16
|
+
|
|
17
|
+
@staticmethod
|
|
18
|
+
def New(cls, agent_shared_state: Optional[AgentSharedState] = None, agent_configuration: Optional[AgentConfiguration] = None) -> "{{agent_name_pascal}}Agent":
|
|
19
|
+
#from {{module_name_snake}} import ABIModule
|
|
20
|
+
|
|
21
|
+
# Set model
|
|
22
|
+
from naas_abi_marketplace.ai.chatgpt.models.gpt_5 import model as chatgpt_model
|
|
23
|
+
|
|
24
|
+
model = chatgpt_model.model
|
|
25
|
+
|
|
26
|
+
# Use provided configuration or create default one
|
|
27
|
+
if agent_configuration is None:
|
|
28
|
+
agent_configuration = AgentConfiguration(system_prompt=SYSTEM_PROMPT)
|
|
29
|
+
|
|
30
|
+
# Use provided shared state or create new one
|
|
31
|
+
if agent_shared_state is None:
|
|
32
|
+
agent_shared_state = AgentSharedState()
|
|
33
|
+
|
|
34
|
+
tools: list = []
|
|
35
|
+
|
|
36
|
+
agents: list = []
|
|
37
|
+
|
|
38
|
+
return cls(
|
|
39
|
+
name=NAME,
|
|
40
|
+
description=DESCRIPTION,
|
|
41
|
+
chat_model=model,
|
|
42
|
+
tools=tools,
|
|
43
|
+
agents=agents,
|
|
44
|
+
memory=None,
|
|
45
|
+
state=agent_shared_state,
|
|
46
|
+
configuration=agent_configuration,
|
|
47
|
+
)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import hashlib
|
|
2
|
+
import re
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from datetime import date, datetime, timedelta
|
|
5
|
+
from typing import Dict, List, Optional
|
|
6
|
+
|
|
7
|
+
import requests
|
|
8
|
+
from naas_abi_core import logger
|
|
9
|
+
from naas_abi_core.integration import Integration, IntegrationConfiguration
|
|
10
|
+
from naas_abi_core.integration.integration import IntegrationConnectionError
|
|
11
|
+
from naas_abi_core.services.cache.CacheFactory import CacheFactory
|
|
12
|
+
from naas_abi_core.services.cache.CachePort import DataType
|
|
13
|
+
from naas_abi_core.services.cache.CacheService import CacheService
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@dataclass
|
|
17
|
+
class {{integration_name_pascal}}IntegrationConfiguration(IntegrationConfiguration):
|
|
18
|
+
"""Configuration for the {{integration_name_pascal}} integration."""
|
|
19
|
+
pass
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class {{integration_name_pascal}}Integration(Integration):
|
|
23
|
+
"""{{integration_name_pascal}} integration."""
|
|
24
|
+
|
|
25
|
+
__configuration: {{integration_name_pascal}}IntegrationConfiguration
|
|
26
|
+
|
|
27
|
+
def __init__(self, configuration: {{integration_name_pascal}}IntegrationConfiguration):
|
|
28
|
+
super().__init__(configuration)
|
|
29
|
+
self.__configuration = configuration
|
|
30
|
+
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import dagster as dg
|
|
2
|
+
from naas_abi_core.orchestrations.DagsterOrchestration import DagsterOrchestration
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class {{orchestration_name_pascal}}Orchestration(DagsterOrchestration):
|
|
6
|
+
|
|
7
|
+
@classmethod
|
|
8
|
+
def New(cls) -> "{{orchestration_name_pascal}}Orchestration":
|
|
9
|
+
return cls(
|
|
10
|
+
definitions=dg.Definitions(
|
|
11
|
+
assets=[],
|
|
12
|
+
schedules=[],
|
|
13
|
+
jobs=[],
|
|
14
|
+
sensors=[],
|
|
15
|
+
)
|
|
16
|
+
)
|
naas_abi_cli-1.10.0/naas_abi_cli/cli/new/templates/pipeline/{{pipeline_name_pascal}}Pipeline.py
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import uuid
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from enum import Enum
|
|
4
|
+
from typing import Annotated, Optional
|
|
5
|
+
|
|
6
|
+
from langchain_core.tools import BaseTool, StructuredTool
|
|
7
|
+
from naas_abi_core import logger
|
|
8
|
+
from naas_abi_core.pipeline import (Pipeline, PipelineConfiguration,
|
|
9
|
+
PipelineParameters)
|
|
10
|
+
from naas_abi_core.utils.Expose import APIRouter
|
|
11
|
+
from pydantic import Field
|
|
12
|
+
from rdflib import DCTERMS, OWL, RDF, RDFS, Graph, Literal, Namespace, URIRef
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass
|
|
16
|
+
class {{pipeline_name_pascal}}PipelineConfiguration(PipelineConfiguration):
|
|
17
|
+
"""Configuration for {{pipeline_name_pascal}}Pipeline."""
|
|
18
|
+
|
|
19
|
+
pass
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class {{pipeline_name_pascal}}PipelineParameters(PipelineParameters):
|
|
23
|
+
# example_parameter: Annotated[
|
|
24
|
+
# str,
|
|
25
|
+
# Field(
|
|
26
|
+
# description="Description of the example parameter",
|
|
27
|
+
# example="Example value",
|
|
28
|
+
# ),
|
|
29
|
+
# ]
|
|
30
|
+
pass
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class {{pipeline_name_pascal}}Pipeline(Pipeline[{{pipeline_name_pascal}}PipelineParameters]):
|
|
34
|
+
"""Pipeline for adding a named individual."""
|
|
35
|
+
|
|
36
|
+
__configuration: {{pipeline_name_pascal}}PipelineConfiguration
|
|
37
|
+
|
|
38
|
+
def __init__(self, configuration: {{pipeline_name_pascal}}PipelineConfiguration):
|
|
39
|
+
super().__init__(configuration)
|
|
40
|
+
self.__configuration = configuration
|
|
41
|
+
|
|
42
|
+
def run(self, parameters: {{pipeline_name_pascal}}PipelineParameters) -> Graph:
|
|
43
|
+
# Implement the pipeline logic here.
|
|
44
|
+
pass
|
|
45
|
+
|
|
46
|
+
def as_tools(self) -> list[BaseTool]:
|
|
47
|
+
return [
|
|
48
|
+
StructuredTool(
|
|
49
|
+
name="{{pipeline_name_pascal}}",
|
|
50
|
+
description="Description of what the pipeline does",
|
|
51
|
+
func=lambda **kwargs: self.run(
|
|
52
|
+
{{pipeline_name_pascal}}PipelineParameters(**kwargs)
|
|
53
|
+
),
|
|
54
|
+
args_schema={{pipeline_name_pascal}}PipelineParameters,
|
|
55
|
+
)
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
def as_api(
|
|
59
|
+
self,
|
|
60
|
+
router: APIRouter,
|
|
61
|
+
route_name: str = "",
|
|
62
|
+
name: str = "",
|
|
63
|
+
description: str = "",
|
|
64
|
+
description_stream: str = "",
|
|
65
|
+
tags: list[str | Enum] | None = None,
|
|
66
|
+
) -> None:
|
|
67
|
+
if tags is None:
|
|
68
|
+
tags = []
|
|
69
|
+
return None
|
|
File without changes
|
naas_abi_cli-1.10.0/naas_abi_cli/cli/new/templates/workflow/{{workflow_name_pascal}}Workflow.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from enum import Enum
|
|
3
|
+
from typing import Annotated, Optional
|
|
4
|
+
|
|
5
|
+
from langchain_core.tools import BaseTool, StructuredTool
|
|
6
|
+
from naas_abi_core.services.triple_store.TripleStorePorts import ITripleStoreService
|
|
7
|
+
from naas_abi_core.utils.Expose import APIRouter
|
|
8
|
+
from naas_abi_core.workflow import Workflow, WorkflowConfiguration
|
|
9
|
+
from naas_abi_core.workflow.workflow import WorkflowParameters
|
|
10
|
+
from pydantic import Field
|
|
11
|
+
|
|
12
|
+
@dataclass
|
|
13
|
+
class {{workflow_name_pascal}}WorkflowConfiguration(WorkflowConfiguration):
|
|
14
|
+
"""Configuration for {{workflow_name_pascal}} workflow."""
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
pass
|
|
18
|
+
|
|
19
|
+
class {{workflow_name_pascal}}WorkflowParameters(WorkflowParameters):
|
|
20
|
+
"""Parameters for {{workflow_name_pascal}} workflow."""
|
|
21
|
+
|
|
22
|
+
pass
|
|
23
|
+
|
|
24
|
+
# example_parameter: Annotated[
|
|
25
|
+
# str,
|
|
26
|
+
# Field(
|
|
27
|
+
# ...,
|
|
28
|
+
# description="Description of the example parameter",
|
|
29
|
+
# example="Example value",
|
|
30
|
+
# ),
|
|
31
|
+
# ]
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class {{workflow_name_pascal}}Workflow(Workflow[{{workflow_name_pascal}}WorkflowParameters]):
|
|
35
|
+
"""Workflow for {{workflow_name_pascal}}."""
|
|
36
|
+
|
|
37
|
+
__configuration: {{workflow_name_pascal}}WorkflowConfiguration
|
|
38
|
+
|
|
39
|
+
def __init__(self, configuration: {{workflow_name_pascal}}WorkflowConfiguration):
|
|
40
|
+
super().__init__(configuration)
|
|
41
|
+
self.__configuration = configuration
|
|
42
|
+
|
|
43
|
+
def run(
|
|
44
|
+
self, parameters: {{workflow_name_pascal}}WorkflowParameters
|
|
45
|
+
) -> dict | list[dict]:
|
|
46
|
+
# Implement the workflow logic here
|
|
47
|
+
pass
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def as_tools(self) -> list[BaseTool]:
|
|
51
|
+
return [
|
|
52
|
+
StructuredTool(
|
|
53
|
+
name="{{workflow_name_pascal}}",
|
|
54
|
+
description="Description of what the workflow does",
|
|
55
|
+
func=lambda **kwargs: self.run(
|
|
56
|
+
{{workflow_name_pascal}}WorkflowParameters(**kwargs)
|
|
57
|
+
),
|
|
58
|
+
args_schema={{workflow_name_pascal}}WorkflowParameters,
|
|
59
|
+
)
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
def as_api(
|
|
63
|
+
self,
|
|
64
|
+
router: APIRouter,
|
|
65
|
+
route_name: str = "",
|
|
66
|
+
name: str = "",
|
|
67
|
+
description: str = "",
|
|
68
|
+
description_stream: str = "",
|
|
69
|
+
tags: list[str | Enum] | None = None,
|
|
70
|
+
) -> None:
|
|
71
|
+
if tags is None:
|
|
72
|
+
tags = []
|
|
73
|
+
return None
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
import naas_abi_cli
|
|
5
|
+
from naas_abi_cli.cli.utils.Copier import Copier
|
|
6
|
+
|
|
7
|
+
from .new import new
|
|
8
|
+
from .utils import to_pascal_case
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@new.command("workflow")
|
|
12
|
+
@click.argument("workflow_name", required=True)
|
|
13
|
+
@click.argument("workflow_path", required=False, default=".")
|
|
14
|
+
def _new_workflow(workflow_name: str, workflow_path: str = "."):
|
|
15
|
+
new_workflow(workflow_name, workflow_path)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def new_workflow(workflow_name: str, workflow_path: str = ".", extra_values: dict = {}):
|
|
19
|
+
workflow_name = to_pascal_case(workflow_name)
|
|
20
|
+
|
|
21
|
+
if workflow_path == ".":
|
|
22
|
+
workflow_path = os.getcwd()
|
|
23
|
+
|
|
24
|
+
if not os.path.exists(workflow_path):
|
|
25
|
+
os.makedirs(workflow_path, exist_ok=True)
|
|
26
|
+
|
|
27
|
+
copier = Copier(
|
|
28
|
+
templates_path=os.path.join(
|
|
29
|
+
os.path.dirname(naas_abi_cli.__file__), "cli/new/templates/workflow"
|
|
30
|
+
),
|
|
31
|
+
destination_path=workflow_path,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
copier.copy(
|
|
35
|
+
values={"workflow_name_pascal": to_pascal_case(workflow_name)} | extra_values
|
|
36
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "naas-abi-cli"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.10.0"
|
|
4
4
|
description = "Abi cli 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"
|
naas_abi_cli-1.9.1/=0.9.13
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
Collecting uv
|
|
2
|
-
Using cached uv-0.9.26-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)
|
|
3
|
-
Using cached uv-0.9.26-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (23.3 MB)
|
|
4
|
-
Installing collected packages: uv
|
|
5
|
-
Successfully installed uv-0.9.26
|
naas_abi_cli-1.9.1/naas_abi_cli/cli/new/templates/module/agents/{{module_name_pascal}}Agent.py
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
from typing import Optional
|
|
2
|
-
|
|
3
|
-
from naas_abi_core.services.agent.Agent import (
|
|
4
|
-
Agent,
|
|
5
|
-
AgentConfiguration,
|
|
6
|
-
AgentSharedState,
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
NAME = "{{module_name_pascal}}Agent"
|
|
10
|
-
DESCRIPTION = "An helpful agent that can help you with your tasks."
|
|
11
|
-
SYSTEM_PROMPT = """
|
|
12
|
-
You are {{module_name_pascal}}Agent.
|
|
13
|
-
"""
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def create_agent(
|
|
17
|
-
agent_shared_state: Optional[AgentSharedState] = None,
|
|
18
|
-
agent_configuration: Optional[AgentConfiguration] = None,
|
|
19
|
-
) -> Optional[Agent]:
|
|
20
|
-
#from {{module_name_snake}} import ABIModule
|
|
21
|
-
|
|
22
|
-
# Set model
|
|
23
|
-
from naas_abi_marketplace.ai.chatgpt.models.gpt_5 import model as chatgpt_model
|
|
24
|
-
|
|
25
|
-
model = chatgpt_model.model
|
|
26
|
-
|
|
27
|
-
# Use provided configuration or create default one
|
|
28
|
-
if agent_configuration is None:
|
|
29
|
-
agent_configuration = AgentConfiguration(system_prompt=SYSTEM_PROMPT)
|
|
30
|
-
|
|
31
|
-
# Use provided shared state or create new one
|
|
32
|
-
if agent_shared_state is None:
|
|
33
|
-
agent_shared_state = AgentSharedState()
|
|
34
|
-
|
|
35
|
-
tools: list = []
|
|
36
|
-
|
|
37
|
-
agents: list = []
|
|
38
|
-
|
|
39
|
-
return {{module_name_pascal}}Agent(
|
|
40
|
-
name=NAME,
|
|
41
|
-
description=DESCRIPTION,
|
|
42
|
-
chat_model=model,
|
|
43
|
-
tools=tools,
|
|
44
|
-
agents=agents,
|
|
45
|
-
memory=None,
|
|
46
|
-
state=agent_shared_state,
|
|
47
|
-
configuration=agent_configuration,
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
class {{module_name_pascal}}Agent(Agent):
|
|
52
|
-
pass
|
|
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
|
{naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/templates/module/__init__.py
RENAMED
|
File without changes
|
{naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/templates/module/agents/README.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/templates/project/.gitignore
RENAMED
|
File without changes
|
{naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/templates/project/Dockerfile
RENAMED
|
File without changes
|
{naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/templates/project/config.prod.yaml
RENAMED
|
File without changes
|
{naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/templates/project/config.yaml
RENAMED
|
File without changes
|
{naas_abi_cli-1.9.1 → naas_abi_cli-1.10.0}/naas_abi_cli/cli/new/templates/project/pyproject.toml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|