Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/google/adk/cli/utils/gcp_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

from __future__ import annotations

import logging
import subprocess
from typing import Any
from typing import Dict
Expand All @@ -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:
Expand Down Expand Up @@ -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()


Expand Down Expand Up @@ -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

Expand Down
Loading