Skip to content

Commit e194d3d

Browse files
chore: upgrade dependencies and switch to us-east1 for brand-aligner-agent (#1744)
Co-authored-by: Shahin Saadati <happyhuman@users.noreply.github.com>
1 parent aac4324 commit e194d3d

16 files changed

Lines changed: 1141 additions & 1472 deletions

File tree

python/agents/brand-aligner/.env.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
GOOGLE_CLOUD_PROJECT="your-project-id"
2-
GOOGLE_CLOUD_LOCATION="us-central1"
2+
GOOGLE_CLOUD_LOCATION="us-east1"
33
GOOGLE_GENAI_USE_VERTEXAI=True
44

55
GOOGLE_CLOUD_AGENT_ENGINE_ENABLE_TELEMETRY="true"

python/agents/brand-aligner/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,5 @@ The agent relies on the following key environment variables (defined in `.env`):
148148
* `MODEL_NAME`: The name of the generative model to use for agent reasoning and evaluation (for example, `gemini-2.5-flash`).
149149
* `GCS_BUCKET_NAME`: The GCS bucket for storing artifacts and processed files.
150150
* `PROJECT_ID`: The Google Cloud Project ID.
151-
* `LOCATION`: The Google Cloud region (for example, `us-central1`).
151+
* `LOCATION`: The Google Cloud region (for example, `us-east1`).
152152
* `AUTH_ID`, `OAUTH_CLIENT_ID`, `OAUTH_CLIENT_SECRET`: Authentication credentials for the OAuth2 flow (if running in standalone mode).

python/agents/brand-aligner/brand_aligner_agent/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
import os
15+
1516
import google.auth
1617
from dotenv import load_dotenv
1718

@@ -23,4 +24,4 @@
2324
os.environ.setdefault("GOOGLE_CLOUD_LOCATION", "global")
2425
os.environ.setdefault("GOOGLE_GENAI_USE_VERTEXAI", "True")
2526

26-
from . import agent
27+
from . import agent # noqa: E402

python/agents/brand-aligner/brand_aligner_agent/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
)
2828
from .utils import after_model_callback
2929

30-
MODEL_NAME = os.getenv("MODEL_NAME")
30+
MODEL_NAME = os.getenv("MODEL_NAME", "gemini-2.5-flash")
3131

3232
# --- AGENT DEFINITIONS ---
3333

python/agents/brand-aligner/brand_aligner_agent/auth.py

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,21 @@
3535
from .utils import logger
3636

3737
# --- Environment Variables ---
38-
AUTH_ID = os.getenv("AUTH_ID")
39-
MODE = os.getenv("MODE")
40-
41-
OAUTH_TOKEN_URI = os.getenv("OAUTH_TOKEN_URI")
42-
OAUTH_AUTH_URI_BASE = os.getenv("OAUTH_AUTH_URI_BASE")
43-
44-
OAUTH_CLIENT_ID = os.getenv("OAUTH_CLIENT_ID")
45-
OAUTH_CLIENT_SECRET = os.getenv("OAUTH_CLIENT_SECRET")
46-
47-
# --- Auth Initialization ---
48-
if not all(
49-
[
50-
AUTH_ID,
51-
MODE,
52-
OAUTH_CLIENT_ID,
53-
OAUTH_CLIENT_SECRET,
54-
OAUTH_TOKEN_URI,
55-
OAUTH_AUTH_URI_BASE,
56-
]
57-
):
58-
raise OSError(
59-
"Required environment variables for auth are not set. Please set AUTH_ID, MODE, OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET, OAUTH_TOKEN_URI and OAUTH_AUTH_URI_BASE."
60-
)
38+
AUTH_ID = os.getenv(
39+
"AUTH_ID",
40+
f"{os.getenv('GOOGLE_CLOUD_PROJECT')}-brand-aligner-agent-oauth-id",
41+
)
42+
MODE = os.getenv("MODE", "production")
43+
44+
OAUTH_TOKEN_URI = os.getenv(
45+
"OAUTH_TOKEN_URI", "https://oauth2.googleapis.com/token"
46+
)
47+
OAUTH_AUTH_URI_BASE = os.getenv(
48+
"OAUTH_AUTH_URI_BASE", "https://accounts.google.com/o/oauth2/v2/auth"
49+
)
50+
51+
OAUTH_CLIENT_ID = os.getenv("OAUTH_CLIENT_ID", "")
52+
OAUTH_CLIENT_SECRET = os.getenv("OAUTH_CLIENT_SECRET", "")
6153

6254
# --- Auth Configuration - relevant only for ADK ---
6355
# --- Token retrieval is managed directly by Gemini Enterprise as part of agent registration ---

python/agents/brand-aligner/brand_aligner_agent/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121

2222
class Severity(StrEnum):
23-
2423
BLOCKER = "BLOCKER"
2524
WARNING = "WARNING"
2625

python/agents/brand-aligner/brand_aligner_agent/tools.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,14 @@
3838
from .utils import generate_radar_chart, logger
3939

4040
# --- Environment Variables ---
41-
PROJECT_ID = os.getenv("PROJECT_ID") or os.getenv("GOOGLE_CLOUD_PROJECT")
42-
LOCATION = os.getenv("LOCATION") or os.getenv("GOOGLE_CLOUD_LOCATION")
43-
MODEL_NAME = os.getenv("MODEL_NAME")
44-
GCS_BUCKET = os.getenv("GCS_BUCKET_NAME")
45-
46-
# --- Service Initialization ---
47-
if not all(
48-
[
49-
PROJECT_ID,
50-
LOCATION,
51-
MODEL_NAME,
52-
GCS_BUCKET,
53-
]
54-
):
55-
raise OSError(
56-
"Required environment variables for services are not set. Please set PROJECT_ID, LOCATION, MODEL_NAME and GCS_BUCKET."
57-
)
41+
PROJECT_ID = os.getenv("PROJECT_ID", os.getenv("GOOGLE_CLOUD_PROJECT"))
42+
LOCATION = os.getenv("LOCATION", os.getenv("GOOGLE_CLOUD_LOCATION"))
43+
MODEL_NAME = os.getenv("MODEL_NAME", "gemini-2.5-flash")
44+
GCS_BUCKET = os.getenv(
45+
"GCS_BUCKET_NAME",
46+
f"{os.getenv('GOOGLE_CLOUD_PROJECT')}-brandaligner-agent-assets",
47+
)
48+
5849
guideline_service = GuidelineService(
5950
project_id=PROJECT_ID, location=LOCATION, model_name=MODEL_NAME
6051
)

python/agents/brand-aligner/brand_aligner_agent/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
matplotlib.use("Agg")
3333

3434
# --- Environment Variables ---
35-
PROJECT_ID = os.getenv("PROJECT_ID") or os.getenv("GOOGLE_CLOUD_PROJECT")
36-
LOCATION = os.getenv("LOCATION") or os.getenv("GOOGLE_CLOUD_LOCATION")
37-
MODEL_NAME = os.getenv("MODEL_NAME")
35+
PROJECT_ID = os.getenv("PROJECT_ID", os.getenv("GOOGLE_CLOUD_PROJECT"))
36+
LOCATION = os.getenv("LOCATION", os.getenv("GOOGLE_CLOUD_LOCATION"))
37+
MODEL_NAME = os.getenv("MODEL_NAME", "gemini-2.5-flash")
3838

3939
RADAR_CHART_GROUPING_PROMPT = """
4040
You are a data visualization expert. You are given a list of several criterion categories extracted from brand guidelines.

python/agents/brand-aligner/deployment/deploy.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,18 @@
6161
],
6262
"requirements": [
6363
"cloudpickle>=3.1.2",
64-
"fastapi>=0.121.0",
65-
"google-adk==1.16.0",
66-
"google-api-python-client>=2.187.0",
67-
"google-auth>=2.43.0",
68-
"google-auth-oauthlib>=1.2.2",
69-
"google-cloud-aiplatform[adk,agent-engines,evaluation]==1.126.1",
70-
"google-cloud-storage<=3.5.0,>=2.9.1",
71-
"google-genai==1.49.0",
72-
"matplotlib>=3.10.7",
73-
"numpy>=2.3.2",
74-
"pandas>=2.3.2",
75-
"pydantic==2.12.4",
64+
"fastapi>=0.136.1",
65+
"google-adk==1.31.1",
66+
"google-api-python-client>=2.194.0",
67+
"google-auth>=2.49.2",
68+
"google-auth-oauthlib>=1.3.1",
69+
"google-cloud-aiplatform[adk,agent-engines,evaluation]>=1.148.0,<2.0.0",
70+
"google-cloud-storage==3.10.1",
71+
"google-genai>=1.73.0",
72+
"matplotlib>=3.10.9",
73+
"numpy>=2.4.4",
74+
"pandas>=3.0.2",
75+
"pydantic==2.13.3",
7676
],
7777
"env_vars": {
7878
"PROJECT_ID": PROJECT_ID,

python/agents/brand-aligner/pyproject.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ description = "Brand Aligner Agent"
55
authors = [{ name = "Mohab Fekry", email = "mfekry@google.com" }]
66
license = {text = "Apache License 2.0"}
77
readme = "README.md"
8-
requires-python = ">=3.12"
8+
requires-python = ">=3.13"
99
dependencies = [
10-
"fastapi>=0.121.0",
11-
"google-adk==1.17.0",
12-
"google-api-python-client>=2.187.0",
13-
"google-auth>=2.43.0",
14-
"google-auth-oauthlib>=1.2.2",
15-
"google-cloud-aiplatform[adk,agent-engines,evaluation]<=1.126.1,>1.118.0",
16-
"google-cloud-storage<=3.5.0,>=2.9.1",
17-
"google-genai>=1.49.0",
18-
"matplotlib>=3.10.7",
19-
"numpy>=2.3.2",
20-
"pandas>=2.3.2",
10+
"fastapi>=0.136.1",
11+
"google-adk==1.31.1",
12+
"google-api-python-client>=2.194.0",
13+
"google-auth>=2.49.2",
14+
"google-auth-oauthlib>=1.3.1",
15+
"google-cloud-aiplatform[adk,agent-engines,evaluation]>=1.148.0,<2.0.0",
16+
"google-cloud-storage==3.10.1",
17+
"google-genai>=1.73.0",
18+
"matplotlib>=3.10.9",
19+
"numpy>=2.4.4",
20+
"pandas>=3.0.2",
2121
]
2222

2323
[dependency-groups]
@@ -91,4 +91,4 @@ agent_directory = "brand_aligner_agent"
9191

9292
[[tool.uv.index]]
9393
url = "https://pypi.org/simple"
94-
default = true
94+
default = true

0 commit comments

Comments
 (0)