[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-microsoft--autogen":3,"tool-microsoft--autogen":64},[4,17,27,35,44,52],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",140436,2,"2026-04-05T23:32:43",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":10,"last_commit_at":41,"category_tags":42,"status":16},4292,"Deep-Live-Cam","hacksider\u002FDeep-Live-Cam","Deep-Live-Cam 是一款专注于实时换脸与视频生成的开源工具，用户仅需一张静态照片，即可通过“一键操作”实现摄像头画面的即时变脸或制作深度伪造视频。它有效解决了传统换脸技术流程繁琐、对硬件配置要求极高以及难以实时预览的痛点，让高质量的数字内容创作变得触手可及。\n\n这款工具不仅适合开发者和技术研究人员探索算法边界，更因其极简的操作逻辑（仅需三步：选脸、选摄像头、启动），广泛适用于普通用户、内容创作者、设计师及直播主播。无论是为了动画角色定制、服装展示模特替换，还是制作趣味短视频和直播互动，Deep-Live-Cam 都能提供流畅的支持。\n\n其核心技术亮点在于强大的实时处理能力，支持口型遮罩（Mouth Mask）以保留使用者原始的嘴部动作，确保表情自然精准；同时具备“人脸映射”功能，可同时对画面中的多个主体应用不同面孔。此外，项目内置了严格的内容安全过滤机制，自动拦截涉及裸露、暴力等不当素材，并倡导用户在获得授权及明确标注的前提下合规使用，体现了技术发展与伦理责任的平衡。",88924,"2026-04-06T03:28:53",[13,14,15,43],"视频",{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":23,"last_commit_at":50,"category_tags":51,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":53,"name":54,"github_repo":55,"description_zh":56,"stars":57,"difficulty_score":23,"last_commit_at":58,"category_tags":59,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,60,43,61,15,62,26,13,63],"数据工具","插件","其他","音频",{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":80,"owner_twitter":81,"owner_website":82,"owner_url":83,"languages":84,"stars":122,"forks":123,"last_commit_at":124,"license":125,"difficulty_score":23,"env_os":126,"env_gpu":126,"env_ram":126,"env_deps":127,"category_tags":135,"github_topics":136,"view_count":146,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":147,"updated_at":148,"faqs":149,"releases":178},4127,"microsoft\u002Fautogen","autogen","A programming framework for agentic AI","AutoGen 是一个由微软推出的编程框架，旨在帮助开发者构建能够自主行动或与人类协作的多智能体（Multi-Agent）AI 应用。它主要解决了单一 AI 模型在处理复杂任务时能力有限的问题，通过让多个具备不同角色的智能体进行对话、协作和工具调用，从而高效完成代码生成、数据分析、网页浏览等复杂工作流。\n\n这款工具特别适合软件开发者和 AI 研究人员使用。对于希望探索下一代 AI 应用架构的技术人员，AutoGen 提供了高度灵活的定制能力；同时，它也提供了 AutoGen Studio 图形界面，让不熟悉代码的用户也能直观地编排智能体流程。\n\nAutoGen 的核心亮点在于其独特的“会话式”协作机制：智能体之间可以像人类团队一样自动交流、互相纠正错误并迭代解决方案。此外，它原生支持模型上下文协议（MCP），能轻松连接外部工具和服务（如浏览器自动化），并兼容多种大语言模型。需要注意的是，虽然 AutoGen 仍在维护中，但微软已推出新的\"Microsoft Agent Framework\"作为未来演进方向，新用户可根据需求选择适合的技术栈。","\u003Ca name=\"readme-top\">\u003C\u002Fa>\n\n\u003Cdiv align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002F0.2\u002Fimg\u002Fag.svg\" alt=\"AutoGen Logo\" width=\"100\">\n\n[![Twitter](https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Furl\u002Fhttps\u002Ftwitter.com\u002Fcloudposse.svg?style=social&label=Follow%20%40pyautogen)](https:\u002F\u002Ftwitter.com\u002Fpyautogen)\n[![LinkedIn](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLinkedIn-Company?style=flat&logo=linkedin&logoColor=white)](https:\u002F\u002Fwww.linkedin.com\u002Fcompany\u002F105812540)\n[![Discord](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdiscord-chat-green?logo=discord)](https:\u002F\u002Faka.ms\u002Fautogen-discord)\n[![Documentation](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDocumentation-AutoGen-blue?logo=read-the-docs)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002F)\n[![Blog](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FBlog-AutoGen-blue?logo=blogger)](https:\u002F\u002Fdevblogs.microsoft.com\u002Fautogen\u002F)\n\n\u003C\u002Fdiv>\n\n# AutoGen\n\n**AutoGen** is a framework for creating multi-agent AI applications that can act autonomously or work alongside humans.\n\n> **Important:** if you are new to AutoGen, please checkout [Microsoft Agent Framework](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fagent-framework).\n> AutoGen will still be maintained and continue to receive bug fixes and critical security patches.\n> Read our [announcement](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fdiscussions\u002F7066).\n\n## Installation\n\nAutoGen requires **Python 3.10 or later**.\n\n```bash\n# Install AgentChat and OpenAI client from Extensions\npip install -U \"autogen-agentchat\" \"autogen-ext[openai]\"\n```\n\nThe current stable version can be found in the [releases](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Freleases). If you are upgrading from AutoGen v0.2, please refer to the [Migration Guide](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fagentchat-user-guide\u002Fmigration-guide.html) for detailed instructions on how to update your code and configurations.\n\n```bash\n# Install AutoGen Studio for no-code GUI\npip install -U \"autogenstudio\"\n```\n\n## Quickstart\n\nThe following samples call OpenAI API, so you first need to create an account and export your key as `export OPENAI_API_KEY=\"sk-...\"`.\n\n### Hello World\n\nCreate an assistant agent using OpenAI's GPT-4o model. See [other supported models](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fagentchat-user-guide\u002Ftutorial\u002Fmodels.html).\n\n```python\nimport asyncio\nfrom autogen_agentchat.agents import AssistantAgent\nfrom autogen_ext.models.openai import OpenAIChatCompletionClient\n\nasync def main() -> None:\n    model_client = OpenAIChatCompletionClient(model=\"gpt-4.1\")\n    agent = AssistantAgent(\"assistant\", model_client=model_client)\n    print(await agent.run(task=\"Say 'Hello World!'\"))\n    await model_client.close()\n\nasyncio.run(main())\n```\n\n### MCP Server\n\nCreate a web browsing assistant agent that uses the Playwright MCP server.\n\n```python\n# First run `npm install -g @playwright\u002Fmcp@latest` to install the MCP server.\nimport asyncio\nfrom autogen_agentchat.agents import AssistantAgent\nfrom autogen_agentchat.ui import Console\nfrom autogen_ext.models.openai import OpenAIChatCompletionClient\nfrom autogen_ext.tools.mcp import McpWorkbench, StdioServerParams\n\n\nasync def main() -> None:\n    model_client = OpenAIChatCompletionClient(model=\"gpt-4.1\")\n    server_params = StdioServerParams(\n        command=\"npx\",\n        args=[\n            \"@playwright\u002Fmcp@latest\",\n            \"--headless\",\n        ],\n    )\n    async with McpWorkbench(server_params) as mcp:\n        agent = AssistantAgent(\n            \"web_browsing_assistant\",\n            model_client=model_client,\n            workbench=mcp, # For multiple MCP servers, put them in a list.\n            model_client_stream=True,\n            max_tool_iterations=10,\n        )\n        await Console(agent.run_stream(task=\"Find out how many contributors for the microsoft\u002Fautogen repository\"))\n\n\nasyncio.run(main())\n```\n\n> **Warning**: Only connect to trusted MCP servers as they may execute commands\n> in your local environment or expose sensitive information.\n\n### Multi-Agent Orchestration\n\nYou can use `AgentTool` to create a basic multi-agent orchestration setup.\n\n```python\nimport asyncio\n\nfrom autogen_agentchat.agents import AssistantAgent\nfrom autogen_agentchat.tools import AgentTool\nfrom autogen_agentchat.ui import Console\nfrom autogen_ext.models.openai import OpenAIChatCompletionClient\n\n\nasync def main() -> None:\n    model_client = OpenAIChatCompletionClient(model=\"gpt-4.1\")\n\n    math_agent = AssistantAgent(\n        \"math_expert\",\n        model_client=model_client,\n        system_message=\"You are a math expert.\",\n        description=\"A math expert assistant.\",\n        model_client_stream=True,\n    )\n    math_agent_tool = AgentTool(math_agent, return_value_as_last_message=True)\n\n    chemistry_agent = AssistantAgent(\n        \"chemistry_expert\",\n        model_client=model_client,\n        system_message=\"You are a chemistry expert.\",\n        description=\"A chemistry expert assistant.\",\n        model_client_stream=True,\n    )\n    chemistry_agent_tool = AgentTool(chemistry_agent, return_value_as_last_message=True)\n\n    agent = AssistantAgent(\n        \"assistant\",\n        system_message=\"You are a general assistant. Use expert tools when needed.\",\n        model_client=model_client,\n        model_client_stream=True,\n        tools=[math_agent_tool, chemistry_agent_tool],\n        max_tool_iterations=10,\n    )\n    await Console(agent.run_stream(task=\"What is the integral of x^2?\"))\n    await Console(agent.run_stream(task=\"What is the molecular weight of water?\"))\n\n\nasyncio.run(main())\n```\n\nFor more advanced multi-agent orchestrations and workflows, read\n[AgentChat documentation](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fagentchat-user-guide\u002Findex.html).\n\n### AutoGen Studio\n\nUse AutoGen Studio to prototype and run multi-agent workflows without writing code.\n\n> **Caution**: AutoGen Studio is meant to help you rapidly prototype multi-agent workflows and\n> demonstrate an example of end user interfaces built with AutoGen. It is **not meant to be a\n> production-ready app**. Developers are encouraged to use the AutoGen framework to build their own\n> applications, implementing authentication, security and other features required for deployed\n> applications. See the [security note](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fdev\u002Fuser-guide\u002Fautogenstudio-user-guide\u002Findex.html#a-note-on-security) for more details.\n\n```bash\n# Run AutoGen Studio on http:\u002F\u002Flocalhost:8080\nautogenstudio ui --port 8080 --appdir .\u002Fmy-app\n```\n\n## Why Use AutoGen?\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmicrosoft_autogen_readme_1acbb080d2d8.jpg\" alt=\"AutoGen Landing\" width=\"500\">\n\u003C\u002Fdiv>\n\nThe AutoGen ecosystem provides everything you need to create AI agents, especially multi-agent workflows -- framework, developer tools, and applications.\n\nThe _framework_ uses a layered and extensible design. Layers have clearly divided responsibilities and build on top of layers below. This design enables you to use the framework at different levels of abstraction, from high-level APIs to low-level components.\n\n- [Core API](.\u002Fpython\u002Fpackages\u002Fautogen-core\u002F) implements message passing, event-driven agents, and local and distributed runtime for flexibility and power. It also support cross-language support for .NET and Python.\n- [AgentChat API](.\u002Fpython\u002Fpackages\u002Fautogen-agentchat\u002F) implements a simpler but opinionated API for rapid prototyping. This API is built on top of the Core API and is closest to what users of v0.2 are familiar with and supports common multi-agent patterns such as two-agent chat or group chats.\n- [Extensions API](.\u002Fpython\u002Fpackages\u002Fautogen-ext\u002F) enables first- and third-party extensions continuously expanding framework capabilities. It support specific implementation of LLM clients (e.g., OpenAI, AzureOpenAI), and capabilities such as code execution.\n\nThe ecosystem also supports two essential _developer tools_:\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmicrosoft_autogen_readme_38691c544e12.png\" alt=\"AutoGen Studio Screenshot\" width=\"500\">\n\u003C\u002Fdiv>\n\n- [AutoGen Studio](.\u002Fpython\u002Fpackages\u002Fautogen-studio\u002F) provides a no-code GUI for building multi-agent applications.\n- [AutoGen Bench](.\u002Fpython\u002Fpackages\u002Fagbench\u002F) provides a benchmarking suite for evaluating agent performance.\n\nYou can use the AutoGen framework and developer tools to create applications for your domain. For example, [Magentic-One](.\u002Fpython\u002Fpackages\u002Fmagentic-one-cli\u002F) is a state-of-the-art multi-agent team built using AgentChat API and Extensions API that can handle a variety of tasks that require web browsing, code execution, and file handling.\n\nWith AutoGen you get to join and contribute to a thriving ecosystem. We host weekly office hours and talks with maintainers and community. We also have a [Discord server](https:\u002F\u002Faka.ms\u002Fautogen-discord) for real-time chat, GitHub Discussions for Q&A, and a blog for tutorials and updates.\n\n## Where to go next?\n\n\u003Cdiv align=\"center\">\n\n|               | [![Python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAutoGen-Python-blue?logo=python&logoColor=white)](.\u002Fpython)                                                                                                                                                                                                                                                                                                                | [![.NET](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAutoGen-.NET-green?logo=.net&logoColor=white)](.\u002Fdotnet)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | [![Studio](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAutoGen-Studio-purple?logo=visual-studio&logoColor=white)](.\u002Fpython\u002Fpackages\u002Fautogen-studio)                        |\n| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Installation  | [![Installation](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FInstall-blue)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fagentchat-user-guide\u002Finstallation.html)                                                                                                                                                                                                                                                         | [![Install](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FInstall-green)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fdotnet\u002Fdev\u002Fcore\u002Finstallation.html)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | [![Install](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FInstall-purple)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fautogenstudio-user-guide\u002Finstallation.html) |\n| Quickstart    | [![Quickstart](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FQuickstart-blue)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fagentchat-user-guide\u002Fquickstart.html#)                                                                                                                                                                                                                                                         | [![Quickstart](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FQuickstart-green)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fdotnet\u002Fdev\u002Fcore\u002Findex.html)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | [![Usage](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FQuickstart-purple)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fautogenstudio-user-guide\u002Fusage.html#)      |\n| Tutorial      | [![Tutorial](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTutorial-blue)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fagentchat-user-guide\u002Ftutorial\u002Findex.html)                                                                                                                                                                                                                                                          | [![Tutorial](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTutorial-green)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fdotnet\u002Fdev\u002Fcore\u002Ftutorial.html)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | [![Usage](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTutorial-purple)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fautogenstudio-user-guide\u002Fusage.html#)        |\n| API Reference | [![API](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDocs-blue)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Freference\u002Findex.html#)                                                                                                                                                                                                                                                                                                 | [![API](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDocs-green)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fdotnet\u002Fdev\u002Fapi\u002FMicrosoft.AutoGen.Contracts.html)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | [![API](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDocs-purple)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fautogenstudio-user-guide\u002Fusage.html)               |\n| Packages      | [![PyPi autogen-core](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyPi-autogen--core-blue?logo=pypi)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fautogen-core\u002F) \u003Cbr> [![PyPi autogen-agentchat](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyPi-autogen--agentchat-blue?logo=pypi)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fautogen-agentchat\u002F) \u003Cbr> [![PyPi autogen-ext](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyPi-autogen--ext-blue?logo=pypi)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fautogen-ext\u002F) | [![NuGet Contracts](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FNuGet-Contracts-green?logo=nuget)](https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FMicrosoft.AutoGen.Contracts\u002F) \u003Cbr> [![NuGet Core](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FNuGet-Core-green?logo=nuget)](https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FMicrosoft.AutoGen.Core\u002F) \u003Cbr> [![NuGet Core.Grpc](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FNuGet-Core.Grpc-green?logo=nuget)](https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FMicrosoft.AutoGen.Core.Grpc\u002F) \u003Cbr> [![NuGet RuntimeGateway.Grpc](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FNuGet-RuntimeGateway.Grpc-green?logo=nuget)](https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FMicrosoft.AutoGen.RuntimeGateway.Grpc\u002F) | [![PyPi autogenstudio](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyPi-autogenstudio-purple?logo=pypi)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fautogenstudio\u002F)                          |\n\n\u003C\u002Fdiv>\n\nInterested in contributing? See [CONTRIBUTING.md](.\u002FCONTRIBUTING.md) for guidelines on how to get started. We welcome contributions of all kinds, including bug fixes, new features, and documentation improvements. Join our community and help us make AutoGen better!\n\nHave questions? Check out our [Frequently Asked Questions (FAQ)](.\u002FFAQ.md) for answers to common queries. If you don't find what you're looking for, feel free to ask in our [GitHub Discussions](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fdiscussions) or join our [Discord server](https:\u002F\u002Faka.ms\u002Fautogen-discord) for real-time support. You can also read our [blog](https:\u002F\u002Fdevblogs.microsoft.com\u002Fautogen\u002F) for updates.\n\n## Legal Notices\n\nMicrosoft and any contributors grant you a license to the Microsoft documentation and other content\nin this repository under the [Creative Commons Attribution 4.0 International Public License](https:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fby\u002F4.0\u002Flegalcode),\nsee the [LICENSE](LICENSE) file, and grant you a license to any code in the repository under the [MIT License](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT), see the\n[LICENSE-CODE](LICENSE-CODE) file.\n\nMicrosoft, Windows, Microsoft Azure, and\u002For other Microsoft products and services referenced in the documentation\nmay be either trademarks or registered trademarks of Microsoft in the United States and\u002For other countries.\nThe licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks.\nMicrosoft's general trademark guidelines can be found at \u003Chttp:\u002F\u002Fgo.microsoft.com\u002Ffwlink\u002F?LinkID=254653>.\n\nPrivacy information can be found at \u003Chttps:\u002F\u002Fgo.microsoft.com\u002Ffwlink\u002F?LinkId=521839>\n\nMicrosoft and any contributors reserve all other rights, whether under their respective copyrights, patents,\nor trademarks, whether by implication, estoppel, or otherwise.\n\n\u003Cp align=\"right\" style=\"font-size: 14px; color: #555; margin-top: 20px;\">\n  \u003Ca href=\"#readme-top\" style=\"text-decoration: none; color: blue; font-weight: bold;\">\n    ↑ Back to Top ↑\n  \u003C\u002Fa>\n\u003C\u002Fp>\n","\u003Ca name=\"readme-top\">\u003C\u002Fa>\n\n\u003Cdiv align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002F0.2\u002Fimg\u002Fag.svg\" alt=\"AutoGen Logo\" width=\"100\">\n\n[![Twitter](https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Furl\u002Fhttps\u002Ftwitter.com\u002Fcloudposse.svg?style=social&label=Follow%20%40pyautogen)](https:\u002F\u002Ftwitter.com\u002Fpyautogen)\n[![LinkedIn](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLinkedIn-Company?style=flat&logo=linkedin&logoColor=white)](https:\u002F\u002Fwww.linkedin.com\u002Fcompany\u002F105812540)\n[![Discord](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdiscord-chat-green?logo=discord)](https:\u002F\u002Faka.ms\u002Fautogen-discord)\n[![Documentation](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDocumentation-AutoGen-blue?logo=read-the-docs)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002F)\n[![Blog](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FBlog-AutoGen-blue?logo=blogger)](https:\u002F\u002Fdevblogs.microsoft.com\u002Fautogen\u002F)\n\n\u003C\u002Fdiv>\n\n# AutoGen\n\n**AutoGen** 是一个用于构建多智能体 AI 应用的框架，这些应用可以自主运行，也可以与人类协作。\n\n> **重要提示**：如果您是 AutoGen 的新用户，请查看 [Microsoft Agent Framework](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fagent-framework)。\n> AutoGen 仍将继续维护，并会持续接收错误修复和关键安全补丁。\n> 请阅读我们的[公告](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fdiscussions\u002F7066)。\n\n## 安装\n\nAutoGen 需要 **Python 3.10 或更高版本**。\n\n```bash\n# 从 Extensions 安装 AgentChat 和 OpenAI 客户端\npip install -U \"autogen-agentchat\" \"autogen-ext[openai]\"\n```\n\n当前的稳定版本可以在 [releases](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Freleases) 中找到。如果您是从 AutoGen v0.2 升级而来，请参阅 [迁移指南](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fagentchat-user-guide\u002Fmigration-guide.html)，以获取有关如何更新代码和配置的详细说明。\n\n```bash\n# 安装 AutoGen Studio 以获得无代码 GUI\npip install -U \"autogenstudio\"\n```\n\n## 快速入门\n\n以下示例会调用 OpenAI API，因此您首先需要创建一个账户，并将您的密钥导出为 `export OPENAI_API_KEY=\"sk-...\"`。\n\n### Hello World\n\n使用 OpenAI 的 GPT-4o 模型创建一个助理代理。请参阅[其他支持的模型](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fagentchat-user-guide\u002Ftutorial\u002Fmodels.html)。\n\n```python\nimport asyncio\nfrom autogen_agentchat.agents import AssistantAgent\nfrom autogen_ext.models.openai import OpenAIChatCompletionClient\n\nasync def main() -> None:\n    model_client = OpenAIChatCompletionClient(model=\"gpt-4.1\")\n    agent = AssistantAgent(\"assistant\", model_client=model_client)\n    print(await agent.run(task=\"说'Hello World!'\"))\n    await model_client.close()\n\nasyncio.run(main())\n```\n\n### MCP 服务器\n\n创建一个使用 Playwright MCP 服务器的网页浏览助理代理。\n\n```python\n# 首先运行 `npm install -g @playwright\u002Fmcp@latest` 来安装 MCP 服务器。\nimport asyncio\nfrom autogen_agentchat.agents import AssistantAgent\nfrom autogen_agentchat.ui import Console\nfrom autogen_ext.models.openai import OpenAIChatCompletionClient\nfrom autogen_ext.tools.mcp import McpWorkbench, StdioServerParams\n\n\nasync def main() -> None:\n    model_client = OpenAIChatCompletionClient(model=\"gpt-4.1\")\n    server_params = StdioServerParams(\n        command=\"npx\",\n        args=[\n            \"@playwright\u002Fmcp@latest\",\n            \"--headless\",\n        ],\n    )\n    async with McpWorkbench(server_params) as mcp:\n        agent = AssistantAgent(\n            \"web_browsing_assistant\",\n            model_client=model_client,\n            workbench=mcp, # 如果有多个 MCP 服务器，可以将它们放入列表中。\n            model_client_stream=True，\n            max_tool_iterations=10,\n        )\n        await Console(agent.run_stream(task=\"查询 microsoft\u002Fautogen 仓库有多少贡献者\"))\n\n\nasyncio.run(main())\n```\n\n> **警告**：仅连接到受信任的 MCP 服务器，因为它们可能会在您的本地环境中执行命令或泄露敏感信息。\n\n### 多智能体编排\n\n您可以使用 `AgentTool` 创建一个基本的多智能体编排设置。\n\n```python\nimport asyncio\n\nfrom autogen_agentchat.agents import AssistantAgent\nfrom autogen_agentchat.tools import AgentTool\nfrom autogen_agentchat.ui import Console\nfrom autogen_ext.models.openai import OpenAIChatCompletionClient\n\n\nasync def main() -> None:\n    model_client = OpenAIChatCompletionClient(model=\"gpt-4.1\")\n\n    数学专家助手 = AssistantAgent(\n        \"math_expert\",\n        model_client=model_client,\n        system_message=\"你是一位数学专家。\",\n        description=\"一位数学专家助手。\",\n        model_client_stream=True，\n    )\n    数学工具 = AgentTool(math_agent, return_value_as_last_message=True)\n\n    化学专家助手 = AssistantAgent(\n        \"chemistry_expert\",\n        model_client=model_client,\n        system_message=\"你是一位化学专家。\",\n        description=\"一位化学专家助手。\",\n        model_client_stream=True，\n    )\n    化学工具 = AgentTool(chemistry_agent, return_value_as_last_message=True)\n\n    助理助手 = AssistantAgent(\n        \"assistant\",\n        system_message=\"你是一位通用助手。必要时可使用专家工具。\",\n        model_client=model_client,\n        model_client_stream=True，\n        tools=[数学工具, 化学工具],\n        max_tool_iterations=10，\n    )\n    await Console(agent.run_stream(task=\"x^2 的积分是多少？\"))\n    await Console(agent.run_stream(task=\"水的分子量是多少？\"))\n\n\nasyncio.run(main())\n```\n\n如需更高级的多智能体编排和工作流，请参阅 [AgentChat 文档](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fagentchat-user-guide\u002Findex.html)。\n\n### AutoGen Studio\n\n使用 AutoGen Studio 可以在无需编写代码的情况下原型设计并运行多智能体工作流。\n\n> **注意**：AutoGen Studio 旨在帮助您快速原型化多智能体工作流，并展示使用 AutoGen 构建的终端用户界面示例。它 **并非生产就绪的应用程序**。建议开发者使用 AutoGen 框架来构建自己的应用程序，实现身份验证、安全性以及其他部署应用所需的特性。更多详情请参阅 [安全注意事项](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fdev\u002Fuser-guide\u002Fautogenstudio-user-guide\u002Findex.html#a-note-on-security)。\n\n```bash\n# 在 http:\u002F\u002Flocalhost:8080 上运行 AutoGen Studio\nautogenstudio ui --port 8080 --appdir .\u002Fmy-app\n```\n\n## 为什么使用 AutoGen？\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmicrosoft_autogen_readme_1acbb080d2d8.jpg\" alt=\"AutoGen 登陆页\" width=\"500\">\n\u003C\u002Fdiv>\n\nAutoGen 生态系统提供了创建 AI 代理所需的一切，尤其是多代理工作流——框架、开发者工具和应用。\n\n该_框架_采用分层且可扩展的设计。各层职责分明，并在下层的基础上构建。这种设计使您能够在不同抽象层次上使用该框架，从高级 API 到低级组件均可适用。\n\n- [Core API](.\u002Fpython\u002Fpackages\u002Fautogen-core\u002F) 实现消息传递、事件驱动型代理以及本地和分布式运行时，以提供灵活性和强大功能。它还支持 .NET 和 Python 的跨语言调用。\n- [AgentChat API](.\u002Fpython\u002Fpackages\u002Fautogen-agentchat\u002F) 提供更简单但具有明确观点的 API，用于快速原型开发。该 API 构建在 Core API 之上，最接近 v0.2 用户熟悉的接口，并支持常见的多代理模式，如双代理对话或群组聊天。\n- [Extensions API](.\u002Fpython\u002Fpackages\u002Fautogen-ext\u002F) 允许第一方和第三方扩展持续增强框架的功能。它支持特定 LLM 客户端的实现（例如 OpenAI、AzureOpenAI），以及代码执行等功能。\n\n该生态系统还支持两种重要的_开发者工具_：\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmicrosoft_autogen_readme_38691c544e12.png\" alt=\"AutoGen Studio 截图\" width=\"500\">\n\u003C\u002Fdiv>\n\n- [AutoGen Studio](.\u002Fpython\u002Fpackages\u002Fautogen-studio\u002F) 提供无代码 GUI，用于构建多代理应用。\n- [AutoGen Bench](.\u002Fpython\u002Fpackages\u002Fagbench\u002F) 提供用于评估代理性能的基准测试套件。\n\n您可以使用 AutoGen 框架和开发者工具为您的领域创建应用。例如，[Magentic-One](.\u002Fpython\u002Fpackages\u002Fmagentic-one-cli\u002F) 是一个基于 AgentChat API 和 Extensions API 构建的先进多代理团队，能够处理需要网络浏览、代码执行和文件操作的各种任务。\n\n通过 AutoGen，您可以加入并贡献于一个蓬勃发展的生态系统。我们每周都会举办维护者与社区成员的线上交流会和讲座。此外，我们还有一个 [Discord 社区](https:\u002F\u002Faka.ms\u002Fautogen-discord) 用于实时聊天，GitHub Discussions 用于问答交流，以及博客用于教程和最新动态分享。\n\n## 接下来该做什么？\n\n\u003Cdiv align=\"center\">\n\n|               | [![Python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAutoGen-Python-blue?logo=python&logoColor=white)](.\u002Fpython)                                                                                                                                                                                                                                                                                                                | [![.NET](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAutoGen-.NET-green?logo=.net&logoColor=white)](.\u002Fdotnet)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | [![Studio](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAutoGen-Studio-purple?logo=visual-studio&logoColor=white)](.\u002Fpython\u002Fpackages\u002Fautogen-studio)                        |\n| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| 安装          | [![Installation](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FInstall-blue)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fagentchat-user-guide\u002Finstallation.html)                                                                                                                                                                                                                                                         | [![Install](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FInstall-green)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fdotnet\u002Fdev\u002Fcore\u002Finstallation.html)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | [![Install](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FInstall-purple)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fautogenstudio-user-guide\u002Finstallation.html) |\n| 快速入门      | [![Quickstart](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FQuickstart-blue)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fagentchat-user-guide\u002Fquickstart.html#)                                                                                                                                                                                                                                                         | [![Quickstart](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FQuickstart-green)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fdotnet\u002Fdev\u002Fcore\u002Findex.html)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | [![Usage](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FQuickstart-purple)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fautogenstudio-user-guide\u002Fusage.html#)      |\n| 教程          | [![Tutorial](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTutorial-blue)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fagentchat-user-guide\u002Ftutorial\u002Findex.html)                                                                                                                                                                                                                                                          | [![Tutorial](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTutorial-green)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fdotnet\u002Fdev\u002Fcore\u002Ftutorial.html)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | [![Usage](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTutorial-purple)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fautogenstudio-user-guide\u002Fusage.html#)        |\n| API 参考      | [![API](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDocs-blue)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Freference\u002Findex.html#)                                                                                                                                                                                                                                                                                                 | [![API](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDocs-green)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fdotnet\u002Fdev\u002Fapi\u002FMicrosoft.AutoGen.Contracts.html)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | [![API](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDocs-purple)](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fautogenstudio-user-guide\u002Fusage.html)               |\n| 软件包        | [![PyPi autogen-core](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyPi-autogen--core-blue?logo=pypi)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fautogen-core\u002F) \u003Cbr> [![PyPi autogen-agentchat](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyPi-autogen--agentchat-blue?logo=pypi)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fautogen-agentchat\u002F) \u003Cbr> [![PyPi autogen-ext](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyPi-autogen--ext-blue?logo=pypi)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fautogen-ext\u002F) | [![NuGet Contracts](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FNuGet-Contracts-green?logo=nuget)](https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FMicrosoft.AutoGen.Contracts\u002F) \u003Cbr> [![NuGet Core](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FNuGet-Core-green?logo=nuget)](https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FMicrosoft.AutoGen.Core\u002F) \u003Cbr> [![NuGet Core.Grpc](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FNuGet-Core.Grpc-green?logo=nuget)](https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FMicrosoft.AutoGen.Core.Grpc\u002F) \u003Cbr> [![NuGet RuntimeGateway.Grpc](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FNuGet-RuntimeGateway.Grpc-green?logo=nuget)](https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FMicrosoft.AutoGen.RuntimeGateway.Grpc\u002F) | [![PyPi autogenstudio](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPyPi-autogenstudio-purple?logo=pypi)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fautogenstudio\u002F)                          |\n\n\u003C\u002Fdiv>\n\n有兴趣贡献吗？请参阅 [CONTRIBUTING.md](.\u002FCONTRIBUTING.md)，了解如何开始的指南。我们欢迎各种形式的贡献，包括修复 bug、新增功能和改进文档。加入我们的社区，帮助我们让 AutoGen 更加完善！\n\n还有疑问吗？请查看我们的[常见问题解答 (FAQ)](.\u002FFAQ.md)，获取常见问题的答案。如果您没有找到所需信息，欢迎在我们的[GitHub 讨论区](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fdiscussions)提问，或加入我们的[Discord 服务器](https:\u002F\u002Faka.ms\u002Fautogen-discord)，以获得实时支持。您也可以阅读我们的[博客](https:\u002F\u002Fdevblogs.microsoft.com\u002Fautogen\u002F)以获取最新动态。\n\n\n\n## 法律声明\n\n微软及任何贡献者在此授予您本仓库中微软文档及其他内容的许可，许可协议为[知识共享署名 4.0 国际许可协议](https:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fby\u002F4.0\u002Flegalcode)，详情请参阅[LICENSE](LICENSE)文件；同时，也授予您本仓库中任何代码的许可，许可协议为[MIT 许可证](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT)，详情请参阅[LICENSE-CODE](LICENSE-CODE)文件。\n\n文档中提及的 Microsoft、Windows、Microsoft Azure 及其他微软产品和服务，可能是微软在美国或其他国家的商标或注册商标。本项目的许可证并未授予您使用任何微软名称、徽标或商标的权利。微软的一般商标使用准则可在 \u003Chttp:\u002F\u002Fgo.microsoft.com\u002Ffwlink\u002F?LinkID=254653> 查阅。\n\n隐私信息请参见 \u003Chttps:\u002F\u002Fgo.microsoft.com\u002Ffwlink\u002F?LinkId=521839>。\n\n微软及任何贡献者保留所有其他权利，无论这些权利是基于各自的版权、专利或商标，还是通过暗示、禁止反言或其他方式产生。\n\n\u003Cp align=\"right\" style=\"font-size: 14px; color: #555; margin-top: 20px;\">\n  \u003Ca href=\"#readme-top\" style=\"text-decoration: none; color: blue; font-weight: bold;\">\n    ↑ 返回顶部 ↑\n  \u003C\u002Fa>\n\u003C\u002Fp>","# AutoGen 快速上手指南\n\nAutoGen 是一个用于创建多智能体 AI 应用的框架，支持智能体自主运行或与人类协作。本指南将帮助你快速搭建环境并运行第一个智能体。\n\n## 环境准备\n\n在开始之前，请确保你的开发环境满足以下要求：\n\n*   **操作系统**：Windows, macOS 或 Linux\n*   **Python 版本**：3.10 或更高版本\n*   **API Key**：需要拥有 OpenAI API Key（或其他支持的模型提供商 Key）\n*   **环境变量**：在终端中设置 Key，例如：\n    ```bash\n    export OPENAI_API_KEY=\"sk-...\"\n    ```\n    *(Windows PowerShell 用户请使用 `$env:OPENAI_API_KEY=\"sk-...\"`)*\n\n> **提示**：国内开发者若访问 PyPI 源较慢，可使用清华或阿里镜像源加速安装（见下文安装步骤）。\n\n## 安装步骤\n\n### 1. 安装核心库\n使用 `pip` 安装 AgentChat 模块及 OpenAI 扩展包。\n\n**官方源安装：**\n```bash\npip install -U \"autogen-agentchat\" \"autogen-ext[openai]\"\n```\n\n**国内镜像源加速安装（推荐）：**\n```bash\npip install -U \"autogen-agentchat\" \"autogen-ext[openai]\" -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n### 2. (可选) 安装 AutoGen Studio\n如果你希望通过图形界面（GUI）无代码构建工作流，可额外安装：\n```bash\npip install -U \"autogenstudio\"\n```\n\n## 基本使用\n\n以下示例展示如何创建一个基于 GPT-4o 模型的助理智能体，并让它输出 \"Hello World!\"。\n\n1.  新建一个 Python 文件（例如 `hello_world.py`）。\n2.  复制以下代码：\n\n```python\nimport asyncio\nfrom autogen_agentchat.agents import AssistantAgent\nfrom autogen_ext.models.openai import OpenAIChatCompletionClient\n\nasync def main() -> None:\n    # 初始化模型客户端，此处以 gpt-4.1 为例，也可替换为 gpt-4o 等其他模型\n    model_client = OpenAIChatCompletionClient(model=\"gpt-4.1\")\n    \n    # 创建助理智能体\n    agent = AssistantAgent(\"assistant\", model_client=model_client)\n    \n    # 运行任务并打印结果\n    print(await agent.run(task=\"Say 'Hello World!'\"))\n    \n    # 关闭客户端连接\n    await model_client.close()\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n3.  在终端运行脚本：\n```bash\npython hello_world.py\n```\n\n运行成功后，你将看到智能体返回的 \"Hello World!\" 消息。\n\n---\n*注：若需体验无代码界面，可在终端运行 `autogenstudio ui --port 8080`，然后在浏览器访问 `http:\u002F\u002Flocalhost:8080`。*","某电商数据团队需要每日从多个新闻源抓取竞品动态，提取关键数据并生成结构化分析报告。\n\n### 没有 autogen 时\n- **流程割裂**：开发人员需分别编写爬虫脚本、调用 NLP 接口进行摘要、再手动整理数据入库，环节间依赖人工衔接。\n- **异常处理困难**：一旦某个新闻网站改版导致爬取失败，整个流水线中断，缺乏自动重试或切换源的机制。\n- **维护成本高**：每增加一个新的数据源或调整报告格式，都需要修改大量硬编码的逻辑，迭代周期长。\n- **无法自主决策**：脚本只能机械执行预设指令，遇到模糊信息（如“销量大幅增长”）无法主动搜索具体数值进行验证。\n\n### 使用 autogen 后\n- **多代理协同**：构建“采集员”、“分析师”和“审核员”三个代理，自动完成从抓取、清洗到撰写报告的全闭环，无需人工干预。\n- **自愈能力**：当采集任务失败时，代理间可自主协商切换备用数据源或调整抓取策略，确保任务持续运行。\n- **灵活扩展**：新增数据源只需配置新的工具接口，autogen 会自动调度代理调用相应能力，大幅降低代码耦合度。\n- **主动推理**：遇到模糊描述时，“分析师”代理能自主调用搜索工具核实具体数据，并在报告中注明信息来源，提升准确性。\n\nautogen 通过将单一脚本升级为可自主协作、具备反思能力的智能体团队，让复杂数据工程从“自动化”迈向了“智能化”。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmicrosoft_autogen_38691c54.png","microsoft","Microsoft","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fmicrosoft_4900709c.png","Open source projects and samples from Microsoft",null,"opensource@microsoft.com","OpenAtMicrosoft","https:\u002F\u002Fopensource.microsoft.com","https:\u002F\u002Fgithub.com\u002Fmicrosoft",[85,89,93,97,101,105,109,112,115,119],{"name":86,"color":87,"percentage":88},"Python","#3572A5",61.6,{"name":90,"color":91,"percentage":92},"C#","#178600",25.1,{"name":94,"color":95,"percentage":96},"TypeScript","#3178c6",12.4,{"name":98,"color":99,"percentage":100},"HTML","#e34c26",0.3,{"name":102,"color":103,"percentage":104},"JavaScript","#f1e05a",0.2,{"name":106,"color":107,"percentage":108},"Jupyter Notebook","#DA5B0B",0.1,{"name":110,"color":111,"percentage":108},"CSS","#663399",{"name":113,"color":114,"percentage":108},"Dockerfile","#384d54",{"name":116,"color":117,"percentage":118},"PowerShell","#012456",0,{"name":120,"color":121,"percentage":118},"Shell","#89e051",56725,8533,"2026-04-05T21:44:38","CC-BY-4.0","未说明",{"notes":128,"python":129,"dependencies":130},"该工具是一个多智能体框架，主要依赖外部大模型 API（如 OpenAI），本地运行无需高性能 GPU。若使用 MCP Server 进行网页浏览任务，需预先安装 Node.js 及 Playwright (@playwright\u002Fmcp)。AutoGen Studio 仅提供无代码原型设计界面，不建议直接用于生产环境，生产部署需自行实现认证与安全机制。","3.10+",[131,132,133,134],"autogen-agentchat","autogen-ext[openai]","autogenstudio","OpenAI Chat Completion Client",[15,14,26,13],[137,138,139,140,141,142,143,67,144,145],"chatgpt","llm-agent","llm-framework","agentic","agentic-agi","agents","ai","framework","autogen-ecosystem",5,"2026-03-27T02:49:30.150509","2026-04-06T11:56:24.345201",[150,155,160,165,169,174],{"id":151,"question_zh":152,"answer_zh":153,"source_url":154},18791,"如何配置 AutoGen 以使用 OpenAI 项目\u002F组织生成的 API Key（非个人用户 Key）？","OpenAI 项目生成的 API Key 格式与个人用户 Key 不同，可能触发 `is_valid_api_key` 的正则验证警告。解决方法是在 `llm_config` 中显式指定 `base_url` 指向代理服务器或组织端点，并传入该 Key。配置示例如下：\n```python\nimport os\nmodel = \"openai-model-allowed-in-baseurl\"\napi_key = os.environ[\"OPENAI_API_KEY\"]\nbase_url = os.environ[\"OPENAI_API_BASE\"] # 指向组织使用的代理服务器\nllm_config = {\n    \"config_list\": [{\n        \"model\": model,\n        \"api_key\": api_key,\n        \"base_url\": base_url,\n        \"cache_seed\": 42\n    }]\n}\n```\n如果仍存在问题，尝试换用个人用户生成的 API Key 通常也能消除警告。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fissues\u002F3345",{"id":156,"question_zh":157,"answer_zh":158,"source_url":159},18792,"遇到 'AttributeError: str object has no attribute get' 错误该如何解决？","该错误通常发生在自定义或兼容 OpenAI 的 API 返回的错误格式不符合标准时。AutoGen 期望错误响应中的 `error` 字段是一个包含 `code`, `message` 等属性的对象，但某些实现返回的是字符串。\n例如，错误的返回格式：\n```json\n{ \"error\": \"Authorization failed...\" }\n```\n正确的 OpenAI 返回格式应为：\n```json\n{\n  \"error\": {\n    \"message\": \"Authorization failed...\",\n    \"type\": \"invalid_request_error\",\n    \"param\": null,\n    \"code\": null\n  }\n}\n```\n请检查您的 API 服务端代码，确保错误响应对象结构符合 OpenAI 标准，避免直接返回字符串作为 `error` 值。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fissues\u002F279",{"id":161,"question_zh":162,"answer_zh":163,"source_url":164},18793,"AutoGen 是否支持集成开源大语言模型（如 LLaMa, Vicuna 等）？","是的，AutoGen 现已支持开源和开放权重的模型。您可以参考官方文档了解如何配置和使用非 OpenAI 模型：https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fdocs\u002Ftopics\u002Fnon-openai-models\u002Fabout-using-nonopenai-models。\n此外，对于不支持工具调用（tool calls）的开源模型，可以通过定义用户自定义函数（user defined functions）来实现类似功能，详见：https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fdocs\u002Ftopics\u002Fcode-execution\u002Fuser-defined-functions","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fissues\u002F46",{"id":166,"question_zh":167,"answer_zh":168,"source_url":159},18794,"任务执行完毕后出现空消息或助手不知道如何继续，如何处理？","当助手无法生成有效回复导致消息为空时，可以为 UserProxyAgent 设置 `default_auto_reply` 参数，提供一个默认的自动回复消息，防止流程中断。配置示例：\n```python\nuser_proxy = autogen.UserProxyAgent(\n    name=\"user_proxy\",\n    human_input_mode=\"NEVER\",\n    max_consecutive_auto_reply=10,\n    is_termination_msg=lambda x: x.get(\"content\", \"\").rstrip().endswith(\"TERMINATE\"),\n    code_execution_config={\n        \"work_dir\": \"coding\",\n        \"use_docker\": True,\n    },\n    default_auto_reply=\"Sorry, I couldn't process that request.\"  # 设置默认自动回复\n)\n```\n这有助于在模型无法生成内容时维持对话流程或明确终止条件。",{"id":170,"question_zh":171,"answer_zh":172,"source_url":173},18795,"如何获取贡献者的 Discord ID 以便在社区中致谢？","维护者通常会在专门的 Issue 线程中邀请贡献者留下他们的 Discord ID。如果您希望被收录或在社区中被提及，可以在相关 Issue（如收集 ID 的帖子）下回复您的 Discord 用户名。例如，在微软 AutoGen 项目中，曾有 Issue 专门用于收集贡献者 ID，您只需在该帖下评论您的 ID 即可（如 `monagdy4786` 或 `mariano_mmm`）。同时，您可以加入官方 Discord 服务器（https:\u002F\u002Fdiscord.gg\u002FpAbnFJrkgZ）参与社区交流。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fissues\u002F2310",{"id":175,"question_zh":176,"answer_zh":177,"source_url":154},18796,"使用本地或兼容 OpenAI 的 API 时，为什么会出现 UnicodeEncodeError 编码错误？","该错误（`UnicodeEncodeError: 'ascii' codec can't encode character...`）通常是因为终端或环境变量默认使用 ASCII 编码，而模型返回的内容包含特殊字符（如中文引号 '\\u201c'）。\n解决方案包括：\n1. 确保运行环境的 Python 默认编码设置为 UTF-8（可在启动脚本前添加 `import sys; sys.setdefaultencoding('utf-8')` 或在环境变量中设置 `PYTHONIOENCODING=utf-8`）。\n2. 检查打印输出时的编码处理，避免在仅支持 ASCII 的终端直接打印包含非 ASCII 字符的字符串。\n3. 如果是 API 返回数据解析问题，确保在读取和打印响应内容时使用 `.encode('utf-8')` 或正确处理字符串编码。",[179,184,189,194,199,204,209,214,219,224,229,234,239,244,249,254,259,264,269,274],{"id":180,"version":181,"summary_zh":182,"released_at":183},109299,"python-v0.7.5","## 变更内容\n* 修复 .NET Core 文档中的拼写错误，由 @lach-g 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6950 中完成\n* 修复在工具使用时加载空参数的 Bedrock 流式响应问题，由 @pawel-dabro 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6979 中完成\n* 支持 RedisMemory 中的线性内存，由 @justin-cechmanek 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6972 中完成\n* 修复流式分块与最终消息之间关联的消息 ID 问题，由 @smalltalkman 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6969 中完成\n* 修复额外参数无法禁用思考功能的问题，由 @liuyunrui123 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F7006 中完成\n* 为 Anthropic 客户端添加思考模式支持，由 @SrikarMannepalli 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F7002 中完成\n* 修复因流式传输中 reasoning_content 为空字符串而导致的误加 \u003C\u002Fthink> 标签问题，由 @Copilot 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F7025 中完成\n* 修复 GraphFlow 循环检测逻辑，以正确清理递归状态，由 @Copilot 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F7026 中完成\n* 添加关于 AutoGen 开发的全面 GitHub Copilot 指南，由 @Copilot 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F7029 中完成\n* 修复由于未处理字符串值导致 Redis 缓存始终返回 False 的问题，由 @Copilot 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F7022 中完成\n* 通过将 OllamaChatCompletionClient 添加到 WELL_KNOWN_PROVIDERS 中，修复其 load_component() 方法的错误，由 @Copilot 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F7030 中完成\n* 修复 Azure AI 客户端流式响应中的 finish_reason 逻辑，由 @litterzhang 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6963 中完成\n* 添加安全警告，并将默认执行器设置为 DockerCommandLineCodeExecutor，由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F7035 中完成\n* 修复 JSON 模式转换中对数组项中嵌套对象的处理问题，由 @kkutrowski 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6993 中完成\n* 修复 count_tokens_openai 中针对不支持字段的警告信息，由 @seunggil1 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6987 中完成\n* 修复（mcp）：在 McpSessionActor 失败时清空待处理的命令 Future，由 @withsmilo 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F7045 中完成\n* 为 OpenAI GPT-5 模型添加缺失的 reasoning_effort 参数支持，由 @Copilot 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F7054 中完成\n* 将版本更新至 0.7.5，由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F7058 中完成\n\n## 新贡献者\n* @lach-g 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6950 中完成了首次贡献\n* @pawel-dabro 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6979 中完成了首次贡献\n* @smalltalkman 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6969 中完成了首次贡献\n* @liuyunrui123 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F7006 中完成了首次贡献\n* @SrikarMannepalli 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F7002 中完成了首次贡献\n* @litterzhang 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6963 中完成了首次贡献\n* @kkutrowski 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fa 中完成了首次贡献","2025-09-30T06:18:26",{"id":185,"version":186,"summary_zh":187,"released_at":188},109300,"python-v0.7.4","## 变更内容\n* @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6948 中更新了 0.7.3 版本的文档\n* @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6949 中更新了 README，加入了“代理即工具”的相关内容\n* @BenConstable9 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6952 中修复了 Redis 反序列化错误\n* @BenConstable9 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6954 中指出 Redis 不支持流式传输\n* @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6955 中将版本号更新至 0.7.4\n* @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6956 中更新了 0.7.4 版本的文档\n\n## 新贡献者\n* @BenConstable9 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6952 中完成了首次贡献\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fcompare\u002Fpython-v0.7.3...python-v0.7.4","2025-08-19T18:50:49",{"id":190,"version":191,"summary_zh":192,"released_at":193},109301,"python-v0.7.3","## 变更内容\n* @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6902 中更新了 0.7.2 版本的网站\n* @nicsuzor 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6915 中修复了关于 'NoOpTracerProvider' 的文档中的拼写错误\n* @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6919 中修复了自述文件中的 MCP 示例\n* @fiow123 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6925 中扩展了 Pydantic 模型对 anyOf\u002FoneOf 项类型的处理能力\n* @Jp3132 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6942 中更新 README.md，使用正确的稳定版本\n* @tejas-dharani 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6905 中修复：为 RedisStore 添加对复杂对象的正确序列化支持\n* @alexey-pelykh 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6936 中修复 OpenAIAgent 的函数工具模式\n* @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6945 中添加了关于 gpt-5 的模型信息\n* @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6943 中更新 OpenAIAgent，以反映其在支持自定义函数工具方面的不足\n* @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6946 中确保任务运行器工具始终严格\n* @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6947 中将版本更新至 0.7.3\n\n## 新贡献者\n* @nicsuzor 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6915 中完成了首次贡献\n* @fiow123 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6925 中完成了首次贡献\n* @Jp3132 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6942 中完成了首次贡献\n* @alexey-pelykh 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6936 中完成了首次贡献\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fcompare\u002Fpython-v0.7.2...python-v0.7.3","2025-08-19T08:07:55",{"id":195,"version":196,"summary_zh":197,"released_at":198},109302,"python-v0.7.2","## 变更内容\n* 由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6869 中更新网站 0.7.1 版本\n* 由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6870 中更新 OpenAIAssistantAgent 文档\n* 由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6871 中更新 0.7.1 版本的网站引用\n* 由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6866 中从 OpenAIAgent 中移除与助手相关的方法\n* 由 @Copilot 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6684 中将 DockerCommandLineCodeExecutor 设置为 MagenticOne 团队的默认配置\n* 由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6886 中为 CodeExecutorAgent 添加 approval_func 选项\n* 由 @Copilot 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6883 中为 AgentTool\u002FTeamTool 的并行工具调用限制添加文档警告\n* 由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6888 中将 parallel_tool_call 添加到 OpenAI 模型客户端配置中\n* 由 @Copilot 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6889 中修复使用 SerializeAsAny 注解时结构化日志序列化数据丢失的问题\n* 由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6895 中更新版本 0.7.2\n* 由 @justin-cechmanek 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6897 中为 Redis 代理内存添加对 JSON 和 MARKDOWN 的支持\n* 由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6901 中为 MCP 服务器文档添加警告\n\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fcompare\u002Fpython-v0.7.1...python-v0.7.2","2025-08-07T00:29:24",{"id":200,"version":201,"summary_zh":202,"released_at":203},109303,"python-v0.7.1","## 新增功能\n\n### `OpenAIAgent` 支持所有内置工具\n\n* 功能\u002FOpenAI 代理内置工具 6657，由 @tejas-dharani 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6671 中实现\n\n### 支持将嵌套的 `Team` 作为 `Team` 的参与者\n\n* 支持团队作为 GroupChat 的参与者，由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5863 中实现\n\n### 引入 `RedisMemory`\n\n* 添加 Redis Memory 扩展类，由 @justin-cechmanek 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6743 中实现\n\n### 升级到最新 MCP 版本\n\n* 升级 MCP 版本，由 @victordibia 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6814 中实现\n* 扩展 MCP Workbench 以支持更多 MCP 客户端功能，由 @tylerpayne 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6785 中实现\n\n### 升级到最新 GraphRAG 版本\n\n* 将 GraphRAG 升级至 v2.3 及以上版本，由 @victordibia 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6744 中实现\n\n### `include_name_in_message` 标志，使通过 OpenAI 客户端发送的聊天消息中 `name` 字段变为可选\n\n* 添加 `include_name_in_message` 参数，使 OpenAI 消息中的 `name` 字段变为可选，由 @Copilot 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6845 中实现\n\n## 全部变更\n* 功能\u002FOpenAI 代理内置工具 6657，由 @tejas-dharani 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6671 中实现\n* 为 pyautogen 包设置发布流程，由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6813 中实现\n* 在添加必要的终止条件和缺失的 agent_e 中，由 @dave-howard 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6809 中实现\n* 修复团队状态的 JSON 序列化问题，通过在消息转储中处理 datetime 对象来实现，由 @Copilot 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6797 中实现\n* 升级 MCP 版本，由 @victordibia 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6814 中实现\n* 更新 AGS（支持 Workbenches ++），由 @victordibia 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6736 中实现\n* 功能：为 HTTP 工具添加超时机制，由 @lo5twind 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6818 中实现\n* 扩展 MCP Workbench 以支持更多 MCP 客户端功能，由 @tylerpayne 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6785 中实现\n* 弃用 openai 助理代理。对 open ai 版本 \u003C 1.83 应用版本条件导入，由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6827 中实现\n* 修复 AssistantAgent 进行多次工具调用时出现的 OpenAI UnprocessableEntityError 错误，由 @Copilot 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6799 中实现\n* 修复：在向 mem0 添加记忆时使用正确格式，由 @savy-91 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6831 中实现\n* 添加 Redis Memory 扩展类，由 @justin-cechmanek 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6743 中实现\n* 在 JSON 模式中添加对 `\"format\": \"json\"` 的支持，由 @onematchfox 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6846 中实现\n* 文档：修正函数拼写错误，由 @savy-91 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6849 中实现\n* 添加 `include_name_in_message` 参数，使 OpenAI 消息中的 `name` 字段变为可选，由 @Copilot 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6845 中实现\n* 升级 graphrag s","2025-07-28T08:43:20",{"id":205,"version":206,"summary_zh":207,"released_at":208},109304,"python-v0.6.4","# 新增内容\n\n此版本中，@copilot-swe-agent 提供了更多帮助。\n\n### `GraphFlow` 的改进\n\n现在，当终止条件满足时，`GraphFlow` 的行为与其他组件（如 `RoundRobinGroupChat`、`SelectorGroupChat` 等）一致：它会保留当前的执行状态，并可使用新任务或空任务继续执行。只有在图完全执行完毕——即没有可用的下一个代理可以选择时——执行状态才会被重置。\n\n此外，内部的 `StopAgent` 已被移除，不会再有来自该代理的最后一条消息。取而代之的是，`TaskResult` 中的 `stop_reason` 字段将携带停止信息。\n\n- 修复 `GraphFlow`，使其支持多次任务执行，无需显式重置，由 @copilot-swe-agent 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6747 中完成\n- 修复 `GraphFlowManager` 的终止逻辑，以防止 `_StopAgent` 污染对话上下文，由 @copilot-swe-agent 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6752 中完成\n\n### `Workbench` 实现的改进\n\n`McpWorkbench` 和 `StaticWorkbench` 现在支持覆盖工具名称和描述。这使得客户端可以对服务器端的工具进行优化，从而提高适应性。\n\n- 为 `Workbench` 实现添加工具名称和描述的覆盖功能，由 @copilot-swe-agent 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6690 中完成\n\n## 所有变更\n* 更新文档版本，由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6737 中完成\n* 修复 Llama3.3 的函数调用支持，由 @Z1m4-blu3 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6750 中完成\n* 修复 `GraphFlow`，使其支持多次任务执行，无需显式重置，由 @copilot-swe-agent 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6747 中完成\n* 修复 `GraphFlowManager` 的终止逻辑，以防止 `_StopAgent` 污染对话上下文，由 @copilot-swe-agent 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6752 中完成\n* 为 `Workbench` 实现添加工具名称和描述的覆盖功能，由 @copilot-swe-agent 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6690 中完成\n* 在 AutoGen Extensions 中添加 DuckDuckGo 搜索工具和代理，由 @varadsrivastava 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6682 中完成\n* 添加自动生成 API 文档的脚本，由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6755 中完成\n* 将 `docs` 从 `python\u002Fpackages\u002Fautogen-core` 移至 `python\u002Fdocs`，由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6757 中完成\n* 为 AssistantAgent 添加 Claude 模型的反射功能，由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6763 中完成\n* 将 autogen-ext-yepcode 项目加入社区项目，由 @marcos-muino-garcia 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6764 中完成\n* 将 GitHub Models 的 URL 更新为新地址，由 @sgoedecke 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6759 中完成\n* 使 `SingleThreadedAgentRuntime` 对 `factory_wrapper` 使用子类检查而非等值比较，由 @ZenWayne 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6731 中完成\n* 功能：添加 Qwen2.5VL 支持，由 @rfsousa 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6650 中完成\n*","2025-07-09T17:52:40",{"id":210,"version":211,"summary_zh":212,"released_at":213},109305,"python-v0.6.2","## 新增功能\n\n### 流式工具\n\n此版本引入了流式工具，并更新了 `AgentTool` 和 `TeamTool` 以支持 `run_json_stream`。新接口在调用代理和团队的 `run_stream` 方法时，会暴露工具内部事件。`AssistantAgent` 也进行了更新，在工具支持流式处理的情况下，将使用 `run_json_stream`。因此，当您将 `AgentTool` 或 `TeamTool` 与 `AssistantAgent` 配合使用时，可以通过主代理接收内部代理或团队的事件。\n\n要创建新的流式工具，需继承 `autogen_core.tools.BaseStreamTool` 类并实现 `run_stream` 方法。要创建新的流式工作台，需继承 `autogen_core.tools.StreamWorkbench` 类并实现 `call_tool_stream` 方法。\n\n* 引入流式工具，并为 `AgentTool` 和 `TeamTool` 添加流式支持。由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6712 中完成。\n\n### `ChatCompletionClient` 及其子类的 `tool_choice` 参数\n\n在 `ChatCompletionClient` 的 `create` 和 `create_stream` 方法中新增了 `tool_choice` 参数。\n\n**这也是 @copliot-swe-agent 提交的第一个 PR！**\n\n* 向 `ChatCompletionClient` 的 `create` 和 `create_stream` 方法添加 `tool_choice` 参数，由 @copilot-swe-agent 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6697 中完成。\n\n### `AssistantAgent` 的内部工具调用循环\n\n现在可以通过在其构造函数中设置 `max_tool_iterations` 参数，启用 `AssistantAgent` 的内部工具调用循环。新实现会不断调用模型并执行工具，直到 (1) 模型不再生成工具调用，或 (2) 达到 `max_tool_iterations` 次数为止。这一更改简化了 `AssistantAgent` 的使用。\n\n* 功能：工具调用循环，由 @tejas-dharani 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6651 中完成。\n\n### OpenTelemetry GenAI 跟踪\n\n此版本新增了来自 [GenAI 语义规范](https:\u002F\u002Fopentelemetry.io\u002Fdocs\u002Fspecs\u002Fsemconv\u002Fgen-ai\u002Fgen-ai-agent-spans\u002F) 的新跟踪记录 `create_agent`、`invoke_agent` 和 `execute_tool`。\n\n* 为代理和工具添加 OTel GenAI 跟踪，由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6653 中完成。\n\n您还可以通过设置环境变量 `AUTOGEN_DISABLE_RUNTIME_TRACING=true` 来禁用代理运行时跟踪。\n\n* 添加用于禁用运行时跟踪的环境变量，由 @EItanya 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6681 中完成。\n\n### `output_task_messages` 标志，适用于 `run` 和 `run_stream`\n\n您可以使用此新标志来自定义输入的 `task` 消息是否作为代理和团队的 `run_stream` 输出的一部分被发出。\n\n* 修复输出任务消息问题 6150，由 @tejas-dharani 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6678 中完成。\n\n### Mem0 扩展\n\n新增了 Mem0 内存扩展，以便您可以将其用作 AutoGen 代理的内存。\n\n* 添加 Mem0 内存实现，由 @alpha-xone 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6510 中完成。\n\n### 对 `GraphFlow` 的改进\n\n* 为包含多个循环的工作流添加激活组，由 @ZenWayne 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6711 中完成。\n\n### `uv` 更新\n\n我们已经移除了…","2025-07-01T00:09:01",{"id":215,"version":216,"summary_zh":217,"released_at":218},109306,"python-v0.6.1","## Bug 修复\n* 由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6629 中修复了 GraphFlow 循环检测中的 bug\n* 由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6630 中修复了图验证逻辑并添加了测试\n\n## 其他\n* 由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6626 中向 `ToolCallSummaryMessage` 添加了函数调用及结果列表\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fcompare\u002Fpython-v0.6.0...python-v0.6.1","2025-06-05T05:58:03",{"id":220,"version":221,"summary_zh":222,"released_at":223},109307,"python-v0.6.0","## 新增功能\n\n### `BaseGroupChatManager.select_speaker` 方法的变更及 `GraphFlow` 对并发代理的支持\n\n我们对 `BaseGroupChatManager` 类中的 `select_speaker` 方法进行了类型提示的调整，使其返回值可以是代理名称的列表。这一改动使得 `GraphFlow` 能够支持并发代理，例如在扇出-扇入模式中。\n\n```python\n# 原始签名：\nasync def select_speaker(self, thread: Sequence[BaseAgentEvent | BaseChatMessage]) -> str:\n  ...\n\n# 新签名：\nasync def select_speaker(self, thread: Sequence[BaseAgentEvent | BaseChatMessage]) -> List[str] | str:\n  ...\n```\n\n现在，您可以按照以下方式运行包含并发代理的 `GraphFlow`：\n\n```python\nimport asyncio\n\nfrom autogen_agentchat.agents import AssistantAgent\nfrom autogen_agentchat.conditions import MaxMessageTermination\nfrom autogen_agentchat.teams import DiGraphBuilder, GraphFlow\nfrom autogen_ext.models.openai import OpenAIChatCompletionClient\n\n\nasync def main():\n    # 使用 OpenAI 模型客户端初始化代理。\n    model_client = OpenAIChatCompletionClient(model=\"gpt-4.1-nano\")\n    agent_a = AssistantAgent(\"A\", model_client=model_client, system_message=\"你是一位乐于助人的助手。\")\n    agent_b = AssistantAgent(\"B\", model_client=model_client, system_message=\"将输入翻译成中文。\")\n    agent_c = AssistantAgent(\"C\", model_client=model_client, system_message=\"将输入翻译成日语。\")\n\n    # 创建一个具有扇出流 A -> (B, C) 的有向图。\n    builder = DiGraphBuilder()\n    builder.add_node(agent_a).add_node(agent_b).add_node(agent_c)\n    builder.add_edge(agent_a, agent_b).add_edge(agent_a, agent_c)\n    graph = builder.build()\n\n    # 使用该有向图创建一个 `GraphFlow` 团队。\n    team = GraphFlow(\n        participants=[agent_a, agent_b, agent_c],\n        graph=graph,\n        termination_condition=MaxMessageTermination(5),\n    )\n\n    # 运行团队并打印事件。\n    async for event in team.run_stream(task=\"写一篇关于猫的小故事。\"):\n        print(event)\n\n\nasyncio.run(main())\n```\n\n在此示例中，代理 B 和 C 将在各自的协程中并发执行。\n\n* 由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6545 中实现，支持在 `GraphFlow` 中并发执行代理。\n\n### `GraphFlow` 边缘的可调用条件\n\n现在，您可以在 `GraphFlow` 中使用 lambda 函数或其他可调用对象来指定边的条件。这解决了基于关键字子字符串的条件无法覆盖所有情况，从而导致“找不到下一个代理”错误的问题。\n\n> **注意**：可调用条件目前仍处于实验阶段，且无法与图一起序列化。\n\n* 由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6623 中添加，为 `GraphFlow` 边缘引入可调用条件。\n\n### 新代理：`OpenAIAgent`\n\n* 功能：由 @jay-thakur 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6418 中添加，推出基于 OpenAI Response API 的 `OpenAIAgent`。\n\n### MCP 改进\n\n* 支持可流式传输的 HTTP","2025-06-05T00:37:44",{"id":225,"version":226,"summary_zh":227,"released_at":228},109308,"python-v0.5.7","## 新增功能\n\n### `AzureAISearchTool` 改进\n\nAzure AI 搜索工具 API 现在提供了统一的方法：\n- `create_full_text_search()`（支持 `\"simple\"`、`\"full\"` 和 `\"semantic\"` 查询类型）\n- `create_vector_search()`\n- `create_hybrid_search()`\n\n我们还增加了对客户端嵌入的支持，而在未提供客户端嵌入时，则默认使用服务端嵌入。\n\n**如果您一直在使用 `create_keyword_search()`，请将代码更新为使用 `create_full_text_search()` 并指定 `\"simple\"` 查询类型。**\n\n* 由 @jay-thakur 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6511 中简化 Azure AI 搜索工具\n\n### `SelectorGroupChat` 改进\n\n为了支持基于模型的选择器在 `SelectorGroupChat` 中处理长上下文，您可以通过新的 `model_context` 参数传递一个模型上下文对象，以自定义在选择下一位发言者时发送给模型客户端的消息。\n\n* 由 @Ethan0456 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6330 中为 `SelectorGroupChat` 添加 `model_context`，以增强发言者选择功能\n\n### OTEL 跟踪改进\n\n我们为 `SingleThreadedAgentRuntime` 发出的 OTEL 跟踪添加了新的元数据和消息内容字段。\n\n* 由 @peterychang 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6499 中改进 OTEL 跟踪\n\n### Agent 运行时改进\n\n* 由 @peterychang 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6131 中添加注册 Agent 实例的功能\n\n## 其他 Python 相关更改\n* 由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6454 中更新网站 0.5.6 版本\n* 由 @DavidYu00 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6422 中提供 Core API 与 Chainlit 集成的示例\n* 由 @emmanuel-ferdman 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6473 中修复 Gitty 提示信息\n* 由 @xionnon 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6487 中修复并移动 createTeam 函数\n* 由 @victordibia 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6493 中更新 docs.yml 文件\n* 由 @victordibia 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6492 中添加 gpt 4o 搜索功能\n* 由 @AndreaTang123 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6409 中修复头部图标聚焦和悬停样式，以提升可访问性\n* 由 @peterychang 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6499 中改进 OTEL 跟踪\n* 由 @victordibia 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6489 中修复 AnthropicBedrockChatCompletionClient 导入错误\n* 由 @SongChiYoung 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6497 中修复 MCP 工作台删除时会话自动关闭的问题\n* 由 @peterj 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6482 中修复 MCP 服务器工具抛出的异常无法序列化的问题\n* 由 @ekzhu 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6518 中更新版本 0.5.7\n* 由 @SongChiYoung 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6503 中修复 Mistral 无法接收 name 字段的问题\n\n## 新贡献者\n* @emmanuel-ferdman 在 https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6473 中做出了首次贡献\n\n**完整变更日志**","2025-05-14T05:02:29",{"id":230,"version":231,"summary_zh":232,"released_at":233},109309,"python-v0.5.6","## What's New\r\n\r\n### GraphFlow: customized workflows using directed graph\r\n\r\nShould I say finally? Yes, finally, we have workflows in AutoGen. `GraphFlow` is a new team class as part of the AgentChat API. One way to think of `GraphFlow` is that it is a version of `SelectorGroupChat` but with a directed graph as the `selector_func`. However, it is actually more powerful, because the abstraction also supports concurrent agents. \r\n\r\n**Note: `GraphFlow` is still an experimental API. Watch out for changes in the future releases.**\r\n\r\nFor more details, see our newly added [user guide on GraphFlow](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fagentchat-user-guide\u002Fgraph-flow.html).\r\n\r\nIf you are in a hurry, here is an example of creating a fan-out-fan-in workflow:\r\n\r\n```python\r\nimport asyncio\r\nfrom autogen_agentchat.agents import AssistantAgent\r\nfrom autogen_agentchat.teams import DiGraphBuilder, GraphFlow\r\nfrom autogen_agentchat.ui import Console\r\nfrom autogen_ext.models.openai import OpenAIChatCompletionClient\r\n\r\n\r\nasync def main() -> None:\r\n    # Create an OpenAI model client\r\n    client = OpenAIChatCompletionClient(model=\"gpt-4.1-nano\")\r\n\r\n    # Create the writer agent\r\n    writer = AssistantAgent(\r\n        \"writer\",\r\n        model_client=client,\r\n        system_message=\"Draft a short paragraph on climate change.\",\r\n    )\r\n\r\n    # Create two editor agents\r\n    editor1 = AssistantAgent(\r\n        \"editor1\", model_client=client, system_message=\"Edit the paragraph for grammar.\"\r\n    )\r\n\r\n    editor2 = AssistantAgent(\r\n        \"editor2\", model_client=client, system_message=\"Edit the paragraph for style.\"\r\n    )\r\n\r\n    # Create the final reviewer agent\r\n    final_reviewer = AssistantAgent(\r\n        \"final_reviewer\",\r\n        model_client=client,\r\n        system_message=\"Consolidate the grammar and style edits into a final version.\",\r\n    )\r\n\r\n    # Build the workflow graph\r\n    builder = DiGraphBuilder()\r\n    builder.add_node(writer).add_node(editor1).add_node(editor2).add_node(\r\n        final_reviewer\r\n    )\r\n\r\n    # Fan-out from writer to editor1 and editor2\r\n    builder.add_edge(writer, editor1)\r\n    builder.add_edge(writer, editor2)\r\n\r\n    # Fan-in both editors into final reviewer\r\n    builder.add_edge(editor1, final_reviewer)\r\n    builder.add_edge(editor2, final_reviewer)\r\n\r\n    # Build and validate the graph\r\n    graph = builder.build()\r\n\r\n    # Create the flow\r\n    flow = GraphFlow(\r\n        participants=builder.get_participants(),\r\n        graph=graph,\r\n    )\r\n\r\n    # Run the workflow\r\n    await Console(flow.run_stream(task=\"Write a short biography of Steve Jobs.\"))\r\n\r\nasyncio.run(main())\r\n```\r\n\r\nMajor thanks to @abhinav-aegis for the initial design and implementation of this amazing feature! \r\n\r\n* Added Graph Based Execution functionality to Autogen by @abhinav-aegis in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6333\r\n* Aegis graph docs by @abhinav-aegis in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6417\r\n\r\n## Azure AI Agent Improvement\r\n\r\n* Add support for Bing grounding citation URLs by @abdomohamed in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6370\r\n\r\n## New Sample\r\n\r\n* A multi-agent PostgreSQL data management example by @mehrsa in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6443\r\n\r\n## Bug Fixes:\r\n\r\n* [FIX] DockerCommandLineCodeExecutor multi event loop aware by @SongChiYoung in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6402\r\n* FIX: GraphFlow serialize\u002Fdeserialize and adding test by @SongChiYoung in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6434\r\n* FIX: `MultiModalMessage` in gemini with openai sdk error occured by @SongChiYoung in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6440\r\n* FIX\u002FMcpWorkbench_errors_properties_and_grace_shutdown by @SongChiYoung in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6444\r\n* FIX: resolving_workbench_and_tools_conflict_at_desirialize_assistant_agent by @SongChiYoung in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6407\r\n\r\n## Dev Improvement\r\n\r\n* Speed up Docker executor unit tests: 161.66s -> 108.07 by @SongChiYoung in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6429\r\n\r\n## Other Python Related Changes\r\n* Update website for v0.5.5 by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6401\r\n* Add more mcp workbench examples to MCP API doc by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6403\r\n* Adding bedrock chat completion for anthropic models by @HariniNarasimhan in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6170\r\n* Add missing dependency to tracing docs by @victordibia in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6421\r\n* docs: Clarify missing dependencies in documentation (fix #6076) by @MarsWangyang in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6406\r\n* Bing grounding citations by @abdomohamed in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6370\r\n* Fix: Icons are not aligned vertically. by @xionnon in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6369\r\n* Fix: Reduce multiple H1s to H2s in Distributed Agent Runtime page by @LuluZhuu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6412","2025-05-02T22:55:03",{"id":235,"version":236,"summary_zh":237,"released_at":238},109310,"python-v0.5.5","## What's New\r\n\r\n### Introduce `Workbench`\r\n\r\nA workbench is a collection of tools that share state and resource. For example, you can now use MCP server through `McpWorkbench` rather than using tool adapters. This makes it possible to use MCP servers that requires a shared session among the tools (e.g., login session). \r\n\r\nHere is an example of using `AssistantAgent` with [GitHub MCP Server](https:\u002F\u002Fgithub.com\u002Fgithub\u002Fgithub-mcp-server).\r\n\r\n```python\r\nimport asyncio\r\nimport os\r\nfrom autogen_agentchat.agents import AssistantAgent\r\nfrom autogen_agentchat.ui import Console\r\nfrom autogen_ext.models.openai import OpenAIChatCompletionClient\r\nfrom autogen_ext.tools.mcp import McpWorkbench, StdioServerParams\r\n\r\nasync def main() -> None:\r\n    model_client = OpenAIChatCompletionClient(model=\"gpt-4.1-nano\")\r\n    server_params = StdioServerParams(\r\n        command=\"docker\",\r\n        args=[\r\n            \"run\",\r\n            \"-i\",\r\n            \"--rm\",\r\n            \"-e\",\r\n            \"GITHUB_PERSONAL_ACCESS_TOKEN\",\r\n            \"ghcr.io\u002Fgithub\u002Fgithub-mcp-server\",\r\n        ],\r\n        env={\r\n            \"GITHUB_PERSONAL_ACCESS_TOKEN\": \"ghp_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\r\n        }\r\n    )\r\n    async with McpWorkbench(server_params) as mcp:\r\n        agent = AssistantAgent(\r\n            \"github_assistant\",\r\n            model_client=model_client,\r\n            workbench=mcp,\r\n            reflect_on_tool_use=True,\r\n            model_client_stream=True,\r\n        )\r\n        await Console(agent.run_stream(task=\"Is there a repository named Autogen\"))\r\n    \r\nasyncio.run(main())\r\n```\r\n\r\nHere is another example showing a web browsing agent using [Playwright MCP Server](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-mcp), `AssistantAgent` and `RoundRobinGroupChat`. \r\n\r\n```python\r\n# First run `npm install -g @playwright\u002Fmcp@latest` to install the MCP server.\r\nimport asyncio\r\nfrom autogen_agentchat.agents import AssistantAgent\r\nfrom autogen_agentchat.teams import RoundRobinGroupChat\r\nfrom autogen_agentchat.conditions import TextMessageTermination\r\nfrom autogen_agentchat.ui import Console\r\nfrom autogen_ext.models.openai import OpenAIChatCompletionClient\r\nfrom autogen_ext.tools.mcp import McpWorkbench, StdioServerParams\r\n\r\nasync def main() -> None:\r\n    model_client = OpenAIChatCompletionClient(model=\"gpt-4.1-nano\")\r\n    server_params = StdioServerParams(\r\n        command=\"npx\",\r\n        args=[\r\n            \"@playwright\u002Fmcp@latest\",\r\n            \"--headless\",\r\n        ],\r\n    )\r\n    async with McpWorkbench(server_params) as mcp:\r\n        agent = AssistantAgent(\r\n            \"web_browsing_assistant\",\r\n            model_client=model_client,\r\n            workbench=mcp,\r\n            model_client_stream=True,\r\n        )\r\n        team = RoundRobinGroupChat(\r\n            [agent],\r\n            termination_condition=TextMessageTermination(source=\"web_browsing_assistant\"),\r\n        )\r\n        await Console(team.run_stream(task=\"Find out how many contributors for the microsoft\u002Fautogen repository\"))\r\n    \r\nasyncio.run(main())\r\n```\r\n\r\nRead more:\r\n- [MCP Workbench API Doc](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fdev\u002Freference\u002Fpython\u002Fautogen_ext.tools.mcp.html#autogen_ext.tools.mcp.McpWorkbench)\r\n- Creating a web browsing agent using workbench, in [AutoGen Core User Guide](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fcore-user-guide\u002Fcomponents\u002Fworkbench.html)\r\n\r\n* Introduce workbench by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6340\r\n\r\n### New Sample: AutoGen and FastAPI with Streaming\r\n\r\n* Add example using autogen-core and FastAPI for handoff multi-agent design pattern with streaming and UI by @amith-ajith in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6391\r\n\r\n### New Termination Condition: `FunctionalTermination` \r\n\r\n* Support using a function expression to create a termination condition for teams. by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6398\r\n\r\n## Other Python Related Changes\r\n* update website version by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6364\r\n* TEST\u002Fchange gpt4, gpt4o serise to gpt4.1nano by @SongChiYoung in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6375\r\n* Remove `name` field from OpenAI Assistant Message by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6388\r\n* Add guide for workbench and mcp & bug fixes for create_mcp_server_session by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6392\r\n* TEST: skip when macos+uv and adding uv venv tests by @SongChiYoung in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6387\r\n* AssistantAgent to support Workbench by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6393\r\n* Update agent documentation  by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6394\r\n* Update version to 0.5.5 by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6397\r\n* Update: implement return_value_as_string for McpToolAdapter  by @perfogic in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6380\r\n* [doc] Clarify selector prompt for SelectorGroupChat by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fau","2025-04-25T23:56:39",{"id":240,"version":241,"summary_zh":242,"released_at":243},109311,"python-v0.5.4","## What's New\r\n\r\n### Agent and Team as Tools\r\n\r\nYou can use `AgentTool` and `TeamTool` to wrap agent and team into tools to be used by other agents. \r\n\r\n```python\r\nimport asyncio\r\n\r\nfrom autogen_agentchat.agents import AssistantAgent\r\nfrom autogen_agentchat.tools import AgentTool\r\nfrom autogen_agentchat.ui import Console\r\nfrom autogen_ext.models.openai import OpenAIChatCompletionClient\r\n\r\n\r\nasync def main() -> None:\r\n    model_client = OpenAIChatCompletionClient(model=\"gpt-4\")\r\n    writer = AssistantAgent(\r\n        name=\"writer\",\r\n        description=\"A writer agent for generating text.\",\r\n        model_client=model_client,\r\n        system_message=\"Write well.\",\r\n    )\r\n    writer_tool = AgentTool(agent=writer)\r\n    assistant = AssistantAgent(\r\n        name=\"assistant\",\r\n        model_client=model_client,\r\n        tools=[writer_tool],\r\n        system_message=\"You are a helpful assistant.\",\r\n    )\r\n    await Console(assistant.run_stream(task=\"Write a poem about the sea.\"))\r\n\r\n\r\nasyncio.run(main())\r\n```\r\n\r\nSee [AgentChat Tools API](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Freference\u002Fpython\u002Fautogen_agentchat.tools.html) for more information.\r\n\r\n* [AgentChat] Nested Agents by @EItanya in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5924\r\n\r\n### Azure AI Agent\r\n\r\nIntroducing adapter for Azure AI Agent, with support for file search, code interpreter, and more. See our [Azure AI Agent Extension API](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Freference\u002Fpython\u002Fautogen_ext.agents.azure.html#autogen_ext.agents.azure.AzureAIAgent).\r\n\r\n* Add azure ai agent by @abdomohamed in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6191\r\n\r\n### Docker Jupyter Code Executor\r\n\r\nThinking about sandboxing your local Jupyter execution environment? We just added a new code executor to our family of code executors. See [Docker Jupyter Code Executor Extension API](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Freference\u002Fpython\u002Fautogen_ext.code_executors.docker_jupyter.html).\r\n\r\n* Make Docker Jupyter support to the Version 0.4 as Version 0.2 by @masquerlin in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6231\r\n\r\n### Canvas Memory\r\n\r\nShared \"whiteboard\" memory can be useful for agents to collaborate on a common artifact such code, document, or illustration. [Canvas Memory](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Freference\u002Fpython\u002Fautogen_ext.memory.canvas.html) is an experimental extension for sharing memory and exposing tools for agents to operate on the shared memory.\r\n\r\n* Agentchat canvas by @lspinheiro in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6215\r\n\r\n### New Community Extensions\r\n\r\nUpdated links to new community extensions. Notably, `autogen-contextplus` provides advanced model context implementations with ability to automatically summarize, truncate the model context used by agents. \r\n\r\n* Add extentions: `autogen-oaiapi` and `autogen-contextplus` by @SongChiYoung in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6338\r\n\r\n### `SelectorGroupChat` Update\r\n\r\n`SelectorGroupChat` now works with models that only support streaming mode (e.g., QwQ). It can also optionally emit the inner reasoning of the model used in the selector. Set `emit_team_events=True` and `model_client_streaming=True` when creating `SelectorGroupChat`.\r\n\r\n* FEAT: SelectorGroupChat could using stream inner select_prompt by @SongChiYoung in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6286\r\n\r\n### `CodeExecutorAgent` Update\r\n\r\n`CodeExecutorAgent` just got another refresh: it now supports `max_retries_on_error` parameter. You can specify how many times it can retry and self-debug in case there is error in the code execution.\r\n\r\n* Add self-debugging loop to `CodeExecutionAgent` by @Ethan0456 in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6306\r\n\r\n### `ModelInfo` Update\r\n\r\n* Adding `multiple_system_message` on model_info by @SongChiYoung in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6327\r\n\r\n### New Sample: AutoGen Core + FastAPI with Streaming\r\n\r\n* Add an example using autogen-core and FastAPI to create streaming responses by @ToryPan in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6335\r\n\r\n### AGBench Update\r\n\r\n* Add scenario for parallel agents by @ZHANG-EH in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6311\r\n\r\n\r\n## Bug Fixes\r\n\r\n* Bugfix: Azure AI Search Tool - fix query type by @jay-thakur in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6331\r\n* fix: ensure serialized messages are passed to LLMStreamStartEvent by @peterj in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6344\r\n* fix: ollama fails when tools use optional args by @peterj in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6343\r\n* Avoid re-registering a message type already registered by @jorge-wonolo in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6354\r\n* Fix: deserialize model_context in AssistantAgent and SocietyOfMindAgent and CodeExecutorAgent by @SongChiYoung in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6337\r\n\r\n\r\n## What's Changed\r\n* Update website 0.5.3 by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6320\r\n* Update version 0.5.4 by @ekzhu in htt","2025-04-22T17:51:07",{"id":245,"version":246,"summary_zh":247,"released_at":248},109312,"python-v0.5.3","## What's New\r\n\r\n### CodeExecutorAgent Update\r\n\r\nNow the `CodeExecutorAgent` can generate and execute code in the same invocation. See [API doc](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Freference\u002Fpython\u002Fautogen_agentchat.agents.html#autogen_agentchat.agents.CodeExecutorAgent) for examples.\r\n\r\n* Add code generation support to `CodeExecutorAgent` by @Ethan0456 in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6098\r\n\r\n### AssistantAgent Improvement\r\n\r\nNow `AssistantAgent` can be serialized when `output_content_type` is set, thanks @abhinav-aegis's new built-in utility module `autogen_core.utils` for working with JSON schema. \r\n\r\n* Aegis structure message by @abhinav-aegis in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6289\r\n\r\n### Team Improvement\r\n\r\nAdded an optional parameter `emit_team_events` to configure whether team events like `SelectorSpeakerEvent` are emitted through `run_stream`. \r\n\r\n* [FEATURE] Option to emit group chat manager messages in AgentChat  by @SongChiYoung in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6303\r\n\r\n### MCP Improvement\r\n\r\nNow `mcp_server_tools` factory can reuse a shared session. See example of `AssistantAgent` using Playwright MCP server in the [API Doc](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Freference\u002Fpython\u002Fautogen_ext.tools.mcp.html#autogen_ext.tools.mcp.mcp_server_tools).\r\n\r\n* Make shared session possible for MCP tool by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6312\r\n\r\n### Console Improvement\r\n\r\n* Print message types in Console by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6318\r\n\r\n## Bug Fixes\r\n\r\n* Fix: Azure AI Search Tool Client Lifetime Management by @jay-thakur in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6316\r\n* Make sure thought content is included in handoff context by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6319\r\n\r\n## Python Related Changes\r\n* Update website for 0.5.2 by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6299\r\n* Bump up json-schema-to-pydantic from v0.2.3 to v0.2.4 by @withsmilo in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6300\r\n* minor grammatical fix in docs by @codeblech in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6263\r\n* Pin opentelemetry-proto version by @cheng-tan in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6305\r\n* Update version to 0.5.3 by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6310\r\n* Add GPT4.1, o4-mini and o3 by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6314\r\n\r\n## New Contributors\r\n* @codeblech made their first contribution in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6263\r\n* @amoghmc made their first contribution in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6283\r\n* @abhinav-aegis made their first contribution in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6289\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fcompare\u002Fpython-v0.5.2...python-v0.5.3","2025-04-17T03:36:12",{"id":250,"version":251,"summary_zh":252,"released_at":253},109313,"python-v0.5.2","## Python Related Changes\r\n* Update website verison by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6196\r\n* Clean examples. by @zhanluxianshen in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6203\r\n* Improve SocietyOfMindAgent message handling by @SongChiYoung in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6142\r\n* redundancy code clean for agentchat by @zhanluxianshen in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6190\r\n* added: gemini 2.5 pro preview by @ardentillumina in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6226\r\n* chore: Add powershell path check for code executor by @lspinheiro in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6212\r\n* Fix\u002Ftransformer aware any modelfamily by @SongChiYoung in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6213\r\n* clean codes notes for autogen-core. by @zhanluxianshen in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6218\r\n* Docker Code Exec delete temp files by @husseinmozannar in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6211\r\n* Fix terminations conditions. by @zhanluxianshen in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6229\r\n* Update json_schema_to_pydantic version and make relaxed requirement on arry item. by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6209\r\n* Fix sha256_hash docstring by @scovetta in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6236\r\n* fix: typo in usage.md by @apokusin in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6245\r\n* Expose more Task-Centric Memory parameters by @rickyloynd-microsoft in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6246\r\n* Bugfix\u002Fazure ai search embedding by @jay-thakur in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6248\r\n* Add note on ModelInfo for Gemini Models by @victordibia in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6259\r\n* [Bugfix] Fix for Issue #6241 - ChromaDB removed IncludeEnum by @mpegram3rd in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6260\r\n* Fix ValueError: Dataclass has a union type error by @ShyamSathish005 in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6266\r\n* Fix publish_message-method() notes by @zhanluxianshen in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6250\r\n* Expose TCM TypedDict classes for apps to use by @rickyloynd-microsoft in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6269\r\n* Update discover.md with adding email agent package by @masquerlin in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6274\r\n* Update multi-agent-debate.ipynb by @larrytin in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6288\r\n* update version 0.5.2 by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6296\r\n\r\n## New Contributors\r\n* @ardentillumina made their first contribution in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6226\r\n* @scovetta made their first contribution in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6236\r\n* @apokusin made their first contribution in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6245\r\n* @mpegram3rd made their first contribution in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6260\r\n* @ShyamSathish005 made their first contribution in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6266\r\n* @masquerlin made their first contribution in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6274\r\n* @larrytin made their first contribution in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6288\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fcompare\u002Fpython-v0.5.1...python-v0.5.2","2025-04-15T03:24:39",{"id":255,"version":256,"summary_zh":257,"released_at":258},109314,"python-v0.5.1","## What's New\r\n\r\n### AgentChat Message Types **(Type Hint Changes)**\r\n\r\n> [!IMPORTANT]  \r\n> **TL;DR:** If you are not using custom agents or custom termination conditions, you don't need to change anything. \r\n> Otherwise, update `AgentEvent` to `BaseAgentEvent` and `ChatMessage` to `BaseChatMessage` in your type hints.\r\n> \r\n> This is a breaking change on type hinting only, not on usage.\r\n\r\nWe updated the message types in AgentChat in this new release.\r\nThe purpose of this change is to support custom message types defined by applications.\r\n\r\nPreviously, message types are fixed and we use the union types `ChatMessage` and `AgentEvent` to refer to all the concrete built-in message types. \r\n\r\nNow, in the main branch, the message types are organized into hierarchy: existing built-in concrete message types are subclassing either `BaseChatMessage` and `BaseAgentEvent`, depending it was part of the `ChatMessage` or `AgentEvent` union. We refactored all message handlers `on_messages`, `on_messages_stream`, `run`,  `run_stream` and `TerminationCondition` to use the base classes in their type hints.\r\n\r\nIf you are subclassing `BaseChatAgent` to create your custom agents, or subclassing `TerminationCondition` to create your custom termination conditions, then you need to rebase the method signatures to use `BaseChatMessage` and `BaseAgentEvent`. \r\n\r\nIf you are using the union types in your existing data structures for serialization and deserialization, then you can keep using those union types to ensure the messages are being handled as concrete types. However, this will not work with custom message types. \r\n\r\nOtherwise, your code should just work, as the refactor only makes type hint changes.\r\n\r\nThis change allows us to support custom message types. For example, we introduced a new message type `StructureMessage[T]` generic, that can be used to create new message types with a BaseModel content. On-going work is to get AssistantAgent to respond with `StructuredMessage[T]` where T is the structured output type for the model. \r\n\r\nSee the API doc on AgentChat message types: https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Freference\u002Fpython\u002Fautogen_agentchat.messages.html \r\n\r\n* Use class hierarchy to organize AgentChat message types and introduce StructuredMessage type by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5998\r\n* Rename to use BaseChatMessage and BaseAgentEvent. Bring back union types. by @ekzhu in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F6144\r\n\r\n### Structured Output\r\n\r\nWe enhanced support for structured output in model clients and agents.\r\n\r\nFor model clients, use `json_output` parameter to specify the structured output type\r\nas a Pydantic model. The model client will then return a JSON string\r\nthat can be deserialized into the specified Pydantic model.\r\n\r\n```python\r\nimport asyncio\r\nfrom typing import Literal\r\n\r\nfrom autogen_core import CancellationToken\r\nfrom autogen_ext.models.openai import OpenAIChatCompletionClient\r\nfrom pydantic import BaseModel\r\n\r\n# Define the structured output format.\r\nclass AgentResponse(BaseModel):\r\n    thoughts: str\r\n    response: Literal[\"happy\", \"sad\", \"neutral\"]\r\n\r\n model_client = OpenAIChatCompletionClient(model=\"gpt-4o-mini\")\r\n\r\n # Generate a response using the tool.\r\nresponse = await model_client.create(\r\n    messages=[\r\n        SystemMessage(content=\"Analyze input text sentiment using the tool provided.\"),\r\n        UserMessage(content=\"I am happy.\", source=\"user\"),\r\n    ],\r\n    json_ouput=AgentResponse,\r\n)\r\n\r\nprint(response.content)\r\n# Should be a structured output.\r\n# {\"thoughts\": \"The user is happy.\", \"response\": \"happy\"}\r\n```\r\n\r\nFor `AssistantAgent`, you can set `output_content_type` to the structured output type. The agent will automatically reflect on the tool call result and generate a `StructuredMessage` with the output content type.\r\n\r\n```python\r\nimport asyncio\r\nfrom typing import Literal\r\n\r\nfrom autogen_agentchat.agents import AssistantAgent\r\nfrom autogen_agentchat.messages import TextMessage\r\nfrom autogen_agentchat.ui import Console\r\nfrom autogen_core import CancellationToken\r\nfrom autogen_core.tools import FunctionTool\r\nfrom autogen_ext.models.openai import OpenAIChatCompletionClient\r\nfrom pydantic import BaseModel\r\n\r\n# Define the structured output format.\r\nclass AgentResponse(BaseModel):\r\n    thoughts: str\r\n    response: Literal[\"happy\", \"sad\", \"neutral\"]\r\n\r\n\r\n# Define the function to be called as a tool.\r\ndef sentiment_analysis(text: str) -> str:\r\n    \"\"\"Given a text, return the sentiment.\"\"\"\r\n    return \"happy\" if \"happy\" in text else \"sad\" if \"sad\" in text else \"neutral\"\r\n\r\n\r\n# Create a FunctionTool instance with `strict=True`,\r\n# which is required for structured output mode.\r\ntool = FunctionTool(sentiment_analysis, description=\"Sentiment Analysis\", strict=True)\r\n\r\n# Create an OpenAIChatCompletionClient instance that supports structured output.\r\nmodel_client = OpenAIChatCompletionClient(\r\n    model=\"gpt-4o-mini\",\r\n)\r\n\r\n# Create an AssistantAgent instance that us","2025-04-03T23:37:09",{"id":260,"version":261,"summary_zh":262,"released_at":263},109315,"python-v0.4.9.3","## Patch Release\r\n\r\nThis release addresses a bug in MCP Server Tool that causes error when unset tool arguments are set to `None` and passed on to the server. It also improves the error message from server and adds a default timeout. #6080, #6125\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fcompare\u002Fpython-v0.4.9.2...python-v0.4.9.3","2025-03-29T04:40:37",{"id":265,"version":266,"summary_zh":267,"released_at":268},109316,"autogenstudio-v0.4.2","## What's New \r\n\r\nThis release makes improvements to AutoGen Studio across multiple areas.\r\n\r\n\r\n### Component Validation and Testing\r\n\r\n- Support Component Validation API in AGS  in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5503\r\n- Test components - https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5963 \r\n\r\n\u003Cimg width=\"1250\" alt=\"image\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F1f51797d-a81a-4848-84aa-772db872c648\" \u002F>\r\n\r\n\r\nIn the team builder, all component schemas are automatically validated on save. This way configuration errors (e.g., incorrect provider names) are highlighted early.\r\n\r\nIn addition, there is a test button for model clients where you can verify the correctness of your model configuration. The LLM is given a simple query and the results are shown.\r\n\r\n### Gallery Improvements\r\n\r\n- Improved editing UI for tools in AGS by  in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5539 \r\n- Anthropic support in AGS https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5695 \r\n\r\nYou can now modify teams, agents, models, tools, and termination conditions independently in the UI, and only review JSON when needed. The same UI panel for updating components in team builder is also reused in the Gallery. The Gallery in AGS  is now persisted in a database, rather than local storage.  Anthropic models supported in AGS. \r\n\u003Cimg width=\"1845\" alt=\"image\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F9ded4d76-da17-4772-a9f9-ce0723a6cc31\" \u002F>\r\n\r\n\r\n### Observability - LLMCallEvents\r\n\r\n- Enable LLM Call Observability in AGS https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5457\r\n\r\nYou can now view all LLMCallEvents in AGS. Go to settings (cog icon on lower left) to enable this feature.\r\n\r\n### Token Streaming\r\n\r\n- Add Token Streaming in AGS in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5659\r\n\r\nFor better developer experience, the AGS UI will stream tokens as they are generated by an LLM for any agent where `stream_model_client` is set to true.\r\n\r\n\r\n### UX Improvements - Session Comparison\r\n\r\n- AGS - Test Model Component in UI, Compare Sessions in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5963\r\n\r\nIt is often valuable, even critical, to have a side-by-side comparison of multiple agent configurations (e.g., using a team of web agents that solve tasks using a browser or agents with web search API tools). You can now do this using the compare button in the playground, which lets you select multiple sessions and interact with them to compare outputs.\r\n\r\n### Experimental Features\r\n\r\nThere are a few interesting but early features that ship with this release:\r\n\r\n- Authentication in AGS: You can pass in an authentication configuration YAML file to enable user authentication for AGS. Currently, only GitHub authentication is supported. This lays the foundation for a multi-user environment (https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5928) where various users can login and only view their own sessions. More work needs to be done to clarify isolation of resources (e.g., environment variables) and other security considerations.\r\nSee the [documentation](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fdev\u002Fuser-guide\u002Fautogenstudio-user-guide\u002Fexperimental.html#authentication) for more details.\r\n\r\nhttps:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fb649053b-c377-40c7-aa51-ee64af766fc2\r\n\r\n\u003Cimg width=\"100%\" alt=\"image\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F03ba1df5-c9a2-4734-b6a2-0eb97ec0b0e0\" \u002F>\r\n\r\n- Local Python Code Execution Tool: AGS now has early support for a local Python code execution tool. More work is needed to test the underlying agentchat implementation\r\n\r\n## Other Fixes\r\n\r\n- Fixed issue with using AzureSQL DB as the database engine for AGS\r\n- Fixed cascading delete issue in AGS (ensure runs are deleted when sessions are deleted) https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5804 by @victordibia \r\n- Fixed termination UI bug https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5888 \r\n- Fixed DockerFile for AGS by @gunt3001  https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5932 \r\n\r\n\r\nThanks to @ekzhu , @jackgerrits , @gagb,  @usag1e, @dominiclachance , @EItanya and many others for testing and feedback","2025-03-17T18:06:09",{"id":270,"version":271,"summary_zh":272,"released_at":273},109317,"python-v0.4.9.2","## Patch Fixes\r\n\r\n- Fix logging error in `SKChatCompletionAdapter` https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5893\r\n- Fix missing system message in the model client call during reflect step when `reflect_on_tool_use=True` https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5926 (Bug introduced in v0.4.8)\r\n- Fixing listing directory error in FileSurfer https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5938\r\n\r\n## Security Fixes\r\n\r\n- Use `SecretStr` type for model clients' API key. This will ensure the secret is not exported when calling `model_client.dump_component().model_dump_json()`. #5939 and #5947. This will affect `OpenAIChatCompletionClient` and `AzureOpenAIChatCompletionClient`, and `AnthropicChatCompletionClient` -- **the API keys will no longer be exported when you serialize the model clients**.  It is recommended to use environment-based or token-based authentication rather than passing the API keys around as data in configs. \r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fcompare\u002Fpython-v0.4.9...python-v0.4.9.2","2025-03-14T19:40:58",{"id":275,"version":276,"summary_zh":277,"released_at":278},109318,"python-v0.4.9","## What's New\r\n\r\n### [Breaking] Serialized State Schema Change\r\n\r\nStarting v0.4.9, the team state is using the agent name as the key instead of the agent ID, and the team_id field is removed from the state. This is to allow the state to be portable across different teams and runtimes. States saved with the old format may not be compatible with the new format in the future.\r\n\r\nSee migration scripts here: https:\u002F\u002Fgithub.com\u002Fekzhu\u002Fautogen-migration\u002F\r\n\r\n### Anthropic Model Client\r\n\r\nNative support for Anthropic models. Get your update:\r\n \r\n```\r\npip install -U \"autogen-ext[anthropic]\"\r\n```\r\n\r\nThe new client follows the same interface as `OpenAIChatCompletionClient` so you can use it directly in your agents and teams.\r\n\r\n```python\r\nimport asyncio\r\nfrom autogen_ext.models.anthropic import AnthropicChatCompletionClient\r\nfrom autogen_core.models import UserMessage\r\n\r\n\r\nasync def main():\r\n    anthropic_client = AnthropicChatCompletionClient(\r\n        model=\"claude-3-sonnet-20240229\",\r\n        api_key=\"your-api-key\",  # Optional if ANTHROPIC_API_KEY is set in environment\r\n    )\r\n\r\n    result = await anthropic_client.create([UserMessage(content=\"What is the capital of France?\", source=\"user\")])  # type: ignore\r\n    print(result)\r\n\r\n\r\nif __name__ == \"__main__\":\r\n    asyncio.run(main())\r\n```\r\n\r\nYou can also load the model client directly from a configuration dictionary:\r\n\r\n```python\r\nfrom autogen_core.models import ChatCompletionClient\r\n\r\nconfig = {\r\n    \"provider\": \"AnthropicChatCompletionClient\",\r\n    \"config\": {\"model\": \"claude-3-sonnet-20240229\"},\r\n}\r\n\r\nclient = ChatCompletionClient.load_component(config)\r\n```\r\n\r\nTo use with `AssistantAgent` and run the agent in a loop to match the behavior of Claude agents, you can use [Single-Agent Team](https:\u002F\u002Fmicrosoft.github.io\u002Fautogen\u002Fstable\u002Fuser-guide\u002Fagentchat-user-guide\u002Ftutorial\u002Fteams.html#single-agent-team).\r\n\r\n* Add anthropic docs by @victordibia in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5882\r\n\r\n### LlamaCpp Model Client\r\n\r\nLlamaCpp is a great project for working with local models. Now we have native support via its official SDK. \r\n\r\n```\r\npip install -U \"autogen-ext[llama-cpp]\"\r\n```\r\n\r\nTo use a local model file:\r\n```python\r\nimport asyncio\r\n\r\nfrom autogen_core.models import UserMessage\r\nfrom autogen_ext.models.llama_cpp import LlamaCppChatCompletionClient\r\n\r\n\r\nasync def main():\r\n    llama_client = LlamaCppChatCompletionClient(model_path=\"\u002Fpath\u002Fto\u002Fyour\u002Fmodel.gguf\")\r\n    result = await llama_client.create([UserMessage(content=\"What is the capital of France?\", source=\"user\")])\r\n    print(result)\r\n\r\n\r\nasyncio.run(main())\r\n```\r\n\r\nTo use it with a Hugging Face model:\r\n```python\r\nimport asyncio\r\n\r\nfrom autogen_core.models import UserMessage\r\nfrom autogen_ext.models.llama_cpp import LlamaCppChatCompletionClient\r\n\r\n\r\nasync def main():\r\n    llama_client = LlamaCppChatCompletionClient(\r\n        repo_id=\"unsloth\u002Fphi-4-GGUF\", filename=\"phi-4-Q2_K_L.gguf\", n_gpu_layers=-1, seed=1337, n_ctx=5000\r\n    )\r\n    result = await llama_client.create([UserMessage(content=\"What is the capital of France?\", source=\"user\")])\r\n    print(result)\r\n\r\n\r\nasyncio.run(main())\r\n```\r\n\r\n* Feature add Add LlamaCppChatCompletionClient and llama-cpp  by @aribornstein in https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fautogen\u002Fpull\u002F5326\r\n\r\n### Task-Centric Memory (Experimental)\r\n\r\nTask-Centric memory is an experimental module that can give agents the ability to:\r\n\r\n* Accomplish general tasks more effectively by learning quickly and continually beyond context-window limitations.\r\n* Remember guidance, corrections, plans, and demonstrations provided by users (**teachability**)\r\n* Learn through the agent's own experience and adapt quickly to changing circumstances (**self-improvement**)\r\n* Avoid repeating mistakes on tasks that are similar to those previously encountered.\r\n\r\nFor example, you can use `Teachability` as a `memory` for `AssistantAgent` so your agent can learn from user teaching.\r\n\r\n```python\r\nfrom autogen_agentchat.agents import AssistantAgent\r\nfrom autogen_agentchat.ui import Console\r\nfrom autogen_ext.models.openai import OpenAIChatCompletionClient\r\nfrom autogen_ext.experimental.task_centric_memory import MemoryController\r\nfrom autogen_ext.experimental.task_centric_memory.utils import Teachability\r\n\r\n\r\nasync def main():\r\n    # Create a client\r\n    client = OpenAIChatCompletionClient(model=\"gpt-4o-2024-08-06\", )\r\n\r\n    # Create an instance of Task-Centric Memory, passing minimal parameters for this simple example\r\n    memory_controller = MemoryController(reset=False, client=client)\r\n\r\n    # Wrap the memory controller in a Teachability instance\r\n    teachability = Teachability(memory_controller=memory_controller)\r\n\r\n    # Create an AssistantAgent, and attach teachability as its memory\r\n    assistant_agent = AssistantAgent(\r\n        name=\"teachable_agent\",\r\n        system_message = \"You are a helpful AI assistant, with the special ability to remember user teachings from prior conversations.\",\r\n        model_client=client,\r\n ","2025-03-12T07:21:31"]