Skip to main content

zespan-autogen

Observability middleware for Microsoft AutoGen via Zespan.

Install

# For AutoGen v0.4 (autogen-agentchat)
pip install 'zespan-autogen[agentchat]'

# For AutoGen v0.2 (pyautogen / ag2)
pip install 'zespan-autogen[legacy]'

AutoGen v0.4 — run_with_tracing()

Replace await team.run(task=...) with await run_with_tracing(team, task, ...):

from zespan_autogen import run_with_tracing
from autogen_agentchat.teams import RoundRobinGroupChat
from autogen_agentchat.conditions import MaxMessageTermination
from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_agentchat.agents import AssistantAgent

model = OpenAIChatCompletionClient(model="gpt-4o")
agent = AssistantAgent("assistant", model_client=model)
team = RoundRobinGroupChat([agent], termination_condition=MaxMessageTermination(5))

trace_id = await run_with_tracing(
    team=team,
    task="Analyze the sales data",
    api_key="zsp_your_key",
    project_id="your_project_id",
)

AutoGen v0.4 — ZespanModelClient (per-LLM-call tracing)

from zespan_autogen import ZespanModelClient
from autogen_ext.models.openai import OpenAIChatCompletionClient

base = OpenAIChatCompletionClient(model="gpt-4o")
model = ZespanModelClient(base, api_key="zsp_your_key", project_id="proj_id")
agent = AssistantAgent("assistant", model_client=model)

AutoGen v0.2 — register_hooks()

from autogen import AssistantAgent, UserProxyAgent
from zespan_autogen import register_hooks

assistant = AssistantAgent("assistant", llm_config={"config_list": [...]})
user = UserProxyAgent("user", human_input_mode="NEVER")

register_hooks(assistant, user, api_key="zsp_your_key", project_id="proj_id")
user.initiate_chat(assistant, message="Research quantum computing trends")

What's captured

  • All agent messages (source, content, token counts)
  • Tool call requests and execution results
  • Agent handoffs and delegation
  • Internal reasoning/thought events (thinking models)
  • Memory query events
  • Raw LLM request/response (via ZespanModelClient)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zespan_autogen-1.2.2.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.

zespan_autogen-1.2.2-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file zespan_autogen-1.2.2.tar.gz.

File metadata

  • Download URL: zespan_autogen-1.2.2.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.17.0 {"ci":null,"cpu":"AMD64","implementation":{"name":"CPython","version":"3.14.2"},"installer":{"name":"hatch","version":"1.17.0"},"openssl_version":"OpenSSL 3.0.18 30 Sep 2025","python":"3.14.2","system":{"name":"Windows","release":"11"}} HTTPX2/2.4.0

File hashes

Hashes for zespan_autogen-1.2.2.tar.gz
Algorithm Hash digest
SHA256 eff66fd73bee700236770a0ceffb92cfddacb96d24293610cf1eab617c66d651
MD5 5bf6f402a0a805cec439bb0113944c9c
BLAKE2b-256 471470dde5f7ba4be49ae466d8bce1fd4e25f6ec5cd1ecda28a36774e1df6a39

See more details on using hashes here.

File details

Details for the file zespan_autogen-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: zespan_autogen-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.17.0 {"ci":null,"cpu":"AMD64","implementation":{"name":"CPython","version":"3.14.2"},"installer":{"name":"hatch","version":"1.17.0"},"openssl_version":"OpenSSL 3.0.18 30 Sep 2025","python":"3.14.2","system":{"name":"Windows","release":"11"}} HTTPX2/2.4.0

File hashes

Hashes for zespan_autogen-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1eb6386a1acc16d1ebc55c1755bd4d62608136cc23c0acd8479605acd51726ba
MD5 ee237cac7532f11ac6a3299185ccddb1
BLAKE2b-256 79a325c0d39e1b3b5e07cd9807fe9f2fb5afd60267d4c5775c49186fb791b8d7

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 Sentry Error logging StatusPage Status page