Skip to main content

LangGraph agent middleware that surfaces Athena Programmatic Tool Calling (PTC) sub-events as nested tool cards

Project description

athena-ptc-middleware

LangGraph agent middleware that surfaces Programmatic Tool Calling (PTC) sub-events from Athena's sandboxed SDKs (athena-python-pptx, athena-python-docx, athena-openpyxl, …) as nested sub-tool-cards on the parent agent tool call.

The middleware:

  1. Runs a small in-process HTTP listener on 127.0.0.1:3101/ptc-events.
  2. Publishes ATHENA_PTC_URL in os.environ at import time so any bash subprocess spawned by the parent agent inherits it.
  3. For each tool call, claims a per-call buffer, drains buffered events to the LangGraph stream writer as custom events (ptc_subcall_event), and attaches the final event log to the ToolMessage.artifact.subgraph_state.messages shape consumed by Olympus.

Usage

from athena_ptc_middleware import PTCEventsMiddleware
from deepagents import create_deep_agent

graph = create_deep_agent(
    model=...,
    system_prompt=...,
    backend=...,
    tools=...,
    middleware=[PTCEventsMiddleware()],
)

Sandboxed SDKs that emit PTC events read ATHENA_PTC_URL from their environment and POST JSON events to it. As long as the env var is inherited by the subprocess where the SDK runs (e.g. bash spawned by the agent), the middleware will surface them.

Source of truth

This package is published from python-sdk/athena-ptc-middleware/ in the Athena-Intel/demo-app-monorepo repo. The Athena developer agent (sandbox/developer_agent/) consumes it from PyPI; do not re-vendor the source into other locations.

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

athena_ptc_middleware-0.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

athena_ptc_middleware-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: athena_ptc_middleware-0.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for athena_ptc_middleware-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c722f2b8ea099abca8ec541afbe6947a92ac2bf57614757358e2ee5df68d5894
MD5 b83446b9aa4108d5dcbc9a389a9d9ce1
BLAKE2b-256 fb1289f990b73726cceef388c6d0ae7bab10f3112eb7bc2c249e2799b075229b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: athena_ptc_middleware-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for athena_ptc_middleware-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8074f58db7c3cb42a159499b2fdddde253a628e93271448c82e23288e2ad36cc
MD5 67c279a306ffe9eff2883ec26e24b5ae
BLAKE2b-256 f408c7647abfd5f5c848c84433798811f549add6a8d31b22ff4041038c08de9c

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