AutoGen Studio

AutoGen Studio


How to Start with Autogen Studio

A beginner's guide to getting started with Autogen Studio, including installation, setup, and testing an agent.


Autogen Framework

Autogen is a powerful framework designed for AI-driven agent communication, allowing users to create and manage AI agents seamlessly.

Autogen Studio

Autogen Studio is an interactive development environment that provides a UI for configuring and testing Autogen-based agents easily.

Basic Requirements

To get started, ensure you have the latest version of Python installed.

  • Download and install Python.

  • Check the latest versions of Python and PIP.

Installing Autogen Studio

To install Autogen Studio, run the following commands in your terminal:

pip install -U autogenstudio
autogenstudio ui --port 8080

This will install Autogen Studio and launch the UI on port 8080.

Output

UI

Press the red-circled button in the image below. Use the next JSON for your Agent.

JSON for the Agents

Run the following Python script in any terminal, copy the output JSON, replace your API key with the actual one, and add your preferred model.

import json
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.teams import RoundRobinGroupChat
from autogen_ext.models.openai import OpenAIChatCompletionClient
# Define a tool
async def get_weather(city: str) -> str:
    return f"The weather in {city} is 73 degrees and Sunny."
# Define an agent
weather_agent = AssistantAgent(
    name="weather_agent",
    model_client=OpenAIChatCompletionClient(
        model="gpt-4o-2024-08-06",
        # api_key="YOUR_API_KEY",
    ),
    tools=[get_weather],
)
# Define a team with a single agent and maximum auto-gen turns of 1.
agent_team = RoundRobinGroupChat([weather_agent], max_turns=1)
# Convert agent_team to JSON using the built-in dump method
agent_team_json = agent_team.dump()
# Print the JSON output
print(agent_team_json)

Testing the Agent in Playground

Once the setup is complete, navigate to the Playground section in Autogen Studio and test your agent's behavior.

Thank You

For more updates and discussions, connect with me: