fix(hub): use LlmAgent with explicit Vertex AI client

This commit is contained in:
Chris Christiansen 2026-09-05 10:36:00 +00:00
parent d93398eafa
commit 1a1d4ae99b

View File

@ -14,7 +14,7 @@ import google.auth.transport.requests
from typing import Literal
from google.adk.agents import Agent
from google.adk.agents import LlmAgent
from google.adk.tools import FunctionTool
from google.adk.runners import Runner
from gemini_guard import guarded_run, CircuitOpen, RateLimitExceeded
@ -254,12 +254,13 @@ def build_agent(mode: str = "light", message: str = "") -> tuple:
models = get_models_for_mode(mode)
actual_model = route_model(message=message, mode=mode, flash_model=ORCHESTRATOR_MODEL, pro_model=models["orchestrator"])
instruction = _INSTRUCTION_TEMPLATE.format(mode=mode, model=actual_model)
agent = Agent(
agent = LlmAgent(
model=actual_model,
name="jason_vauger",
description=f"Jason Vauger — OPAX enterprise agent [{mode}]",
instruction=instruction,
tools=OPAX_TOOLS,
vertexai=True,
project="propane-will-491900-m5",
location="us-central1",
)
return agent, actual_model, instruction