a2a-source-edit: write agent.py

This commit is contained in:
a2a-cloud
2026-07-18 09:24:52 +00:00
parent c9aeb51b86
commit 541fb69284

View File

@@ -47,6 +47,10 @@ class LaunchCheckStudioV1Config(BaseModel):
max_response_bytes: int = Field(default=MAX_RESPONSE_BYTES, ge=32_000, le=1_000_000)
class LaunchCheckStudioV1State(BaseModel):
storage: str = "managed-postgres"
@dataclass(frozen=True)
class FetchResult:
final_url: str
@@ -112,6 +116,7 @@ class LaunchCheckStudioV1(A2AAgent[LaunchCheckStudioV1Config, PlatformUserAuth])
auth_model = PlatformUserAuth
state = State.DURABLE
state_model = LaunchCheckStudioV1State
resources = Resources(cpu="500m", memory="512Mi", max_runtime_seconds=120)
egress = EgressPolicy(deny_internet_by_default=False)
tools_used = ("httpx", "psycopg", "postgres")
@@ -276,7 +281,7 @@ async def _validate_public_url(raw_url: str) -> dict[str, Any]:
netloc = host
if parsed.port:
netloc = f"{host}:{parsed.port}"
normalized = urlunparse((parsed.scheme.lower(), netloc, parsed.path or "/", "", parsed.query, ""))
normalized = urlunparse((parsed.scheme.lower(), netloc, parsed.path or "", "", parsed.query, ""))
return {"ok": True, "url": normalized}