mirror of
https://github.com/magnus919/agent-skills.git
synced 2026-09-13 12:36:27 +03:00
Greenfield SkillOpt: 3 epochs for Microsoft AutoGen skill. Conversational agent model, GroupChat patterns, code execution, nested chats, cancellation tokens, MCP integration. All API surfaces validated against microsoft.github.io/autogen docs.
23 lines
678 B
Python
23 lines
678 B
Python
#!/usr/bin/env python3
|
|
"""Two-agent chat with AssistantAgent and UserProxyAgent."""
|
|
|
|
from autogen_agentchat.agents import AssistantAgent, UserProxyAgent
|
|
from autogen_ext.models.openai import OpenAIChatCompletionClient
|
|
|
|
model_client = OpenAIChatCompletionClient(model="gpt-4o-mini")
|
|
|
|
assistant = AssistantAgent(
|
|
name="assistant",
|
|
system_message="You are a helpful assistant.",
|
|
model_client=model_client,
|
|
)
|
|
|
|
proxy = UserProxyAgent(
|
|
name="proxy",
|
|
human_input_mode="NEVER",
|
|
is_termination_msg=lambda msg: "TERMINATE" in (msg.get("content", "") or ""),
|
|
)
|
|
|
|
result = proxy.initiate_chat(assistant, message="What is AutoGen?", max_turns=2)
|
|
print(result.summary)
|