Skip to main content

Copass agent primitives for Google Vertex AI Agent Engine (ADK)

Project description

copass-google-agents

Google Vertex AI Agent Engine (ADK) backend for Copass. Depends on copass-core-agents, which owns the vendor-neutral primitives (BaseAgent, AgentTool, AgentBackend ABC, events, AgentScope, registries, etc.) shared across every provider-specific Copass SDK.

This package owns the Google-specific piece — GoogleAgentBackend and the CopassGoogleAgent convenience subclass — and re-exports the core primitives for one-line dev imports. Either of these works for consumers:

from copass_google_agents import BaseAgent, CopassGoogleAgent  # convenient
# or
from copass_core_agents import BaseAgent                       # explicit boundary
from copass_google_agents import CopassGoogleAgent

Pairs with Copass's server-side router — both sides import the same code so the agent runtime is a single codepath, whether the agent runs in the dev's process or server-side via Copass's Router endpoint.

Status: scaffold (v0.1.0). Constructors, type surface, and public imports are in place. GoogleAgentBackend.run / GoogleAgentBackend.stream / deploy_adk_agent / adk_event_to_agent_events currently raise NotImplementedError. Implementation lands in a follow-up pass.

Install

pip install copass-google-agents

Requires google-cloud-aiplatform[agent_engines,adk]>=1.148.1 (which pulls in google-adk>=1.31). Uses Application Default Credentials (ADC) — run gcloud auth application-default login locally, or set GOOGLE_APPLICATION_CREDENTIALS / attach a service account.

Architecture

Agent Engine diverges from Claude Managed Agents in one important way: ADK agents are pre-deployed resources (projects/{p}/locations/{l}/reasoningEngines/{id}) and their tools are baked in at deploy time. You cannot pass tools per-run.

To preserve Copass's AgentToolResolver runtime-plug model, copass-google-agents deploys ADK agents carrying a single copass_dispatch(tool_name, arguments) function tool. At run time that proxy calls back into your Copass service, which hosts the real resolver and invokes the right tool for the current user.

So:

  • GoogleAgentBackend is session-only — streams queries against a pre-deployed engine.
  • deploy_adk_agent (ops helper) is the one-time setup that wires the proxy tool into a new ADK agent resource.
  • Zero client-side tools is the expected case. CopassGoogleAgent defaults to an empty AgentToolRegistry.

Quickstart (planned — not functional in the scaffold)

import os
from copass_google_agents import (
    AgentInvocationContext,
    AgentScope,
    CopassGoogleAgent,
)

agent = CopassGoogleAgent(
    identity="support",
    system_prompt="You are a support agent.",
    project=os.environ["GOOGLE_CLOUD_PROJECT"],
    reasoning_engine_id=os.environ["COPASS_REASONING_ENGINE_ID"],
)

ctx = AgentInvocationContext(scope=AgentScope(user_id="u-123"))
result = await agent.run(
    messages=[{"role": "user", "content": "Hello"}],
    context=ctx,
)
print(result.final_text)

Streaming (planned)

from copass_google_agents import (
    AgentFinish,
    AgentTextDelta,
    AgentToolCall,
    AgentToolResult,
)

async for evt in agent.stream(messages, context=ctx):
    match evt:
        case AgentTextDelta(text=chunk):
            print(chunk, end="", flush=True)
        case AgentToolCall(name=name):
            print(f"\n[tool-call] {name}")
        case AgentToolResult(name=name):
            print(f"\n[tool-result] {name}")
        case AgentFinish(stop_reason=reason, session_id=sid):
            print(f"\n[finish] {reason} session={sid}")

Multi-turn continuation (planned)

Agent Engine sessions hold conversation state. Capture AgentFinish.session_id and thread it back on the next turn:

from copass_google_agents import SESSION_ID_HANDLE

ctx2 = AgentInvocationContext(
    scope=AgentScope(user_id="u-123"),
    handles={SESSION_ID_HANDLE: prior_session_id},
)

Deploying an ADK agent (planned)

from copass_google_agents.deploy import deploy_adk_agent

engine = deploy_adk_agent(
    display_name="support-agent",
    project="my-gcp-project",
    system_prompt="You are a support agent...",
    copass_api_url="https://api.copass.id",
)
print(engine.resource_name)  # feed into CopassGoogleAgent(reasoning_engine_id=...)

The deployed engine no longer bakes a fixed API key. Per-call authentication flows through the ADK session: the calling Copass server populates state["copass_api_key"] on each session via async_create_session(state={...}); the proxy tool reads it from tool_context.state on every invocation.

License

MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

copass_google_agents-1.0.4.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

copass_google_agents-1.0.4-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

Details for the file copass_google_agents-1.0.4.tar.gz.

File metadata

  • Download URL: copass_google_agents-1.0.4.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for copass_google_agents-1.0.4.tar.gz
Algorithm Hash digest
SHA256 d187e098a433142886d1a0563a90529cf0fd6d07a70383a75e55e1e7030fdffe
MD5 738e1e03e27a7ccccbe26c2fab9191ab
BLAKE2b-256 5371c123d9c9ae58283f09399af215a24cb1b2525b318d0863ff554612f82f70

See more details on using hashes here.

Provenance

The following attestation bundles were made for copass_google_agents-1.0.4.tar.gz:

Publisher: release-python.yml on olane-labs/copass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file copass_google_agents-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for copass_google_agents-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a09d3c01e950a8f626338c68cb8a7e112e80f8adef0b61d84798c79f912eb9de
MD5 167696fd70a8d416d5dd98a580394e4a
BLAKE2b-256 e86c0eb5f78c0e8bab322de9ed81575a6fc4f61e4e1ea3c6d7cf3335ede57aa4

See more details on using hashes here.

Provenance

The following attestation bundles were made for copass_google_agents-1.0.4-py3-none-any.whl:

Publisher: release-python.yml on olane-labs/copass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page