agent
This commit is contained in:
18
agent/app/core/manifest_client.py
Normal file
18
agent/app/core/manifest_client.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from urllib.parse import quote
|
||||
|
||||
import httpx
|
||||
|
||||
from app.config import settings
|
||||
|
||||
|
||||
class ManifestClient:
|
||||
def fetch_manifest(self, app_id: str, version: str) -> dict:
|
||||
app_id_part = quote(app_id, safe="")
|
||||
version_part = quote(version, safe="")
|
||||
url = f"{settings.robot_package_base_url}/api/apps/{app_id_part}/versions/{version_part}/manifest"
|
||||
response = httpx.get(url, follow_redirects=True, timeout=30)
|
||||
response.raise_for_status()
|
||||
return response.json()
|
||||
|
||||
Reference in New Issue
Block a user