AutoGen Studio

Kumar HarshKumar Harsh
2 min read

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:

0
Subscribe to my newsletter

Read articles from Kumar Harsh directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Kumar Harsh
Kumar Harsh

Experienced Project Engineer skilled in developing and integrating Micro Frontend applications to enhance functionality and user experience in unified systems. Proficient in CI/CD pipeline automation using Bitbucket, Amazon S3, and CloudFront, streamlining deployments with efficient, scalable cloud infrastructure. Expertise in creating end-to-end automated testing with Cypress, integrating continuous quality checks into deployment workflows, and automating issue tracking through Jira to improve productivity. Skilled in React, Node.js, MongoDB, and cloud tools (AWS, Azure), with a strong foundation in backend/frontend development and DevOps practices.