Skip to main content

midlantics-a2a

Python SDK for Midlantics A2A — agent observability and governance.

Install

pip install midlantics-a2a

# With OpenAI auto-capture
pip install "midlantics-a2a[openai]"

# With Anthropic auto-capture
pip install "midlantics-a2a[anthropic]"

# Both
pip install "midlantics-a2a[all]"

Quickstart

from midlantics_a2a import Observer

obs = Observer(
    api_url="https://a2a-api.midlantics.com",
    token="a2a_sk_...",   # generate in dashboard → API Keys
)

with obs.trace("purchase-agent") as trace:
    with trace.span("validate-order", kind="tool") as span:
        result = validate_order(order_id)
        span.set_attribute("order.id", order_id)

    with trace.span("call-llm", kind="llm") as span:
        response = openai_client.chat.completions.create(
            model="gpt-4o", messages=[...]
        )
        span.record_llm(
            model="gpt-4o",
            provider="openai",
            prompt_tokens=response.usage.prompt_tokens,
            completion_tokens=response.usage.completion_tokens,
        )

Auto-capture (zero code changes)

from midlantics_a2a import Observer
from midlantics_a2a.patches.openai_patch import patch_openai
import openai

obs = Observer(api_url="...", token="a2a_sk_...")
patch_openai(obs)

# Every openai.chat.completions.create() is now captured automatically
from midlantics_a2a.patches.anthropic_patch import patch_anthropic
import anthropic

patch_anthropic(obs)
# Every anthropic.messages.create() is now captured automatically

VPC / self-hosted

Point api_url at your self-hosted instance:

obs = Observer(api_url="http://your-internal-host:8000", token="a2a_sk_...")

License

Apache 2.0

Metadata

Release files for midlantics-a2a 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for midlantics-a2a 0.1.0
File Size Uploaded Provenance Actions
midlantics_a2a-0.1.0.tar.gz 6.8 kB Without provenance Details for midlantics_a2a-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for midlantics-a2a 0.1.0
File Interpreter ABI Platform Actions
midlantics_a2a-0.1.0-py3-none-any.whl Python 3 none any Details for midlantics_a2a-0.1.0-py3-none-any.whl

Total release size: 14.9 kB

Release files / midlantics_a2a-0.1.0.tar.gz

Download URL midlantics_a2a-0.1.0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c7266ce37ae1c2da132edffa84291f3aed6e212699c113d3d3ba2c259bca0d34
BLAKE2b-256 checksum
How to use checksums
1d3f7e390c2a48833ab9aa0f10d457cea297e729d34222e07780908a42ebb511
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / midlantics_a2a-0.1.0-py3-none-any.whl

Download URL midlantics_a2a-0.1.0-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed969e129774d8c5427e1570eea57e9b61963929a9f4b5f8cbd77b50f660db0c
BLAKE2b-256 checksum
How to use checksums
5c8cd849e598d92902ae934e3af7bc7e1aa43b6f1e92b85cf748e6df481cdcf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for midlantics-a2a 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page