ship grants, a2a_client, discovery, sandbox SDK + tests
This commit is contained in:
@@ -88,6 +88,37 @@ class ControlPlaneClient:
|
||||
},
|
||||
)
|
||||
|
||||
def from_tarball(
|
||||
self,
|
||||
*,
|
||||
name: str,
|
||||
version: str,
|
||||
entrypoint: str,
|
||||
description: str,
|
||||
public: bool,
|
||||
tarball: bytes,
|
||||
) -> dict[str, Any]:
|
||||
with httpx.Client(timeout=120.0) as c:
|
||||
resp = c.post(
|
||||
f"{self.api_url}/v1/agents/from-tarball",
|
||||
headers={"authorization": f"bearer {self.token}"} if self.token else {},
|
||||
data={
|
||||
"name": name,
|
||||
"version": version,
|
||||
"entrypoint": entrypoint,
|
||||
"description": description,
|
||||
"public": str(public).lower(),
|
||||
},
|
||||
files={"source": ("source.tar.gz", tarball, "application/gzip")},
|
||||
)
|
||||
if resp.status_code >= 400:
|
||||
try:
|
||||
detail = resp.json().get("detail", resp.text)
|
||||
except Exception: # noqa: BLE001
|
||||
detail = resp.text
|
||||
raise ApiError(resp.status_code, str(detail))
|
||||
return resp.json()
|
||||
|
||||
def list_agents(self) -> list[dict[str, Any]]:
|
||||
return self._request("GET", "/v1/agents")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user