Chatbots have transformed the way we interact with technology, offering automated and intelligent conversations. However, building scalable and flexible systems can be challenging. AutoGen simplifies this process with its low-code and programming frameworks. Last week we learned how to create agent chatbots using the AutoGen programming framework. Today we are going to use AutoGen Studio, a low-code tool, to create agent chatbots. This guide will focus on how to use AutoGen Studio to create custom chatbots for various tasks.
What is AutoGen Studio?
AutoGen Studio is a simple interface that allows you to quickly create ai agents, add skills, and connect them to workflows to perform tasks. It is built on the AutoGen framework, which helps create chatbots that can handle complex conversations. With AutoGen Studio, you don't need much coding to design and launch chatbots. This makes it quick and easy to create intelligent agents that are flexible and responsive.
Now let's learn how to create agent chatbots using AutoGen Studio.
Starting AutoGen Studio
To avoid potential conflicts between library dependencies, it is recommended to run AutoGen Studio in a separate virtual environment. This ensures that AutoGen Studio-specific dependencies do not interfere with other installed libraries.
- Create a new environment: conda create -n autogenstudio python=3.11
- Activate environment: conda activate autogenstudio
- Install AutoGen Studio: pip install autogenstudio
- Start the Studio interface on port 8081: autogenstudio ui –port 8081
- Access AutoGen Studio in your browser at: http://localhost:8081/
Once the mentioned steps have been completed, we can begin the development of a custom chatbot with AutoGen Studio.
Exploring the construction section
Talking about the platform interface, AutoGen Studio has two separate sections: Build and Playground. The Build section is where we build our agents with various models and abilities. The Playground section is where we can interact with the agents.
The build section has four tabs: Skills, Models, Agents, and Workflows.
Each tab comes with some pre-designed components. We can edit them or create new ones as needed.
Let's start with Models.
Models
Some predefined templates are present here, which can be edited. We can also integrate various other LLMs into AutoGen Studio here.
You can add new models as shown here:
Add the model name in the Model field and API key in API Key field. We can test the model to make sure the details we have entered are correct.
Skills
Skills are Python functions that return results based on the input provided. Some built-in functions are provided that we can refer to.
We can add a new skill as follows
Python code
from typing import Annotated, Literal
Operator = Literal("+", "-", "*", "https://www.analyticsvidhya.com/")
def calculator(a: int, b: int, operator: Annotated(Operator, "operator")) -> int:
if operator == "+":
return a + b
elif operator == "-":
return a - b
elif operator == "*":
return a * b
elif operator == "https://www.analyticsvidhya.com/":
return int(a / b)
else:
raise ValueError("Invalid operator")
Add Python function code to Skill specification window. Mention the Name and Description of skill. If any skill needs an API key, we can add it to the Mysteries field.
Agents
Once we have our models and skills, we can create agents using them.
We also have some pre-built agents that we can explore.
Among the pre-built agents, one of them is the user_proxy agent. This agent can be used to initiate conversations with other LLM agents and is a proxy for humans. Since this agent acts as a proxy for humans, it does not need any LLM attached.
We can also create an AutoGen Studio group chat agent where multiple agents chat with each other to reach a decision.
To create a new agent, click +New agent and select Assistant Agent.
As shown in the Agent configuration image, fill in the appropriate details for your agent. If you need guidance on any of the fields, you can use the tooltips provided for help. Once the agent is created, two new tabs Models and Skills will appear.
In it Models and Skills On the tabs, you can specify which models and skills the agent should have access to.
In this case, let's select the GPT-4o model and calculate the agent's ability.
Workflows
Workflows define how different agents collaborate to perform tasks. We can select one of two interaction patterns, Freelance (Chat) and Sequential.
To create a new workflow, click +New workflow and select Freelance (Chat).
In it Workflow configuration tab, complete the Name, Descriptionand Summary method as needed.
He llm The summary method uses an LLM to summarize the conversation. He last The summary method uses the last message in the conversation as the summary.
Once the workflow is created, a new tab will appear. Agents will be created.
In it Agents tab, add user_proxy agent as initiator and calculate_assistant as a receiver.
Once we have done all that, we can select and test the workflow.
Play on the AutoGen Studio Playground
Now we can interact with the agent we have built in the playground.
Create a new session and select the workflow we want to execute as follows
Once we create the session, we can use the workflow to solve any numerical problems.
Here you can also explore pre-built workflows. Make sure you have selected the work model for the agents in the workflow.
Conclusion
AutoGen Studio provides a powerful yet simple platform to create agent chatbots with minimal coding effort. Using its intuitive interface and pre-built components such as models, skills, agents, and workflows, users can create intelligent, task-oriented chatbots in no time. By following the steps outlined in this guide, you can start harnessing the full potential of AutoGen Studio to create dynamic, responsive chatbots tailored to your specific needs.
Upgrade your skills and become a master of ai agents with our exclusive program: Agentic ai Pioneer Program.
Frequently asked questions
A. AutoGen Studio is a low-code tool designed to create agent chatbots. It allows users to create ai agents, integrate various skills, and develop workflows without extensive coding knowledge.
A. In some cases, AutoGen Studio is designed to be easy to use and requires minimal coding. Its intuitive interface and pre-built components make it accessible to users with different levels of technical experience.
A. The core components of AutoGen Studio include models, skills, agents, and workflows. The AutoGen Studio LLM integration enables the seamless use of large language models to enhance the capabilities of the chatbot, while the other components define the behavior and functionality of the chatbot.
A. Yes, AutoGen Studio allows you to customize skills by writing your own Python functions and add new models by providing their names and API keys.
A. You can test your chatbot in the Workflow or Playground section by creating a new session and selecting the workflow you want to run. This allows you to interact with your chatbot and evaluate its performance.