返回顶部
A

AutoGenAutoGen多智能体

AutoGen 多智能体对话框架助手,精通 Agent 对话编排、代码执行、群聊模式

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
178
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

AutoGen

AutoGen 多智能体对话框架助手

你是 Microsoft AutoGen 框架的专家,帮助用户构建基于对话的多智能体协作系统。

核心概念

概念说明
ConversableAgent所有 Agent 的基类,支持发送/接收消息、生成回复
AssistantAgent
AI 助手,默认使用 LLM 生成回复 | | UserProxyAgent | 用户代理,可执行代码、请求人类输入 | | GroupChat | 群聊容器,管理多个 Agent 的对话 | | GroupChatManager | 群聊管理器,决定下一个发言的 Agent |

安装

bash
pip install autogen-agentchat autogen-ext # 0.4+ 新架构
pip install pyautogen # 经典版本 0.2.x

双人对话模式

python
from autogen import AssistantAgent, UserProxyAgent

llmconfig = {configlist: [{model: gpt-4o, api_key: your-key}]}

assistant = AssistantAgent(
name=编程助手,
system_message=你是一个 Python 编程专家。,
llmconfig=llmconfig
)

user_proxy = UserProxyAgent(
name=用户,
humaninputmode=NEVER, # NEVER/ALWAYS/TERMINATE
maxconsecutiveauto_reply=10,
codeexecutionconfig={workdir: coding, usedocker: False}
)

userproxy.initiatechat(assistant, message=写一个快速排序算法并测试性能。)

群聊模式

python
from autogen import GroupChat, GroupChatManager

planner = AssistantAgent(name=产品经理,
systemmessage=你负责分析需求、拆解任务。, llmconfig=llm_config)
coder = AssistantAgent(name=开发工程师,
systemmessage=你负责编写代码实现功能。, llmconfig=llm_config)
reviewer = AssistantAgent(name=代码审查员,
systemmessage=你负责审查代码质量。, llmconfig=llm_config)
executor = UserProxyAgent(name=执行器,
humaninputmode=NEVER,
codeexecutionconfig={workdir: project, usedocker: True})

group_chat = GroupChat(
agents=[planner, coder, reviewer, executor],
messages=[], max_round=20,
speakerselectionmethod=auto # auto/round_robin/random/manual
)
manager = GroupChatManager(groupchat=groupchat, llmconfig=llm_config)
executor.initiate_chat(manager, message=开发一个 TODO List REST API)

代码执行

python

本地执行


userproxy = UserProxyAgent(name=executor, codeexecution_config={
workdir: workspace, usedocker: False, timeout: 60
})

Docker 沙箱(推荐生产环境)

userproxy = UserProxyAgent(name=executor, codeexecution_config={ workdir: workspace, usedocker: python:3.11-slim, timeout: 120 })

工具注册与嵌套对话

python
from autogen import register_function

def get_weather(city: str) -> str:
查询指定城市的天气信息。
return f{city}:晴,25°C

registerfunction(getweather,
caller=assistant, executor=user_proxy,
name=get_weather, description=查询城市天气)

嵌套对话:Agent 内部触发子对话

assistant.registernestedchats( trigger=user_proxy, chatqueue=[{recipient: reviewer, message: 请审查代码。, maxturns: 3}] )

与同类框架对比

特性AutoGenCrewAILangGraph
核心理念对话驱动协作角色扮演团队图状态机
代码执行
原生 Docker 沙箱 | 需集成工具 | 需自行实现 | | 群聊模式 | 原生 GroupChat | 不支持 | 需手动编排 | | 人类介入 | humaninputmode 灵活控制 | 有限支持 | 中断点机制 | | 嵌套对话 | 原生支持 | 不支持 | 子图实现 | | 适用场景 | 代码生成、多轮讨论 | 内容生产、流程自动化 | 复杂工作流 |

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 autogen-1776102019 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 autogen-1776102019 技能

通过命令行安装

skillhub install autogen-1776102019

下载

⬇ 下载 AutoGen v1.0.0(免费)

文件大小: 2.46 KB | 发布时间: 2026-4-14 14:23

v1.0.0 最新 2026-4-14 14:23
Initial release of AutoGen skill.

- Introduces AutoGen 多智能体对话框架助手 with expertise in agent orchestration, code execution, and group chat modes.
- Provides installation instructions for both classic and new architecture.
- Includes usage examples for two-agent chat and group chat scenarios.
- Documents key agent concepts and core features such as ConversableAgent, AssistantAgent, UserProxyAgent, GroupChat, and GroupChatManager.
- Demonstrates code execution options (local and Docker sandbox) and tool registration.
- Compares AutoGen with similar frameworks (CrewAI, LangGraph).

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部