From 63e378e43902eaf0dda01cfbf5faefcb51e8b3c8 Mon Sep 17 00:00:00 2001 From: a2a-cloud Date: Sat, 18 Jul 2026 05:13:58 +0000 Subject: [PATCH] a2a-source-edit: write agent.py --- agent.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/agent.py b/agent.py index 7605d64..4e2a163 100644 --- a/agent.py +++ b/agent.py @@ -55,6 +55,12 @@ class QuoteJudgeStudioV1Config(BaseModel): """No user-configurable settings; all state is tenant-scoped by platform auth.""" +class QuoteJudgeDurableState(BaseModel): + """Marker state model: durable product state lives in managed Postgres.""" + + database: str = "quote-judge-studio-v1-data" + + class QuoteInput(BaseModel): vendor: str = Field(..., min_length=1, max_length=120) unit_price: float = Field(..., gt=0, le=1_000_000) @@ -103,12 +109,13 @@ class QuoteJudgeStudioV1(A2AAgent[QuoteJudgeStudioV1Config, PlatformUserAuth]): "weights; persist results; reopen prior comparisons; accept browser " "base64 uploads and typed FileUpload inputs; and persist execution receipts." ) - version = "0.1.1" + version = "0.1.2" config_model = QuoteJudgeStudioV1Config auth_model = PlatformUserAuth state = State.DURABLE + state_model = QuoteJudgeDurableState resources = Resources(cpu="500m", memory="512Mi", max_runtime_seconds=120) pricing = Pricing( price_per_call_usd=0.0, @@ -251,7 +258,7 @@ class QuoteJudgeStudioV1(A2AAgent[QuoteJudgeStudioV1Config, PlatformUserAuth]): return _validation_result(comparison_id, issues) try: data = ctx.workspace.read_bytes(quote_file.path) # concrete runtime clients expose this helper - except Exception as exc: # noqa: BLE001 + except Exception: # noqa: BLE001 return _validation_result( comparison_id, [ValidationIssue(code="upload_read_failed", message="The uploaded file could not be read from the invocation workspace.", field="quote_file", action=f"Re-upload the file and ensure it is below {MAX_BROWSER_UPLOAD_BYTES} bytes.")],