Add AG2 integration for multi-agent tracing#2596
Add AG2 integration for multi-agent tracing#2596faridun-ag2 wants to merge 2 commits intoconfident-ai:mainfrom
Conversation
Add `deepeval/integrations/ag2/` with `instrument_ag2()` that patches AG2's ConversableAgent to capture agent, LLM, and tool spans for DeepEval evaluation — following the same pattern as the existing CrewAI and LangChain integrations.
|
@faridun-ag2 is attempting to deploy a commit to the Confident AI Team on Vercel. A member of the Team first needs to authorize it. |
These 20 files were already failing black --check on main branch before this PR. Reformatting them here to pass CI.
|
Hi @penguine-ip @kritinv! This PR adds an AG2 multi-agent tracing integration following the same pattern as the existing CrewAI and LangChain integrations. All new files, no changes to existing code. Note on CI: The This causes the test to run without an Happy to address any feedback! |
Summary
deepeval/integrations/ag2/withinstrument_ag2()that patches AG2'sConversableAgentto automatically capture AgentSpan, LlmSpan, and ToolSpan for DeepEval evaluationexamples/tracing/ag2_tracing.pyWhat it captures
generate_reply/a_generate_replyOpenAIWrapper.createexecute_function/a_execute_functionUsage
Why AG2
AG2 is an open-source multi-agent orchestration framework with 500K+ monthly PyPI downloads. It's a natural addition alongside the existing CrewAI, LangChain, and LlamaIndex integrations.
Files
No changes to existing code.
Test plan
from deepeval.integrations.ag2 import instrument_ag2worksgenerate_replycreates span with correct agent nameexecute_functioncreates span with function name, args, outputgpt-4o-miniproduces traces