Skip to content

Commit cfcbbd6

Browse files
wukathcopybara-github
authored andcommitted
chore: For bug bashing with staging express mode API
Co-authored-by: Kathy Wu <wukathy@google.com> PiperOrigin-RevId: 895510871
1 parent bbad9ec commit cfcbbd6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/google/adk/cli/utils/gcp_utils.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
from __future__ import annotations
1818

19+
import logging
1920
import subprocess
2021
from typing import Any
2122
from typing import Dict
@@ -30,7 +31,11 @@
3031
from google.cloud import resourcemanager_v3
3132
import requests
3233

33-
_VERTEX_AI_ENDPOINT = "https://{location}-aiplatform.googleapis.com/v1beta1"
34+
logger = logging.getLogger("google_adk." + __name__)
35+
36+
_VERTEX_AI_ENDPOINT = (
37+
"https://{location}-staging-aiplatform.sandbox.googleapis.com/v1beta1"
38+
)
3439

3540

3641
def check_adc() -> bool:
@@ -89,6 +94,7 @@ def _call_vertex_express_api(
8994
raise ValueError(f"Unsupported method: {method}")
9095

9196
response.raise_for_status()
97+
logging.info("API Response: %s", response.text)
9298
return response.json()
9399

94100

@@ -126,7 +132,7 @@ def check_express_eligibility(
126132
result = _call_vertex_express_api(
127133
"GET", "/Eligibility:check", location=location
128134
)
129-
return result.get("eligibility") == "IN_SCOPE"
135+
return result.get("eligibility") in ["IN_SCOPE", "ELIGIBLE"]
130136
except (requests.exceptions.HTTPError, KeyError) as e:
131137
return False
132138

0 commit comments

Comments
 (0)