Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master app creation #49

Merged
merged 2 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
539 changes: 214 additions & 325 deletions poetry.lock

Large diffs are not rendered by default.

84 changes: 44 additions & 40 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,56 +1,60 @@
[tool.poetry]
[project]
name = "superagentx"
version = "0.1.15b"
version = "0.1.15c"
description = "The Ultimate Modular Autonomous Multi AI Agent Framework."
license = "MIT"
license = { text = "MIT" }
authors = [
"SuperAgentX AI <[email protected]>",
{ name = "SuperAgentX AI", email = "<[email protected]>"},
]
maintainers = [
"SuperAgentX AI <[email protected]>",
{ name = "SuperAgentX AI", email = "<[email protected]>"},
]
readme = "README.md"

keywords = ["superagentX", "AGI", "Agentic AI", "ASI", "superagentx", "agent", "LLM", "cli"]
requires-python = ">=3.10,<=3.13"

dependencies = [
"pydantic>=2.8.2",
"boto3>=1.35.8",
"bokeh>=3.5.2",
"openai>=1.47.1",
"exa-py>=1.1.4",
"neo4j>=5.24.0",
"chromadb>=0.5.5",
"opensearch-py>=2.7.1",
"elasticsearch>=8.15.1",
"aiohttp>=3.10.8",
"rich>=13.9.2",
"protobuf>=3.20.3",
"aiosqlite>=0.20.0",
"websockets>=13.1",
"amazon-transcribe>=0.6.2",
"scipy>=1.15.1",
"numpy>=2.2.1",
"aiofiles>=24.1.0",
"ollama>=0.4.7",
"camel-converter>=4.0.1"
]

[project.urls]
homepage = "https://www.superagentx.ai/"
repository = "https://github.com/superagentxai/superagentx"
documentation = "https://docs.superagentx.ai/"
keywords = ["superagentX", "AGI", "Agentic AI", "ASI", "superagentx", "agent", "LLM", "cli"]

[project.scripts]
superagentx-cli = "superagentx_cli.main:app"
superagentx-app = "superagentx_cli.cli_app:app"

[project.optional-dependencies]
cli = [ "jinja2>=3.1.4", "typer>=0.13.0", "rich>=13.9.2", "yapf>=0.43.0" ]

[tool.poetry]
packages = [
{ include = "superagentx" },
{ include = "superagentx_cli" }
]

[tool.poetry.scripts]
superagentx-cli = "superagentx_cli.main:app"

[tool.poetry.dependencies]
python = ">=3.10,<=3.13"
pydantic = "^2.8.2"
boto3 = "^1.35.8"
bokeh = "^3.5.2"
openai = "^1.47.1"
exa-py = "^1.1.4"
neo4j = "^5.24.0"
chromadb = "^0.5.5"
opensearch-py = "^2.7.1"
elasticsearch = "^8.15.1"
aiohttp = "^3.10.8"
rich = "^13.9.2"
protobuf = "3.20.3"
aiosqlite = "^0.20.0"
typer = { version = "^0.13.0", optional = true }
jinja2 = { version = "^3.1.4", optional = true }
websockets = "^13.1"
amazon-transcribe = "^0.6.2"
scipy = "^1.15.1"
numpy = "^2.2.1"
aiofiles = "^24.1.0"
ollama = "^0.4.7"
camel-converter = "^4.0.1"
yapf = "^0.43.0"

[tool.poetry.extras]
cli = ["jinja2", "typer", "rich"]

[tool.poetry.group.test.dependencies]
pytest = "^8.3.3"
pytest-asyncio = "^0.24.0"
Expand All @@ -59,5 +63,5 @@ pytest-asyncio = "^0.24.0"
asyncio_mode = "auto"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
7 changes: 5 additions & 2 deletions superagentx_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys
import uuid
from enum import Enum
from os import PathLike
from pathlib import Path
from typing import Any

Expand Down Expand Up @@ -246,7 +247,8 @@ def __init__(
author_email: str = '[email protected]',
maintainer_name: str = 'Example Maintainer',
maintainer_email: str = '[email protected]',
app_config: dict | None = None
app_config: dict | None = None,
app_dir_path: str | PathLike | None = None
):

self.app_name = name
Expand All @@ -267,7 +269,8 @@ def __init__(
self.author_email =author_email
self.maintainer_name = maintainer_name
self.maintainer_email = maintainer_email
self._app_dir = Path().cwd() / self.app_name
_app_dir = Path(app_dir_path) if app_dir_path else Path().cwd()
self._app_dir = _app_dir / self.app_name
self._config_dir = self._app_dir / 'config'
self._pkg_dir = self._app_dir / self.package_name
self._jinja_env = Environment(
Expand Down
29 changes: 29 additions & 0 deletions superagentx_cli/cli_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import json
from typing import Annotated, Optional

import typer
from superagentx_cli.cli import CliApp

app = typer.Typer(name='Superagentx-App')


@app.command(name='app')
def main(
app_config_path: Annotated[str, typer.Option(
help='Application configuration path.'
)],
app_dir_path: Annotated[Optional[str], typer.Option(
help='Application will be created in the given dir path.'
' Default will be current execution path.'
)] = None
):
with open(app_config_path, 'r') as fobj:
app_config = json.load(fobj)
cli_app = CliApp(
app_config=app_config,
app_dir_path=app_dir_path
)
cli_app.create_project()

if __name__ == '__main__':
app()
2 changes: 1 addition & 1 deletion superagentx_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def create(
callback=validate_project_name
),
app_type: CliAppTypeEnum = typer.Option(
CliAppTypeEnum.all.value,
default=CliAppTypeEnum.all.value,
prompt='Enter one of the option',
rich_help_panel='App Types'
)
Expand Down
84 changes: 84 additions & 0 deletions tests/cli_app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"appName": "Sample Ecom",
"appType": "all",
"appAuthToken": null,
"llm": [
{
"title": "LLM-1",
"llmConfig": {
"llmType": "bedrock",
"model": "bedrock",
"apiKey": "string",
"baseUrl": "string",
"apiVersion": "string",
"asyncMode": true,
"embedModel": "string"
}
}
],
"memory": [
{
"title": "memory-1",
"memoryConfig": {
"llmClient": "llm-1",
"vectorStore": "string",
"dbPath": "string"
}
}
],
"handlerConfig": [
{
"title": "Handler-1",
"handlerName": "AIHandler",
"attributes": {},
"srcPath": "superagentx.handler"
}
],
"promptTemplateConfig": [
{
"title": "prompt 1",
"promptType": null,
"systemMessage": null
}
],
"engineConfig": [
{
"title": "Engine 1",
"handler": "Handler-1",
"llm": "LLM-1",
"promptTemplate": "prompt 1",
"tools": null,
"outputParser": null
}
],
"agentConfig": [
{
"title": "Agent 1",
"goal": "string",
"role": "string",
"llm": "LLM-1",
"promptTemplate": "prompt 1",
"agentId": null,
"name": null,
"description": "string",
"engines": [
"Engine 1"
],
"outputFormat": null,
"maxRetry": 2
}
],
"pipeConfig": [
{
"title": "Sample Ecom 1",
"pipeId": null,
"name": "Agent Pipe 1",
"description": "string",
"agents": [
"Agent 1"
],
"memory": "memory-1",
"stopIfGoalIsNotSatisfied": true
}
]
}
86 changes: 6 additions & 80 deletions tests/cli_app.py
Original file line number Diff line number Diff line change
@@ -1,83 +1,9 @@
d = {
"appName": "Sample Ecom",
"appType": "all",
"appAuthToken": None,
"llm": [
{
"title": "LLM-1",
"llmConfig": {
"llmType": "bedrock",
"model": "bedrock",
"apiKey": "string",
"baseUrl": "string",
"apiVersion": "string",
"asyncMode": True,
"embedModel": "string"
}
}
],
"memory": [
{
"title": "memory-1",
"memoryConfig": {
"llmClient": "llm-1",
"vectorStore": "string",
"dbPath": "string"
}
}
],
"handlerConfig": [
{
"title": "Handler-1",
"handlerName": "AIHandler",
"attributes": {},
"srcPath": "superagentx.handler"
}
],
"promptTemplateConfig": [
{
"title": "prompt 1",
"promptType": None,
"systemMessage": None
}
],
"engineConfig": [
{
"title": "Engine 1",
"handler": "Handler-1",
"llm": "LLM-1",
"promptTemplate": "prompt 1",
"tools": None,
"outputParser": None
}
],
"agentConfig": [
{
"title": "Agent 1",
"goal": "string",
"role": "string",
"llm": "LLM-1",
"promptTemplate": "prompt 1",
"agentId": None,
"name": None,
"description": "string",
"engines": ["Engine 1"],
"outputFormat": None,
"maxRetry": 2
}
],
"pipeConfig": [
{
"title": "Sample Ecom 1",
"pipeId": None,
"name": "Agent Pipe 1",
"description": "string",
"agents": ["Agent 1"],
"memory": "memory-1",
"stopIfGoalIsNotSatisfied": True
}
]
}
import json
import os.path
from pathlib import Path

with open(os.path.join(os.path.dirname(__file__), 'cli_app.json'), 'rb') as fobj:
d = json.load(fobj)

from superagentx_cli.cli import CliApp

Expand Down