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)
Metadata
Release files for zespan-autogen 1.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| zespan_autogen-1.2.2.tar.gz | 5.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zespan_autogen-1.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.7 kB
Release files / zespan_autogen-1.2.2.tar.gz
| Download URL | zespan_autogen-1.2.2.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eff66fd73bee700236770a0ceffb92cfddacb96d24293610cf1eab617c66d651
|
|
BLAKE2b-256 checksum How to use checksums |
471470dde5f7ba4be49ae466d8bce1fd4e25f6ec5cd1ecda28a36774e1df6a39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / zespan_autogen-1.2.2-py3-none-any.whl
| Download URL | zespan_autogen-1.2.2-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1eb6386a1acc16d1ebc55c1755bd4d62608136cc23c0acd8479605acd51726ba
|
|
BLAKE2b-256 checksum How to use checksums |
79a325c0d39e1b3b5e07cd9807fe9f2fb5afd60267d4c5775c49186fb791b8d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|