Fix MCP example in readme (#6919)
This commit is contained in:
@@ -59,8 +59,6 @@ Create a web browsing assistant agent that uses the Playwright MCP server.
|
||||
# First run `npm install -g @playwright/mcp@latest` to install the MCP server.
|
||||
import asyncio
|
||||
from autogen_agentchat.agents import AssistantAgent
|
||||
from autogen_agentchat.teams import RoundRobinGroupChat
|
||||
from autogen_agentchat.conditions import TextMessageTermination
|
||||
from autogen_agentchat.ui import Console
|
||||
from autogen_ext.models.openai import OpenAIChatCompletionClient
|
||||
from autogen_ext.tools.mcp import McpWorkbench, StdioServerParams
|
||||
@@ -83,11 +81,7 @@ async def main() -> None:
|
||||
model_client_stream=True,
|
||||
max_tool_iterations=10,
|
||||
)
|
||||
team = RoundRobinGroupChat(
|
||||
[agent],
|
||||
termination_condition=TextMessageTermination(source="web_browsing_assistant"),
|
||||
)
|
||||
await Console(team.run_stream(task="Find out how many contributors for the microsoft/autogen repository"))
|
||||
await Console(agent.run_stream(task="Find out how many contributors for the microsoft/autogen repository"))
|
||||
|
||||
|
||||
asyncio.run(main())
|
||||
|
||||
Reference in New Issue
Block a user