naas-abi-cli 1.4.3__tar.gz → 1.5.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.
Files changed (36) hide show
  1. naas_abi_cli-1.5.0/=0.9.13 +6 -0
  2. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/CHANGELOG.md +16 -0
  3. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/PKG-INFO +1 -1
  4. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/deploy.py +5 -0
  5. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/new/project.py +1 -2
  6. naas_abi_cli-1.5.0/naas_abi_cli/cli/new/templates/project/config.prod.yaml +67 -0
  7. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/new/templates/project/config.yaml +8 -3
  8. naas_abi_cli-1.5.0/naas_abi_cli/cli/new/templates/project/{{project_name_snake}}/__init__.py +31 -0
  9. naas_abi_cli-1.5.0/naas_abi_cli/cli/new/templates/project/{{project_name_snake}}/agents/Agent.py +52 -0
  10. naas_abi_cli-1.5.0/naas_abi_cli/cli/new/templates/project/{{project_name_snake}}/orchestrations/README.md +0 -0
  11. naas_abi_cli-1.5.0/naas_abi_cli/cli/new/templates/project/{{project_name_snake}}/pipelines/README.md +0 -0
  12. naas_abi_cli-1.5.0/naas_abi_cli/cli/new/templates/project/{{project_name_snake}}/workflows/README.md +0 -0
  13. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/utils/Copier.py +30 -12
  14. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/pyproject.toml +3 -3
  15. naas_abi_cli-1.4.3/=0.9.13 +0 -6
  16. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/.gitignore +0 -0
  17. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/Makefile +0 -0
  18. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/README.md +0 -0
  19. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/__init__.py +0 -0
  20. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/__init__.py +0 -0
  21. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/agent.py +0 -0
  22. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/chat.py +0 -0
  23. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/config.py +0 -0
  24. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/init.py +0 -0
  25. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/module.py +0 -0
  26. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/new/__init__.py +0 -0
  27. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/new/module.py +0 -0
  28. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/new/new.py +0 -0
  29. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/new/templates/project/.github/workflows/release.yaml +0 -0
  30. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/new/templates/project/.gitignore +0 -0
  31. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/new/templates/project/Dockerfile +0 -0
  32. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/new/templates/project/README.md +0 -0
  33. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/new/templates/project/pyproject.toml +0 -0
  34. /naas_abi_cli-1.4.3/naas_abi_cli/cli/new/templates/project/{{project_name_snake}}/__init__.py → /naas_abi_cli-1.5.0/naas_abi_cli/cli/new/templates/project/{{project_name_snake}}/agents/README.md +0 -0
  35. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/run.py +0 -0
  36. {naas_abi_cli-1.4.3 → naas_abi_cli-1.5.0}/naas_abi_cli/cli/secret.py +0 -0
@@ -0,0 +1,6 @@
1
+ Collecting uv
2
+ Downloading uv-0.9.26-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)
3
+ Downloading uv-0.9.26-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (23.3 MB)
4
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 23.3/23.3 MB 195.6 MB/s 0:00:00
5
+ Installing collected packages: uv
6
+ Successfully installed uv-0.9.26
@@ -2,6 +2,22 @@
2
2
 
3
3
  <!-- version list -->
4
4
 
5
+ ## v1.5.0 (2026-01-24)
6
+
7
+ ### Bug Fixes
8
+
9
+ - Naas-abi-cli release
10
+ ([`25e669f`](https://github.com/jupyter-naas/abi/commit/25e669f95dc64f689f1d134d89845bad055333b6))
11
+
12
+ ### Features
13
+
14
+ - Working on improving project initialization
15
+ ([`e7063bb`](https://github.com/jupyter-naas/abi/commit/e7063bb63a7d3b553f159861fb3e1c545e7d8849))
16
+
17
+
18
+ ## v1.4.4 (2026-01-15)
19
+
20
+
5
21
  ## v1.4.3 (2026-01-15)
6
22
 
7
23
  ### Bug Fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: naas-abi-cli
3
- Version: 1.4.3
3
+ Version: 1.5.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
@@ -151,6 +151,11 @@ class NaasDeployer:
151
151
  .decode("utf-8")
152
152
  )
153
153
 
154
+ if image_sha is None or image_sha == "":
155
+ raise click.ClickException(
156
+ "Failed to get image SHA. Please check if the image is correctly built and pushed to the registry."
157
+ )
158
+
154
159
  image_name_with_sha = f"{image_name.replace(':' + uid, '')}@{image_sha}"
155
160
 
156
161
  self.naas_api_client.create_space(
@@ -2,7 +2,6 @@ import os
2
2
  import subprocess
3
3
 
4
4
  import click
5
-
6
5
  import naas_abi_cli
7
6
  from naas_abi_cli.cli.utils.Copier import Copier
8
7
 
@@ -24,7 +23,6 @@ def new_project(project_name: str | None, project_path: str | None):
24
23
  # Ensure the last path component matches the project name, not just the suffix.
25
24
  if os.path.basename(os.path.normpath(project_path)) != project_name:
26
25
  project_path = os.path.join(project_path, project_name)
27
- print(project_path)
28
26
 
29
27
  if not os.path.exists(project_path):
30
28
  os.makedirs(project_path, exist_ok=True)
@@ -42,6 +40,7 @@ def new_project(project_name: str | None, project_path: str | None):
42
40
  values={
43
41
  "project_name": project_name,
44
42
  "project_name_snake": project_name.replace("-", "_"),
43
+ "project_name_pascal": project_name.replace("-", "").capitalize(),
45
44
  }
46
45
  )
47
46
 
@@ -0,0 +1,67 @@
1
+ deploy:
2
+ workspace_id: "{{ naas_workspace_id }}"
3
+ space_name: "{{ project_name_snake }}-abi-api"
4
+ {% raw %}
5
+ naas_api_key: "{{ secret.NAAS_API_KEY }}"
6
+ env:
7
+ ENV: "prod"
8
+ NAAS_API_KEY: "{{ secret.NAAS_API_KEY }}"
9
+ OPENAI_API_KEY: "{{ secret.OPENAI_API_KEY }}"
10
+ ABI_API_KEY: "{{ secret.ABI_API_KEY }}"
11
+
12
+
13
+ auto_publish:
14
+ enabled: true # Enable automatic publishing of agents to workspace
15
+ exclude_agents: [] # Agents to exclude from auto-publishing (empty list means publish all enabled agents)
16
+ default_agent: "Abi" # Which agent to set as default in workspace
17
+
18
+ api:
19
+ title: "ABI API"
20
+ description: "API for ABI, your Artifical Business Intelligence"
21
+ logo_path: "assets/logo.png"
22
+ favicon_path: "assets/favicon.ico"
23
+ cors_origins:
24
+ - "http://localhost:9879"
25
+
26
+
27
+ global_config:
28
+ ai_mode: "cloud"
29
+
30
+ modules:
31
+ - module: naas_abi
32
+ enabled: true
33
+ - module: naas_abi_marketplace.ai.chatgpt
34
+ enabled: true
35
+ config:
36
+ openai_api_key: "{{ secret.OPENAI_API_KEY }}"
37
+ {% endraw %}
38
+ - module: {{ project_name_snake }}
39
+ enabled: true
40
+
41
+ {% raw %}
42
+ services:
43
+ secret:
44
+ secret_adapters:
45
+ - adapter: "naas"
46
+ config:
47
+ naas_api_key: "{{ secret.NAAS_API_KEY }}"
48
+ naas_api_url: "https://api.naas.ai"
49
+ object_storage:
50
+ object_storage_adapter:
51
+ adapter: "naas"
52
+ config:
53
+ naas_api_key: "{{ secret.NAAS_API_KEY }}"
54
+ workspace_id: "{{ secret.NAAS_WORKSPACE_ID }}"
55
+ storage_name: "{{ secret.NAAS_STORAGE_NAME }}"
56
+ base_prefix: "datastore"
57
+ triple_store:
58
+ triple_store_adapter:
59
+ adapter: "fs"
60
+ config:
61
+ store_path: "storage/triplestore"
62
+ vector_store:
63
+ vector_store_adapter:
64
+ adapter: "qdrant"
65
+ config: {}
66
+
67
+ {% endraw %}
@@ -1,13 +1,13 @@
1
1
  deploy:
2
- workspace_id: "your_workspace_id"
3
- space_name: "your_project_name-abi-api"
2
+ workspace_id: "{{ naas_workspace_id }}"
3
+ space_name: "{{ project_name_snake }}-abi-api"
4
+ {% raw %}
4
5
  naas_api_key: "{{ secret.NAAS_API_KEY }}"
5
6
  env:
6
7
  NAAS_API_KEY: "{{ secret.NAAS_API_KEY }}"
7
8
  OPENAI_API_KEY: "{{ secret.OPENAI_API_KEY }}"
8
9
  ABI_API_KEY: "{{ secret.ABI_API_KEY }}"
9
10
 
10
-
11
11
  auto_publish:
12
12
  enabled: true # Enable automatic publishing of agents to workspace
13
13
  exclude_agents: [] # Agents to exclude from auto-publishing (empty list means publish all enabled agents)
@@ -32,7 +32,11 @@ modules:
32
32
  enabled: true
33
33
  config:
34
34
  openai_api_key: "{{ secret.OPENAI_API_KEY }}"
35
+ {% endraw %}
36
+ - module: {{ project_name_snake }}
37
+ enabled: true
35
38
 
39
+ {% raw %}
36
40
  services:
37
41
  secret:
38
42
  secret_adapters:
@@ -52,3 +56,4 @@ services:
52
56
  vector_store_adapter:
53
57
  adapter: "qdrant"
54
58
  config: {}
59
+ {% endraw %}
@@ -0,0 +1,31 @@
1
+ from naas_abi_core.module.Module import (
2
+ BaseModule,
3
+ ModuleConfiguration,
4
+ ModuleDependencies,
5
+ )
6
+
7
+ # from naas_abi_core.services.object_storage.ObjectStorageService import ObjectStorageService
8
+ # from naas_abi_core.services.secret.Secret import Secret
9
+ # from naas_abi_core.services.triple_store.TripleStoreService import TripleStoreService
10
+ # from naas_abi_core.services.vector_store.VectorStoreService import VectorStoreService
11
+
12
+
13
+ class ABIModule(BaseModule):
14
+ dependencies: ModuleDependencies = ModuleDependencies(
15
+ modules=[
16
+ "naas_abi_marketplace.ai.chatgpt",
17
+ ],
18
+ services=[
19
+ # Secret,
20
+ # TripleStoreService,
21
+ # ObjectStorageService,
22
+ # VectorStoreService
23
+ ],
24
+ )
25
+
26
+ class Configuration(ModuleConfiguration):
27
+ pass
28
+ # example: str
29
+
30
+ def on_initialized(self):
31
+ super().on_initialized()
@@ -0,0 +1,52 @@
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 = "{{project_name_snake}} Agent"
10
+ DESCRIPTION = "An helpful agent that can help you with your tasks."
11
+ SYSTEM_PROMPT = """
12
+ You are {{project_name_snake}} 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 {{project_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 {{project_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 {{project_name_pascal}}Agent(Agent):
52
+ pass
@@ -2,6 +2,20 @@ import os
2
2
  import shutil
3
3
 
4
4
  import jinja2
5
+ import rich
6
+ from jinja2 import Environment, meta
7
+
8
+
9
+ class ValueProvider(dict):
10
+ def collect_values(self, template_string: str) -> dict:
11
+ env = Environment() # add your filters/tests if you use them
12
+ ast = env.parse(template_string)
13
+ needed = meta.find_undeclared_variables(ast)
14
+
15
+ for name in sorted(needed):
16
+ if name in self:
17
+ continue
18
+ self[name] = rich.prompt.Prompt.ask(f"Enter value for '{name}'")
5
19
 
6
20
 
7
21
  class Copier:
@@ -14,21 +28,24 @@ class Copier:
14
28
  self.templates_path = os.path.abspath(templates_path)
15
29
  self.destination_path = os.path.abspath(destination_path)
16
30
 
17
- def template_file_to_file(
18
- self, template_path: str, values: dict, destination_path: str
31
+ def _template_file_to_file(
32
+ self, template_path: str, values: ValueProvider, destination_path: str
19
33
  ) -> None:
20
- destination_path = self.template_string(destination_path, values)
34
+ destination_path = self._template_string(destination_path, values)
21
35
  with open(destination_path, "w", encoding="utf-8") as file:
22
- file.write(self.template_file(template_path, values))
36
+ file.write(self._template_file(template_path, values))
23
37
 
24
- def template_file(self, template_path: str, values: dict) -> str:
38
+ def _template_file(self, template_path: str, values: ValueProvider) -> str:
25
39
  with open(template_path, "r", encoding="utf-8") as file:
26
- return self.template_string(file.read(), values)
40
+ return self._template_string(file.read(), values)
27
41
 
28
- def template_string(self, template_string: str, values: dict) -> str:
42
+ def _template_string(self, template_string: str, values: ValueProvider) -> str:
43
+ values.collect_values(template_string)
29
44
  return jinja2.Template(template_string).render(values)
30
45
 
31
46
  def copy(self, values: dict, templates_path: str | None = None):
47
+ vp = ValueProvider(values)
48
+
32
49
  if templates_path is None:
33
50
  templates_path = self.templates_path
34
51
  elif not os.path.isabs(templates_path):
@@ -45,22 +62,23 @@ class Copier:
45
62
 
46
63
  for file in os.listdir(templates_path):
47
64
  if os.path.isfile(os.path.join(templates_path, file)):
48
- if "config" in file and file.endswith(".yaml"):
65
+ if False and "config" in file and file.endswith(".yaml"):
49
66
  shutil.copy(
50
67
  os.path.join(templates_path, file),
51
- self.template_string(os.path.join(target_path, file), values),
68
+ self._template_string(os.path.join(target_path, file), vp),
52
69
  )
53
70
  else:
54
- self.template_file_to_file(
71
+ self._template_file_to_file(
55
72
  os.path.join(templates_path, file),
56
- values,
73
+ vp,
57
74
  os.path.join(target_path, file),
58
75
  )
59
76
  elif os.path.isdir(os.path.join(templates_path, file)):
60
77
  os.makedirs(
61
- self.template_string(os.path.join(target_path, file), values),
78
+ self._template_string(os.path.join(target_path, file), vp),
62
79
  exist_ok=True,
63
80
  )
64
81
  self.copy(values, os.path.join(templates_path, file))
65
82
  else:
66
83
  print(f"Skipping {file}")
84
+ print(f"Skipping {file}")
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "naas-abi-cli"
3
- version = "1.4.3"
3
+ version = "1.5.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"
@@ -64,10 +64,10 @@ prerelease = true
64
64
  prerelease_token = "dev"
65
65
 
66
66
  [tool.hatch.build.targets.wheel]
67
- force-include = { "naas_abi_cli/cli/new/templates/project/config.yaml" = "naas_abi_cli/cli/new/templates/project/config.yaml" }
67
+ force-include = {"naas_abi_cli/cli/new/templates/project/config.yaml" = "naas_abi_cli/cli/new/templates/project/config.yaml", "naas_abi_cli/cli/new/templates/project/config.prod.yaml" = "naas_abi_cli/cli/new/templates/project/config.prod.yaml"}
68
68
 
69
69
  [tool.hatch.build.targets.sdist]
70
- force-include = { "naas_abi_cli/cli/new/templates/project/config.yaml" = "naas_abi_cli/cli/new/templates/project/config.yaml" }
70
+ force-include = {"naas_abi_cli/cli/new/templates/project/config.yaml" = "naas_abi_cli/cli/new/templates/project/config.yaml", "naas_abi_cli/cli/new/templates/project/config.prod.yaml" = "naas_abi_cli/cli/new/templates/project/config.prod.yaml"}
71
71
 
72
72
  [tool.uv.sources]
73
73
  naas-abi = { path = "../naas-abi", editable = true }
@@ -1,6 +0,0 @@
1
- Collecting uv
2
- Downloading uv-0.9.25-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)
3
- Downloading uv-0.9.25-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (22.3 MB)
4
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 22.3/22.3 MB 193.9 MB/s 0:00:00
5
- Installing collected packages: uv
6
- Successfully installed uv-0.9.25
File without changes
File without changes
File without changes