From cfcbbd63f66654f36061d13c8b7a3c056fd2ed15 Mon Sep 17 00:00:00 2001 From: Kathy Wu Date: Mon, 6 Apr 2026 14:48:03 -0700 Subject: [PATCH] chore: For bug bashing with staging express mode API Co-authored-by: Kathy Wu PiperOrigin-RevId: 895510871 --- src/google/adk/cli/utils/gcp_utils.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/google/adk/cli/utils/gcp_utils.py b/src/google/adk/cli/utils/gcp_utils.py index ac186a2f91..0aee97b629 100644 --- a/src/google/adk/cli/utils/gcp_utils.py +++ b/src/google/adk/cli/utils/gcp_utils.py @@ -16,6 +16,7 @@ from __future__ import annotations +import logging import subprocess from typing import Any from typing import Dict @@ -30,7 +31,11 @@ from google.cloud import resourcemanager_v3 import requests -_VERTEX_AI_ENDPOINT = "https://{location}-aiplatform.googleapis.com/v1beta1" +logger = logging.getLogger("google_adk." + __name__) + +_VERTEX_AI_ENDPOINT = ( + "https://{location}-staging-aiplatform.sandbox.googleapis.com/v1beta1" +) def check_adc() -> bool: @@ -89,6 +94,7 @@ def _call_vertex_express_api( raise ValueError(f"Unsupported method: {method}") response.raise_for_status() + logging.info("API Response: %s", response.text) return response.json() @@ -126,7 +132,7 @@ def check_express_eligibility( result = _call_vertex_express_api( "GET", "/Eligibility:check", location=location ) - return result.get("eligibility") == "IN_SCOPE" + return result.get("eligibility") in ["IN_SCOPE", "ELIGIBLE"] except (requests.exceptions.HTTPError, KeyError) as e: return False