Skip to content

Feature/integrate brand aligner#1288

Merged
zeroasterisk merged 20 commits intogoogle:mainfrom
tristanhussain:feature/integrate-brand-aligner
Apr 10, 2026
Merged

Feature/integrate brand aligner#1288
zeroasterisk merged 20 commits intogoogle:mainfrom
tristanhussain:feature/integrate-brand-aligner

Conversation

@MoisesRBitton
Copy link
Copy Markdown
Contributor

Implemented ASP for brand-aligner and cleaned up the project so it actually runs/tests reliably.

ASP config + dependency added
uv-based setup/testing flow
fixed env init/import order
fixed enum issue causing python 3.12 test collection errors
updated README

Screenshot 2026-03-18 105642

@zeroasterisk

@MoisesRBitton MoisesRBitton marked this pull request as ready for review March 18, 2026 15:13
packages = ["financial_advisor"]

[tool.ruff.lint.pydocstyle]
convention = "google"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this removed? is it not in the other files? aim for consistency and intentional changes

indent-style = "space"
quote-style = "double"
skip-magic-trailing-comma = false
docstring-code-format = true
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this removed? is it not in the other files? aim for consistency and intentional changes


[[tool.uv.index]]
url = "https://pypi.org/simple"
default = true
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this removed? is it not in the other files? aim for consistency and intentional changes

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll actually say, I think we do want to keep this. I believe we (Googlers) need it to avoid some package mirror errors

```

2. **Configure `.env`:** Open the newly created `.env` file and fill in the required values (Project ID, Region, GCS Bucket, Model Name, etc.).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #1286 has a pretty good README, we should standardize the UV install block and the getting started to all be about the same. @maeve2024 to collaborate

Comment thread python/agents/brand-aligner/README.md Outdated
* **`ge_register.sh`**: Registers the deployed agent with Gemini Enterprise.
* **`ge_unregister.sh`**: Unregisters the agent from Gemini Enterprise.

### Alternative: Using Agent Starter Pack (ASP)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ASP should be the default, not the alternative



class Category(str, StrEnum):
class Category(StrEnum):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please confirm this change is necessary, and that the agent is fully functional via the adk web UI going through a secenario.

load_dotenv(override=True)
_, project_id = google.auth.default()
os.environ.setdefault("GOOGLE_CLOUD_PROJECT", project_id)
os.environ["GOOGLE_CLOUD_LOCATION"] = "global"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be a default as well? confirm with other samples

Copy link
Copy Markdown
Collaborator

@zeroasterisk zeroasterisk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ASP Integration Checklist (ref: PR #1286 as approved template)

  • ✅ ASP section added, __init__.py auth block added
  • ⚠️ ASP listed as "Alternative" — Should be the recommended path. Flip the structure: ASP first with uvx one-liner as the primary command, then collapse the manual setup in <details>. See #1286 for the exact pattern.
  • ⚠️ pip/venv is primary, uvx is collapsed — This is backwards. uvx one-liner should be the main visible command, pip/venv in a collapsed <details> block.
  • ⚠️ os.environ["GOOGLE_CLOUD_LOCATION"] = "global" is a hard override — Use os.environ.setdefault("GOOGLE_CLOUD_LOCATION", "global") instead. Hard assignment silently overwrites user-configured values.

Main fixes needed: flip ASP to recommended (not alternative), and fix setdefault.

@zeroasterisk
Copy link
Copy Markdown
Collaborator

Checking in — the review feedback from Mar 21 hasn't been addressed yet. Key changes needed:

  1. Flip ASP to recommended (not "Alternative") — uvx one-liner first, pip/venv collapsed
  2. os.environ["GOOGLE_CLOUD_LOCATION"]os.environ.setdefault("GOOGLE_CLOUD_LOCATION", "global")

See PR #1286 for the exact pattern to follow.

MoisesRBitton and others added 3 commits March 25, 2026 19:33
…ance

* restore ruff pydocstyle and format blocks for pyproject consistency
* keep tool.uv.index to avoid package mirror issues
* make Agent Starter Pack the recommended setup path with uvx one-liner first
* move pip or venv setup into collapsed alternative section
* change GOOGLE_CLOUD_LOCATION assignment to setdefault to avoid overriding user config
* align enum implementation with StrEnum in models for clearer intent
Copy link
Copy Markdown
Collaborator

@zeroasterisk zeroasterisk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things to adjust:

  1. Simplify __init__.py imports: Currently importing everything (from . import agent, auth, models, services, tools, utils). This can cause circular imports and slows down package initialization. Simplify to just the auth block + from . import agent (or just the auth block if the agent is imported elsewhere).
  2. Bump agent-starter-pack to >=0.32.0
  3. Position ASP as recommended in README — currently it reads more like an alternative. Make it the primary/recommended setup path, with manual clone in a collapsed <details> block.

Ref: PR #1368 for a clean example of the pattern.

MoisesRBitton and others added 2 commits April 5, 2026 17:04
…sible section

fix: remove unused imports in __init__.py

deps: bump agent-starter-pack version to 0.32.0 in pyproject.toml and uv.lock
Signed-off-by: Moises Bitton Simana <162650235+MoisesRBitton@users.noreply.github.com>
@MoisesRBitton
Copy link
Copy Markdown
Contributor Author

MoisesRBitton commented Apr 5, 2026

Thanks for the feedback Alan. I’ve addressed all three items in the latest commit and pushed:

Simplified package initialization imports to avoid loading everything at import time:
init.py now only keeps the auth/env setup and imports agent.
Bumped Agent Starter Pack version:
Updated to agent-starter-pack>=0.32.0 in pyproject.toml.
Updated README setup flow to match the ASP-first pattern:
ASP is now the recommended primary path.
Manual clone/local setup was moved into a collapsed "details" alternative section.
Could you take another look when you have a chance?

Copy link
Copy Markdown
Collaborator

@zeroasterisk zeroasterisk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look great, thank you! ✅

Copy link
Copy Markdown
Collaborator

@zeroasterisk zeroasterisk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look great, thank you! ✅

Copy link
Copy Markdown
Collaborator

@zeroasterisk zeroasterisk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look great, thank you! ✅

Copy link
Copy Markdown
Collaborator

@zeroasterisk zeroasterisk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look great, thank you! ✅

@zeroasterisk zeroasterisk merged commit 5b40edb into google:main Apr 10, 2026
7 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants