rusticai-api 0.0.2__tar.gz → 0.0.4__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.
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/PKG-INFO +3 -3
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/pyproject.toml +4 -4
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/guilds/service.py +10 -1
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/main.py +12 -5
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/README.md +0 -0
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/__init__.py +0 -0
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/api_dependency_manager.py +0 -0
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/catalog/__init__.py +0 -0
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/catalog/catalog_store.py +0 -0
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/catalog/models.py +0 -0
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/catalog/router.py +0 -0
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/guilds/__init__.py +0 -0
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/guilds/comms_manager.py +0 -0
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/guilds/router.py +0 -0
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/guilds/schema.py +0 -0
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/guilds/socket.py +0 -0
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/guilds/system_comms_manager.py +0 -0
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/logging/__init__.py +0 -0
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/logging/config.py +0 -0
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/logging/format.py +0 -0
- {rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/main_debug.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: rusticai-api
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.4
|
|
4
4
|
Summary: API Server for Rustic AI
|
|
5
5
|
Home-page: https://www.rustic.ai/
|
|
6
6
|
License: Apache-2.0
|
|
@@ -18,8 +18,8 @@ Requires-Dist: opentelemetry-distro (>=0.52b1,<0.53)
|
|
|
18
18
|
Requires-Dist: psycopg (>=3.2.6,<4.0.0)
|
|
19
19
|
Requires-Dist: ptvsd (>=4.3.2,<5.0.0)
|
|
20
20
|
Requires-Dist: python-multipart (>=0.0.20,<0.0.21)
|
|
21
|
-
Requires-Dist: rusticai-core (
|
|
22
|
-
Requires-Dist: rusticai-ray (
|
|
21
|
+
Requires-Dist: rusticai-core (==0.0.6)
|
|
22
|
+
Requires-Dist: rusticai-ray (==0.0.5)
|
|
23
23
|
Requires-Dist: starlette (>=0.45.3,<0.46.0)
|
|
24
24
|
Requires-Dist: uvicorn (>=0.34.0,<0.35.0)
|
|
25
25
|
Requires-Dist: websockets (>=15.0.1,<16.0.0)
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "rusticai-api"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.4"
|
|
8
8
|
description = "API Server for Rustic AI"
|
|
9
9
|
authors = ["Dragonscale Industries Inc. <dev@dragonscale.ai>"]
|
|
10
10
|
license = "Apache-2.0"
|
|
@@ -18,8 +18,8 @@ packages = [{ include = "rustic_ai", from = "src" }]
|
|
|
18
18
|
|
|
19
19
|
[tool.poetry.dependencies]
|
|
20
20
|
python = "^3.12"
|
|
21
|
-
rusticai-core =
|
|
22
|
-
rusticai-ray =
|
|
21
|
+
rusticai-core = "0.0.6"
|
|
22
|
+
rusticai-ray = "0.0.5"
|
|
23
23
|
fastapi = "^0.115.8"
|
|
24
24
|
starlette = "^0.45.3"
|
|
25
25
|
uvicorn = "^0.34.0"
|
|
@@ -45,7 +45,7 @@ isort = "^6.0.0"
|
|
|
45
45
|
mypy = "^1.15.0"
|
|
46
46
|
pytest-asyncio = "^0.25.3"
|
|
47
47
|
httpx = "^0.28.1"
|
|
48
|
-
rusticai-testing = {
|
|
48
|
+
rusticai-testing = { path = "../testing", develop = true }
|
|
49
49
|
|
|
50
50
|
[tool.poetry.extras]
|
|
51
51
|
test = ["pytest", "pytest-asyncio", "httpx", "rusticai-testing"]
|
|
@@ -3,7 +3,7 @@ from typing import Optional
|
|
|
3
3
|
from sqlalchemy import Engine
|
|
4
4
|
|
|
5
5
|
from rustic_ai.core.guild import GuildSpec
|
|
6
|
-
from rustic_ai.core.guild.builders import GuildBuilder
|
|
6
|
+
from rustic_ai.core.guild.builders import GuildBuilder, GuildHelper
|
|
7
7
|
from rustic_ai.core.guild.metastore import GuildStore
|
|
8
8
|
|
|
9
9
|
|
|
@@ -13,6 +13,15 @@ class GuildService:
|
|
|
13
13
|
"""
|
|
14
14
|
Creates a new guild and adds it to the database.
|
|
15
15
|
"""
|
|
16
|
+
if guild_spec.get_messaging() is None:
|
|
17
|
+
default_messaging = GuildHelper.get_default_messaging_config()
|
|
18
|
+
guild_spec.set_messaging(**default_messaging)
|
|
19
|
+
|
|
20
|
+
if guild_spec.get_execution_engine() is None:
|
|
21
|
+
guild_spec.set_execution_engine(GuildHelper.get_default_execution_engine())
|
|
22
|
+
|
|
23
|
+
guild_spec.dependency_map = GuildHelper.get_guild_dependency_map(guild_spec)
|
|
24
|
+
|
|
16
25
|
guild = GuildBuilder.from_spec(guild_spec).bootstrap(metastore_url)
|
|
17
26
|
|
|
18
27
|
return guild.id
|
|
@@ -26,15 +26,22 @@ logging.basicConfig(
|
|
|
26
26
|
handlers=[ch],
|
|
27
27
|
)
|
|
28
28
|
|
|
29
|
-
INITIALIZE_RAY_CLUSTER = os.environ.get("RUSTIC_INIT_RAY_CLUSTER", "False")
|
|
30
|
-
|
|
31
|
-
ray.init(include_dashboard=True)
|
|
29
|
+
INITIALIZE_RAY_CLUSTER = os.environ.get("RUSTIC_INIT_RAY_CLUSTER", "False").lower() == "true"
|
|
30
|
+
LAUNCH_RAY_DASHBOARD = os.environ.get("RUSTIC_LAUNCH_RAY_DASHBOARD", "False").lower() == "true"
|
|
32
31
|
|
|
32
|
+
if INITIALIZE_RAY_CLUSTER:
|
|
33
|
+
|
|
34
|
+
logging.info("Initializing Ray cluster")
|
|
35
|
+
ray.init(
|
|
36
|
+
include_dashboard=LAUNCH_RAY_DASHBOARD,
|
|
37
|
+
log_to_driver=False,
|
|
38
|
+
)
|
|
39
|
+
logging.info("Ray cluster initialized")
|
|
40
|
+
logging.info("Ray cluster details: {}".format(ray.get_runtime_context()))
|
|
33
41
|
|
|
34
42
|
if not Metastore.is_initialized():
|
|
35
43
|
rustic_metastore = os.environ.get("RUSTIC_METASTORE", "sqlite:///rustic_app.db")
|
|
36
44
|
Metastore.initialize_engine(rustic_metastore)
|
|
37
|
-
|
|
38
45
|
app = FastAPI(title="Rustic AI API", lifespan=lifespan)
|
|
39
46
|
app.include_router(guilds.router, prefix="/api")
|
|
40
47
|
app.include_router(guilds.socket, prefix="/ws")
|
|
@@ -61,7 +68,7 @@ def health_check():
|
|
|
61
68
|
async def global_exception_handler(request: Request, exc: StarletteHTTPException):
|
|
62
69
|
"""
|
|
63
70
|
Global exception handler function that handles any exception raised in the FastAPI application.
|
|
64
|
-
|
|
71
|
+
The recommended approach is to register an exception handler for Starlette's HTTPException and
|
|
65
72
|
reuse the default exception handlers from fastapi.exception_handlers.
|
|
66
73
|
References:
|
|
67
74
|
https://fastapi.tiangolo.com/tutorial/handling-errors/#fastapis-httpexception-vs-starlettes-httpexception
|
|
File without changes
|
|
File without changes
|
{rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/api_dependency_manager.py
RENAMED
|
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
|
{rusticai_api-0.0.2 → rusticai_api-0.0.4}/src/rustic_ai/api_server/guilds/system_comms_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|