llama-deploy-core 0.3.0a13__py3-none-any.whl → 0.3.0a14__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.
- llama_deploy/core/client/manage_client.py +31 -0
- llama_deploy/core/schema/projects.py +13 -0
- llama_deploy/core/schema/public.py +2 -0
- {llama_deploy_core-0.3.0a13.dist-info → llama_deploy_core-0.3.0a14.dist-info}/METADATA +1 -1
- {llama_deploy_core-0.3.0a13.dist-info → llama_deploy_core-0.3.0a14.dist-info}/RECORD +6 -6
- {llama_deploy_core-0.3.0a13.dist-info → llama_deploy_core-0.3.0a14.dist-info}/WHEEL +0 -0
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from contextlib import asynccontextmanager
|
|
1
4
|
from typing import AsyncIterator, Callable, List
|
|
2
5
|
|
|
3
6
|
import httpx
|
|
@@ -70,6 +73,20 @@ class BaseClient:
|
|
|
70
73
|
class ControlPlaneClient(BaseClient):
|
|
71
74
|
"""Unscoped client for non-project endpoints."""
|
|
72
75
|
|
|
76
|
+
@classmethod
|
|
77
|
+
@asynccontextmanager
|
|
78
|
+
async def ctx(
|
|
79
|
+
cls, base_url: str, api_key: str | None = None
|
|
80
|
+
) -> AsyncIterator[ControlPlaneClient]:
|
|
81
|
+
client = cls(base_url, api_key)
|
|
82
|
+
try:
|
|
83
|
+
yield client
|
|
84
|
+
finally:
|
|
85
|
+
try:
|
|
86
|
+
await client.aclose()
|
|
87
|
+
except Exception:
|
|
88
|
+
pass
|
|
89
|
+
|
|
73
90
|
def __init__(self, base_url: str, api_key: str | None = None) -> None:
|
|
74
91
|
super().__init__(base_url, api_key)
|
|
75
92
|
|
|
@@ -86,6 +103,20 @@ class ControlPlaneClient(BaseClient):
|
|
|
86
103
|
class ProjectClient(BaseClient):
|
|
87
104
|
"""Project-scoped client for deployment operations."""
|
|
88
105
|
|
|
106
|
+
@classmethod
|
|
107
|
+
@asynccontextmanager
|
|
108
|
+
async def ctx(
|
|
109
|
+
cls, base_url: str, project_id: str, api_key: str | None = None
|
|
110
|
+
) -> AsyncIterator[ProjectClient]:
|
|
111
|
+
client = cls(base_url, project_id, api_key)
|
|
112
|
+
try:
|
|
113
|
+
yield client
|
|
114
|
+
finally:
|
|
115
|
+
try:
|
|
116
|
+
await client.aclose()
|
|
117
|
+
except Exception:
|
|
118
|
+
pass
|
|
119
|
+
|
|
89
120
|
def __init__(
|
|
90
121
|
self,
|
|
91
122
|
base_url: str,
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
from pydantic import model_validator
|
|
4
|
+
|
|
1
5
|
from .base import Base
|
|
2
6
|
|
|
3
7
|
|
|
@@ -8,6 +12,15 @@ class ProjectSummary(Base):
|
|
|
8
12
|
project_name: str
|
|
9
13
|
deployment_count: int
|
|
10
14
|
|
|
15
|
+
@model_validator(mode="before")
|
|
16
|
+
@classmethod
|
|
17
|
+
def set_default_project_name(cls, data: Any) -> Any:
|
|
18
|
+
if isinstance(data, dict):
|
|
19
|
+
if "project_name" not in data or data.get("project_name") is None:
|
|
20
|
+
if "project_id" in data:
|
|
21
|
+
data["project_name"] = data["project_id"]
|
|
22
|
+
return data
|
|
23
|
+
|
|
11
24
|
|
|
12
25
|
class ProjectsListResponse(Base):
|
|
13
26
|
"""Response model for listing projects with deployment counts"""
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
llama_deploy/core/__init__.py,sha256=112612bf2e928c2e0310d6556bb13fc28c00db70297b90a8527486cd2562e408,43
|
|
2
|
-
llama_deploy/core/client/manage_client.py,sha256=
|
|
2
|
+
llama_deploy/core/client/manage_client.py,sha256=0f2f63c0d5ba657580af758edd5c5f07602061d7ae13a5964ff82b71127d8324,8542
|
|
3
3
|
llama_deploy/core/config.py,sha256=69bb0ea8ac169eaa4e808cd60a098b616bddd3145d26c6c35e56db38496b0e6a,35
|
|
4
4
|
llama_deploy/core/deployment_config.py,sha256=b052fa66bd140fa39dea2de6cda362b39f8aca22f9c1cc0011c9f4a025263d0c,15117
|
|
5
5
|
llama_deploy/core/git/git_util.py,sha256=c581c1da13871b4e89eda58f56ddb074139454c06ae9b04c0b396fdb2b9a5176,9193
|
|
@@ -9,13 +9,13 @@ llama_deploy/core/schema/__init__.py,sha256=d1459ee50c690779a682130eff72f61dc1a6
|
|
|
9
9
|
llama_deploy/core/schema/base.py,sha256=2de6d23e58c36b6bb311ec0aea4b902661867056c1250c6b7ce3bad17141fe15,677
|
|
10
10
|
llama_deploy/core/schema/deployments.py,sha256=d9254d9a478d7aeaf3d28ec6205215ea892dcfb245966d726d69d0418e03b03d,6486
|
|
11
11
|
llama_deploy/core/schema/git_validation.py,sha256=27b306aa6ecabe58cab6381d92551545f263fe7550c58b3087115410bc71fd21,1915
|
|
12
|
-
llama_deploy/core/schema/projects.py,sha256=
|
|
13
|
-
llama_deploy/core/schema/public.py,sha256=
|
|
12
|
+
llama_deploy/core/schema/projects.py,sha256=726f91e90ff8699c90861d9740819c44c3f00d945ab09df71bd6d35fdc218a45,726
|
|
13
|
+
llama_deploy/core/schema/public.py,sha256=022129c8fc09192f5e503b0500ccf54d106f5712b9cf8ce84b3b1c37e186f930,147
|
|
14
14
|
llama_deploy/core/server/manage_api/__init__.py,sha256=e477ccab59cfd084edbad46f209972a282e623eb314d0847a754a46a16361db5,457
|
|
15
15
|
llama_deploy/core/server/manage_api/_abstract_deployments_service.py,sha256=85ceab2a343c3642db7f77d4a665d5710a14bca920bbfdc25c5f1168cce30b22,4638
|
|
16
16
|
llama_deploy/core/server/manage_api/_create_deployments_router.py,sha256=cde496f5922a74ae6199224abb25aefa1a357bb45c06ce25de79283d6f1a7174,6622
|
|
17
17
|
llama_deploy/core/server/manage_api/_exceptions.py,sha256=ee71cd9c2354a665e6905cd9cc752d2d65f71f0b936d33fec3c1c5229c38accf,246
|
|
18
18
|
llama_deploy/core/ui_build.py,sha256=290dafa951918e5593b9035570fa4c66791d7e5ea785bd372ad11e99e8283857,1514
|
|
19
|
-
llama_deploy_core-0.3.
|
|
20
|
-
llama_deploy_core-0.3.
|
|
21
|
-
llama_deploy_core-0.3.
|
|
19
|
+
llama_deploy_core-0.3.0a14.dist-info/WHEEL,sha256=66530aef82d5020ef5af27ae0123c71abb9261377c5bc519376c671346b12918,79
|
|
20
|
+
llama_deploy_core-0.3.0a14.dist-info/METADATA,sha256=8d13ddc1e6b6ec292b5715931f95f41ac5733af8d74183bd3fb423df80476d4f,659
|
|
21
|
+
llama_deploy_core-0.3.0a14.dist-info/RECORD,,
|
|
File without changes
|