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.1.tar.gz (6.0 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.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: athena_ptc_middleware-0.1.1.tar.gz
  • Upload date:
  • Size: 6.0 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.1.tar.gz
Algorithm Hash digest
SHA256 b8fafeca8bc18fab9555f3be29f515b17a83309cb428f24329fee33f6d0f3a56
MD5 7dc76be68d4cd144a516b967a41eee95
BLAKE2b-256 22a6bb6e7c72b04e022b6f2fafed84ef29494bb4c3b7149c2f4b70bd36155599

See more details on using hashes here.

File details

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

File metadata

  • Download URL: athena_ptc_middleware-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c1af62ec8b916a8c31cbc8e4d9d8717d678056058825081ceb23ae598796a203
MD5 b5e1b652cf13c00422f47856e0e22489
BLAKE2b-256 3e43df1a2c95ad4cab8f23b210d7e68169e5411601f3c02c30f0f3d6faa1c73b

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