0_basic-agent/AutoGen/1_basic-concept-with-autogen-studio.ipynb (199 lines of code) (raw):
{
"cells": [
{
"cell_type": "markdown",
"id": "c26ab996",
"metadata": {},
"source": [
"# Understand Agentic architecture concept with AutoGen Studio\n",
"\n",
"----\n",
"AutoGen Studio offers four main interfaces to help you build and manage multi-agent systems:\n",
"\n",
"1. Team Builder\n",
"* A visual interface for creating agent teams through declarative specification (JSON) or drag-and-drop\n",
"* Supports configuration of all core components: teams, agents, tools, models, and termination conditions\n",
"* Fully compatible with AgentChat’s component definitions\n",
"2. Playground\n",
"* Interactive environment for testing and running agent teams\n",
"* Features include:\n",
" * Live message streaming between agents\n",
" * Visual representation of message flow through a control transition graph\n",
" * Interactive sessions with teams using UserProxyAgent\n",
" * Full run control with the ability to pause or stop execution\n",
"3. Gallery\n",
"* Central hub for discovering and importing community-created components\n",
"* Enables easy integration of third-party components\n",
"4. Deployment\n",
"* Export and run teams in python code\n",
"* Setup and test endpoints based on a team configuration\n",
"* Run teams in a docker container\n",
"\n",
"**Reference**\n",
"- [AutoGen Studio repo](https://github.com/microsoft/autogen/tree/main/python/packages/autogen-studio) "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "92afdfe2",
"metadata": {},
"outputs": [],
"source": [
"# you can do it in the terminal as well\n",
"!autogenstudio ui --port 8081"
]
},
{
"cell_type": "markdown",
"id": "18b243d6",
"metadata": {},
"source": [
"## ๐งช Step 1. Set up components in your gallery \n",
"---\n",
"\n",
"0. Update gallery > sample_gallery.json based on your azure_endpoint, azure_deployment, api_key and api_version\n",
"1. Go to the started localhost:{your port} website. (Don't forget to use port forwarding when you are using compute instances in Azure cloud)\n",
"2. Click on the `Gallery` menu.\n",
"3. Click on the `+ New Gallery` button to add a new component.\n",
"4. Upload your customized sample_gallery.json file. (Don't forget to add your environment variables to invoke azure open ai models)\n",
"5. Review the 9 components in the gallery."
]
},
{
"cell_type": "markdown",
"id": "1d61247b",
"metadata": {},
"source": [
"## ๐งช Step 2. Single Agent with Tools\n",
"---\n",
"\n",
"1. Go to the Team Builder menu and Click on the `+ New Team` button.\n",
"2. Remove the default agent and termination condition.\n",
"3. Drag and drop the `single_tool_use_agent` and `CombinationTemination` in the team box.\n",
"4. Click the save button and goes to the Playground menu.\n",
"5. Click the `+ New Session` button to start a session and input the name of session and select your team created.\n",
"6. Click the `Create` button to run the session.\n",
"7. input your query in the input box and click the `Send` button.\n",
"\n",
""
]
},
{
"cell_type": "markdown",
"id": "ae4a73a0",
"metadata": {},
"source": [
"### ๐ Example of your messages\n",
"\n",
"1. What is the history of microsoft?\n",
"2. get info from https://www.sqlite.org/copyright.html\n",
"3. what is the weather in Seoul?\n",
"4. 4.11 + 5.11?"
]
},
{
"cell_type": "markdown",
"id": "c2c07ac3",
"metadata": {},
"source": [
"### โ
sample response\n",
"\n",
"1. What is the history of microsoft?\n",
"\n",
"\n",
"\n",
"2. get info from https://www.sqlite.org/copyright.html\n",
"\n",
"\n",
"\n",
"3. what is the weather in Seoul?\n",
"\n",
"\n",
"\n",
"4. 4.11 + 5.11?\n",
"\n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "f9d65321",
"metadata": {},
"source": [
"## ๐งช Step 3. Multi-Agent (Writer and Reviewer)\n",
"---\n",
"\n",
"1. Go to the Team Builder menu and Click on the `+ New Team` button.\n",
"2. Remove the default agent and termination condition.\n",
"3. Drag and drop the `writer_agent`, `reviwer_agent` and `CombinationTemination` in the team box.\n",
"4. Click the save button and goes to the Playground menu.\n",
"5. Click the `+ New Session` button to start a session and input the name of session and select your team created.\n",
"6. Click the `Create` button to run the session.\n",
"7. input your query in the input box and click the `Send` button.\n",
"\n",
""
]
},
{
"cell_type": "markdown",
"id": "4cc73fe8",
"metadata": {},
"source": [
"### ๐ Example of your messages\n",
"\n",
"1. what is the height of the eiffel tower\n",
"2. make a bedtime story for 5 years old kids\n",
"2. make a bedtime story for 10 years old kids"
]
},
{
"cell_type": "markdown",
"id": "0ce6e5dc",
"metadata": {},
"source": [
"### โ
sample response\n",
"\n",
"1. make a bedtime story for 10 years old kids\n",
"\n",
""
]
},
{
"cell_type": "markdown",
"id": "77a2e7aa",
"metadata": {},
"source": [
"### "
]
},
{
"cell_type": "markdown",
"id": "177d7df9",
"metadata": {},
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "venv_agent",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.11"
}
},
"nbformat": 4,
"nbformat_minor": 5
}