豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Add AG2 multi-agent notebooks to third_party examples#2574

Open
faridun-ag2 wants to merge 1 commit intoopenai:mainfrom
faridun-ag2:add-ag2-multi-agent-examples
Open

Add AG2 multi-agent notebooks to third_party examples#2574
faridun-ag2 wants to merge 1 commit intoopenai:mainfrom
faridun-ag2:add-ag2-multi-agent-examples

Conversation

@faridun-ag2
Copy link
Copy Markdown

Summary

  • Adds two notebooks demonstrating AG2 multi-agent capabilities with OpenAI models to examples/third_party/
  • multi_agent_chat_with_ag2.ipynb — Two-agent conversation and multi-agent GroupChat with automatic speaker selection (Researcher → Writer → Critic collaboration via GPT-4o-mini)
  • tool_use_with_ag2_agents.ipynb — Agent tool use via AG2's decorator pattern, mapping directly to OpenAI function calling (stock lookup, compound interest calculator)

AG2 is an open-source multi-agent framework with 500K+ monthly PyPI downloads, 4,300+ GitHub stars, and 400+ contributors. It uses OpenAI models as the default LLM backend.

Why this fits the cookbook

  • OpenAI models power the agents — demonstrates production patterns for function calling + multi-agent orchestration
  • Follows existing third_party/ conventions (cf. LlamaIndex, W&B notebooks)
  • Progressive complexity: simple chat → GroupChat → tool use

Test plan

  • Both notebooks execute top-to-bottom without errors (jupyter execute)
  • Two-agent chat produces clean response with TERMINATE
  • GroupChat shows multiple agents taking turns (Researcher → Writer → Critic)
  • Tool use notebook shows function calls being made and correct results returned
  • No hardcoded API keys (os.environ["OPENAI_API_KEY"])
  • Execution counts cleared before commit
  • registry.yaml and authors.yaml updated
  • Passes notebook validation check (check_notebooks.py)
  • Follows PEP 8, four-space indentation

Two notebooks demonstrating AG2 multi-agent capabilities with OpenAI models:
- multi_agent_chat_with_ag2.ipynb: two-agent chat and multi-agent GroupChat
- tool_use_with_ag2_agents.ipynb: tool registration via decorator pattern
@faridun-ag2
Copy link
Copy Markdown
Author

Hi @ted-at-openai @colin-openai !
I would love a review on this when you get a chance. These notebooks demonstrate AG2 multi-agent workflows powered by OpenAI models, following the existing third_party/ conventions.
Happy to address any feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant