AutoGen
Forward Microsoft AutoGen v0.4 runtime events to Iqrar telemetry — message rounds, tool calls, handoffs, and termination signals.
AutoGen v0.4 has a first-class event/message bus on the runtime. Iqrar subscribes to it via a stateless middleware.
Install
pip install "iqrar-agent[autogen]"
Wire it in (v0.4)
from autogen_agentchat.teams import RoundRobinGroupChat
from iqrar import Iqrar
from iqrar.adapters.autogen import IqrarMiddleware
iqrar = Iqrar(
org="acme",
jurisdiction="EU",
endpoint="https://api.your-deploy.workers.dev",
capabilities=["consumer_chatbot"],
)
middleware = IqrarMiddleware(iqrar)
team = RoundRobinGroupChat([...])
async for msg in team.run_stream(task="..."):
middleware.on_event(msg)
The middleware maps event class names to canonical Iqrar event types: ToolCallRequest* → agent.tool.start, ToolCallResult* → agent.tool.end, *Handoff* → agent.handoff, termination/stop → agent.invocation.end, anything else → agent.message. Token usage from models_usage is forwarded when present.
Pre-v0.4 fallback
For autogen-agentchat < 0.4 use the reply-hook bridge:
middleware.wrap_agent(your_assistant_agent)
This installs a no-op reply hook that records agent.invocation.start / .end per round without intercepting the agent's actual replies.
See also
· ·