Skip to main content

Midlantics A2A — agent observability and governance SDK

Project description

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

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

midlantics_a2a-0.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

midlantics_a2a-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file midlantics_a2a-0.1.0.tar.gz.

File metadata

  • Download URL: midlantics_a2a-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for midlantics_a2a-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c7266ce37ae1c2da132edffa84291f3aed6e212699c113d3d3ba2c259bca0d34
MD5 7471e1754f7a583850013bdd759ff580
BLAKE2b-256 1d3f7e390c2a48833ab9aa0f10d457cea297e729d34222e07780908a42ebb511

See more details on using hashes here.

File details

Details for the file midlantics_a2a-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: midlantics_a2a-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for midlantics_a2a-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed969e129774d8c5427e1570eea57e9b61963929a9f4b5f8cbd77b50f660db0c
MD5 15dddc29b69b224908e9892dbd4df1f1
BLAKE2b-256 5c8cd849e598d92902ae934e3af7bc7e1aa43b6f1e92b85cf748e6df481cdcf2

See more details on using hashes here.

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