feat(clients): google foundation for the agent platform: all-verb client, streaming, typed Gemini content, operations
GoogleClient gets every verb and stream_json (SSE and plain JSON), typed Content/Part/Tool/GenerateRequest with the LanguageModel seam, CloudContext resource names, long-running operation polling and pagination, OAuth bearer tokens via GOOGLE_ACCESS_TOKEN. Example scaffold: one stub per agent module under example/app/agent, wildcard builds, locust excludes /voice /google /agent. plans/16-agent-platform.md splits the work into nine modules. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,14 @@ LOCUST = HERE / "locustfile.py"
|
||||
# Routes that call paid Google APIs: never load tested. The check fails if
|
||||
# locust references one, and does not require them to be covered.
|
||||
EXCLUDED = {"/voice/say", "/voice/hear", "/voice/turn", "/voice/reset"}
|
||||
# Whole areas that talk to (or front) paid Google APIs. Routes under these
|
||||
# prefixes are never load tested and never required to be covered.
|
||||
EXCLUDED_PREFIXES = ("/voice", "/google", "/agent", "/embedded/voice.js",
|
||||
"/embedded/agent_")
|
||||
|
||||
|
||||
def is_excluded(route: str) -> bool:
|
||||
return route in EXCLUDED or route.startswith(EXCLUDED_PREFIXES)
|
||||
|
||||
FILLS = {"name": "locust", "id": "1", "status": "404", "tenant": "acme"}
|
||||
|
||||
@@ -59,7 +67,7 @@ def main() -> int:
|
||||
routes = collect_routes()
|
||||
urls, methods = collect_locust_urls()
|
||||
missing: list[str] = []
|
||||
for r in sorted(routes - EXCLUDED):
|
||||
for r in sorted(r for r in routes if not is_excluded(r)):
|
||||
c = fill(r)
|
||||
ok = (
|
||||
c in urls
|
||||
@@ -72,7 +80,7 @@ def main() -> int:
|
||||
)
|
||||
if not ok:
|
||||
missing.append(f"{r} -> {c}")
|
||||
leaked = sorted(EXCLUDED & urls)
|
||||
leaked = sorted(u for u in urls if is_excluded(u))
|
||||
for r in leaked:
|
||||
print("FORBIDDEN (costs money):", r)
|
||||
required_methods = {"get", "post", "put", "options"}
|
||||
@@ -88,7 +96,8 @@ def main() -> int:
|
||||
if missing or missing_methods:
|
||||
print(f"FAIL: {len(missing)} missing routes, {len(missing_methods)} missing methods")
|
||||
return 1
|
||||
print(f"OK: {len(routes) - len(EXCLUDED)} routes covered, {len(EXCLUDED)} paid Google routes excluded, methods {sorted(methods)}")
|
||||
excluded = sum(1 for r in routes if is_excluded(r))
|
||||
print(f"OK: {len(routes) - excluded} routes covered, {excluded} paid Google routes excluded, methods {sorted(methods)}")
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user