[{"data":1,"prerenderedAt":261},["ShallowReactive",2],{"docs:\u002Fdocs\u002Fintegrations\u002Fautogen":3},{"id":4,"title":5,"body":6,"description":252,"extension":253,"meta":254,"navigation":255,"path":257,"seo":258,"stem":259,"__hash__":260},"docs\u002Fdocs\u002Fintegrations\u002Fautogen.md","AutoGen",{"type":7,"value":8,"toc":246},"minimark",[9,13,18,51,55,151,187,191,198,207,218,222,242],[10,11,12],"p",{},"AutoGen v0.4 has a first-class event\u002Fmessage bus on the runtime. Iqrar subscribes to it via a stateless middleware.",[14,15,17],"h2",{"id":16},"install","Install",[19,20,25],"pre",{"className":21,"code":22,"language":23,"meta":24,"style":24},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pip install \"iqrar-agent[autogen]\"\n","bash","",[26,27,28],"code",{"__ignoreMap":24},[29,30,33,37,41,45,48],"span",{"class":31,"line":32},"line",1,[29,34,36],{"class":35},"sBMFI","pip",[29,38,40],{"class":39},"sfazB"," install",[29,42,44],{"class":43},"sMK4o"," \"",[29,46,47],{"class":39},"iqrar-agent[autogen]",[29,49,50],{"class":43},"\"\n",[14,52,54],{"id":53},"wire-it-in-v04","Wire it in (v0.4)",[19,56,60],{"className":57,"code":58,"language":59,"meta":24,"style":24},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","from autogen_agentchat.teams import RoundRobinGroupChat\nfrom iqrar import Iqrar\nfrom iqrar.adapters.autogen import IqrarMiddleware\n\niqrar = Iqrar(\n    org=\"acme\",\n    jurisdiction=\"EU\",\n    endpoint=\"https:\u002F\u002Fapi.your-deploy.workers.dev\",\n    capabilities=[\"consumer_chatbot\"],\n)\nmiddleware = IqrarMiddleware(iqrar)\n\nteam = RoundRobinGroupChat([...])\nasync for msg in team.run_stream(task=\"...\"):\n    middleware.on_event(msg)\n","python",[26,61,62,67,73,79,86,92,98,104,110,116,122,128,133,139,145],{"__ignoreMap":24},[29,63,64],{"class":31,"line":32},[29,65,66],{},"from autogen_agentchat.teams import RoundRobinGroupChat\n",[29,68,70],{"class":31,"line":69},2,[29,71,72],{},"from iqrar import Iqrar\n",[29,74,76],{"class":31,"line":75},3,[29,77,78],{},"from iqrar.adapters.autogen import IqrarMiddleware\n",[29,80,82],{"class":31,"line":81},4,[29,83,85],{"emptyLinePlaceholder":84},true,"\n",[29,87,89],{"class":31,"line":88},5,[29,90,91],{},"iqrar = Iqrar(\n",[29,93,95],{"class":31,"line":94},6,[29,96,97],{},"    org=\"acme\",\n",[29,99,101],{"class":31,"line":100},7,[29,102,103],{},"    jurisdiction=\"EU\",\n",[29,105,107],{"class":31,"line":106},8,[29,108,109],{},"    endpoint=\"https:\u002F\u002Fapi.your-deploy.workers.dev\",\n",[29,111,113],{"class":31,"line":112},9,[29,114,115],{},"    capabilities=[\"consumer_chatbot\"],\n",[29,117,119],{"class":31,"line":118},10,[29,120,121],{},")\n",[29,123,125],{"class":31,"line":124},11,[29,126,127],{},"middleware = IqrarMiddleware(iqrar)\n",[29,129,131],{"class":31,"line":130},12,[29,132,85],{"emptyLinePlaceholder":84},[29,134,136],{"class":31,"line":135},13,[29,137,138],{},"team = RoundRobinGroupChat([...])\n",[29,140,142],{"class":31,"line":141},14,[29,143,144],{},"async for msg in team.run_stream(task=\"...\"):\n",[29,146,148],{"class":31,"line":147},15,[29,149,150],{},"    middleware.on_event(msg)\n",[10,152,153,154,157,158,161,162,157,165,161,168,157,171,174,175,178,179,182,183,186],{},"The middleware maps event class names to canonical Iqrar event types: ",[26,155,156],{},"ToolCallRequest*"," → ",[26,159,160],{},"agent.tool.start",", ",[26,163,164],{},"ToolCallResult*",[26,166,167],{},"agent.tool.end",[26,169,170],{},"*Handoff*",[26,172,173],{},"agent.handoff",", termination\u002Fstop → ",[26,176,177],{},"agent.invocation.end",", anything else → ",[26,180,181],{},"agent.message",". Token usage from ",[26,184,185],{},"models_usage"," is forwarded when present.",[14,188,190],{"id":189},"pre-v04-fallback","Pre-v0.4 fallback",[10,192,193,194,197],{},"For ",[26,195,196],{},"autogen-agentchat \u003C 0.4"," use the reply-hook bridge:",[19,199,201],{"className":57,"code":200,"language":59,"meta":24,"style":24},"middleware.wrap_agent(your_assistant_agent)\n",[26,202,203],{"__ignoreMap":24},[29,204,205],{"class":31,"line":32},[29,206,200],{},[10,208,209,210,213,214,217],{},"This installs a no-op reply hook that records ",[26,211,212],{},"agent.invocation.start"," \u002F ",[26,215,216],{},".end"," per round without intercepting the agent's actual replies.",[14,219,221],{"id":220},"see-also","See also",[223,224,225],"ul",{},[226,227,228,233,234,233,238],"li",{},[229,230,232],"a",{"href":231},"\u002Fdocs\u002Fintegrations\u002Fcrewai","CrewAI"," · ",[229,235,237],{"href":236},"\u002Fdocs\u002Fintegrations\u002Flangchain-python","LangChain (Python)",[229,239,241],{"href":240},"\u002Fdocs\u002Fintegrations\u002Fopenai-agents-python","OpenAI Agents SDK",[243,244,245],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}",{"title":24,"searchDepth":69,"depth":69,"links":247},[248,249,250,251],{"id":16,"depth":69,"text":17},{"id":53,"depth":69,"text":54},{"id":189,"depth":69,"text":190},{"id":220,"depth":69,"text":221},"Forward Microsoft AutoGen v0.4 runtime events to Iqrar telemetry — message rounds, tool calls, handoffs, and termination signals.","md",{},{"title":5,"order":256},33,"\u002Fdocs\u002Fintegrations\u002Fautogen",{"title":5,"description":252},"docs\u002Fintegrations\u002Fautogen","26p9KO-bOhN7DWvMYDH8_QxT199SVCWDFXALB-LTvO0",1778066485939]