Skip to main content

High-level Copass agent SDK — hosted agent-runtime routing + integrations + one-liner OAuth flow (Python mirror of @copass/agent-router)

Project description

copass-agent-router

High-level Copass agent SDK. Python mirror of @copass/agent-router — wraps copass-core + copass-core-agents into a one-import surface that runs a full agent lifecycle: connect an integration, run an agent turn, stream events.

Install

pip install copass-agent-router

Quickstart

import asyncio, webbrowser
from copass_agent_router import AgentRouter, RunAgentOptions
from copass_core import ApiKeyAuth

async def main():
    router = AgentRouter(
        auth=ApiKeyAuth(key="olk_..."),
        sandbox_id="sb_...",
    )

    # Connect an integration (OAuth, local browser, webhook fallback via reconcile).
    result = await router.integrations.connect(
        "github",
        on_connect_url=lambda url: webbrowser.open(url),
    )
    print("connected:", result.connection["app"], result.connection["name"])

    # Run an agent.
    async for event in router.run(RunAgentOptions(
        provider="anthropic",
        model="claude-opus-4-7",
        system="You are a helpful agent.",
        message="Summarize my latest GitHub issues.",
        end_user_id="u-123",
    )):
        t = type(event).__name__
        if t == "AgentTextDelta":
            print(event.text, end="", flush=True)
        elif t == "AgentFinish":
            print(f"\n[done] {event.stop_reason}")

asyncio.run(main())

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_agent_router-1.4.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

copass_agent_router-1.4.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file copass_agent_router-1.4.0.tar.gz.

File metadata

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

File hashes

Hashes for copass_agent_router-1.4.0.tar.gz
Algorithm Hash digest
SHA256 5b79d67e20e5c0520cf831c7a4a0f7a4fc30b9de6611a11879cd7340c6a56d27
MD5 d4365588d8db7ca0be405918b3d35c40
BLAKE2b-256 e62d6c257dc65e61ca0052371e66f079d41dd6e6cd8c580fc310c6b0cf2fbf94

See more details on using hashes here.

Provenance

The following attestation bundles were made for copass_agent_router-1.4.0.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_agent_router-1.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for copass_agent_router-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5cc1077e9d0cc78b2197f4a6afbeb39534b136c42a8a2f72635b583e03a2ca7
MD5 bc2a69710e7743dfc25ca4ced7aa80ec
BLAKE2b-256 74ac2947bd9840ec951a51ec8e6432ea4691e12803653e5d5e0962d81c3de22c

See more details on using hashes here.

Provenance

The following attestation bundles were made for copass_agent_router-1.4.0-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