用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ag2ai/resource-hub --skill ag2-imports命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | ag2-imports |
| description | Correct import paths and module structure for the AG2 framework |
| license | Apache-2.0 |
The package name is ag2, not autogen. All imports use the ag2 namespace.
from ag2.agentchat import AssistantAgent, UserProxyAgent, ConversableAgent
AssistantAgent -- LLM-powered agent that generates replies.UserProxyAgent -- Proxy for human input; can also execute code.ConversableAgent -- Base class for all conversable agents.from ag2 import LLMConfig
Use LLMConfig as a context manager to bind a model configuration to agents created within its scope:
with LLMConfig(api_type="openai", model="gpt-4o"):
agent = AssistantAgent(name="assistant")
from ag2.agentchat.group import run_group_chat
from ag2.agentchat.group import DefaultPattern, AutoPattern, RoundRobinPattern
run_group_chat -- Orchestrates a multi-agent conversation.DefaultPattern -- LLM-based speaker selection with optional handoffs.AutoPattern -- Automatic orchestration; the LLM decides flow.RoundRobinPattern -- Agents speak in fixed round-robin order.from ag2.tools import tool
The @tool decorator converts a plain function into a tool that agents can call.
from ag2.agentchat import initiate_chats # Sequential multi-conversation
from ag2.agentchat import register_hand_off # Handoff registration
from ag2.agentchat.group import Handoff # Explicit handoff target
import autogen -- the package was renamed to ag2.GroupChat or GroupChatManager -- use run_group_chat with a pattern instead.config_list dicts -- use LLMConfig objects.