{" "}
- Configure an agent that can reused in your agent workflow{" "}
- {selectedAgent?.config.name}
+ Configure an agent that can reused in your agent workflow .
+
+ Tip: You can also create a Group of Agents ( New Agent -
+ GroupChat) which can have multiple agents in it.
+
+ {" "}
+ You can use the following steps to start integrating your workflow
+ into your application.{" "}
+
+ {workflow && workflow.id && (
+ <>
+
+
+
Step 1
+
+ Download your workflow as a JSON file by clicking the button
+ below.
+
+
+
+
+
+
+
+
+
Step 2
+
+ Copy the following code snippet and paste it into your
+ application to run your workflow on a task.
+
+
+
+
+
+
+
+
+
+ Step 3 (Deploy)
+
+
+ You can also deploy your workflow as an API endpoint using the
+ autogenstudio python CLI.
+
+
+
+
+
+
+ Note: this will start a endpoint on port 5000. You can change
+ the port by changing the port number. You can also scale this
+ using multiple workers (e.g., via an application server like
+ gunicorn) or wrap it in a docker container and deploy on a
+ cloud provider like Azure.
+
+
+
+
+
+ >
+ )}
+
+
+ );
+};
diff --git a/samples/apps/autogen-studio/frontend/src/components/views/builder/utils/modelconfig.tsx b/samples/apps/autogen-studio/frontend/src/components/views/builder/utils/modelconfig.tsx
index 9f9c64500f7b..c4a39956ba0f 100644
--- a/samples/apps/autogen-studio/frontend/src/components/views/builder/utils/modelconfig.tsx
+++ b/samples/apps/autogen-studio/frontend/src/components/views/builder/utils/modelconfig.tsx
@@ -23,18 +23,35 @@ const ModelTypeSelector = ({
value: "open_ai",
description: "OpenAI or other endpoints that implement the OpenAI API",
icon: ,
+ hint: "In addition to OpenAI models, You can also use OSS models via tools like Ollama, vLLM, LMStudio etc. that provide OpenAI compatible endpoint.",
},
{
label: "Azure OpenAI",
value: "azure",
description: "Azure OpenAI endpoint",
icon: ,
+ hint: "Azure OpenAI endpoint",
},
{
label: "Gemini",
value: "google",
description: "Gemini",
icon: ,
+ hint: "Gemini",
+ },
+ {
+ label: "Claude",
+ value: "anthropic",
+ description: "Anthropic Claude",
+ icon: ,
+ hint: "Anthropic Claude models",
+ },
+ {
+ label: "Mistral",
+ value: "mistral",
+ description: "Mistral",
+ icon: ,
+ hint: "Mistral models",
},
];
@@ -46,7 +63,7 @@ const ModelTypeSelector = ({
return (
{
- setSelectedHint(modelType.value);
+ setSelectedHint(modelType.hint);
}}
role="listitem"
key={"modeltype" + i}
@@ -78,13 +95,6 @@ const ModelTypeSelector = ({
);
});
- const hints: any = {
- open_ai:
- "In addition to OpenAI models, You can also use OSS models via tools like Ollama, vLLM, LMStudio etc. that provide OpenAI compatible endpoint.",
- azure: "Azure OpenAI endpoint",
- google: "Gemini",
- };
-
const [selectedHint, setSelectedHint] = React.useState("open_ai");
return (
@@ -94,7 +104,7 @@ const ModelTypeSelector = ({
>
);
@@ -370,10 +372,18 @@ export const WorkflowTypeSelector = ({
const iconClass = "h-6 w-6 inline-block ";
const workflowTypes = [
{
- label: "Default",
- value: "default",
- description: <> Includes a sender and receiver. >,
- icon: ,
+ label: "Autonomous (Chat)",
+ value: "autonomous",
+ description:
+ "Includes an initiator and receiver. The initiator is typically a user proxy agent, while the receiver could be any agent type (assistant or groupchat",
+ icon: ,
+ },
+ {
+ label: "Sequential",
+ value: "sequential",
+ description:
+ " Includes a list of agents in a given order. Each agent should have an nstruction and will summarize and pass on the results of their work to the next agent",
+ icon: ,
},
];
const [seletectedWorkflowType, setSelectedWorkflowType] = React.useState<
@@ -390,7 +400,7 @@ export const WorkflowTypeSelector = ({
onClick={() => {
setSelectedWorkflowType(workflowType.value);
if (workflow) {
- const sampleWorkflow = sampleWorkflowConfig();
+ const sampleWorkflow = getSampleWorkflow(workflowType.value);
setWorkflow(sampleWorkflow);
}
}}
@@ -398,9 +408,12 @@ export const WorkflowTypeSelector = ({
+ );
+};
+export default ProfilerView;
diff --git a/samples/apps/autogen-studio/frontend/src/styles/global.css b/samples/apps/autogen-studio/frontend/src/styles/global.css
index a46b3712ded0..2d1517497de7 100644
--- a/samples/apps/autogen-studio/frontend/src/styles/global.css
+++ b/samples/apps/autogen-studio/frontend/src/styles/global.css
@@ -289,7 +289,8 @@ iiz__zoom-img {
.ant-modal-footer {
@apply border-secondary !important;
}
-.ant-btn {
+.ant-btn,
+.ant-btn:hover {
@apply text-primary !important;
}
:where(.ant-btn).ant-btn-compact-item.ant-btn-primary:not([disabled])
@@ -333,6 +334,12 @@ iiz__zoom-img {
@apply bg-primary text-primary !important;
}
+.ant-dropdown-menu {
+ max-height: 250px;
+ overflow: auto;
+ @apply scroll !important;
+}
+
/* .ant-radio-input::before {
@apply bg-primary !important;
} */
diff --git a/samples/apps/autogen-studio/notebooks/agent_spec.json b/samples/apps/autogen-studio/notebooks/agent_spec.json
deleted file mode 100644
index 72d1e21ef1a7..000000000000
--- a/samples/apps/autogen-studio/notebooks/agent_spec.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "name": "General Agent Workflow",
- "description": "A general agent workflow",
- "sender": {
- "type": "userproxy",
- "config": {
- "name": "userproxy",
- "human_input_mode": "NEVER",
- "max_consecutive_auto_reply": 5,
- "system_message": "",
- "llm_config": false,
- "code_execution_config": {
- "work_dir": null,
- "use_docker": false
- }
- }
- },
- "receiver": {
- "type": "assistant",
- "config": {
- "name": "primary_assistant",
- "llm_config": {
- "config_list": [
- {
- "model": "gpt-4-1106-preview"
- }
- ],
- "temperature": 0.1,
- "timeout": 600,
- "cache_seed": 42
- },
- "human_input_mode": "NEVER",
- "max_consecutive_auto_reply": 8,
- "system_message": "You are a helpful assistant that can use available functions when needed to solve problems. At each point, do your best to determine if the user's request has been addressed. IF THE REQUEST HAS NOT BEEN ADDRESSED, RESPOND WITH CODE TO ADDRESS IT. IF A FAILURE OCCURRED (e.g., due to a missing library) AND SOME ADDITIONAL CODE WAS WRITTEN (e.g. code to install the library), ENSURE THAT THE ORIGINAL CODE TO ADDRESS THE TASK STILL GETS EXECUTED. If the request HAS been addressed, respond with a summary of the result. The summary must be written as a coherent helpful response to the user request e.g. 'Sure, here is result to your request ' or 'The tallest mountain in Africa is ..' etc. The summary MUST end with the word TERMINATE. If the user request is pleasantry or greeting, you should respond with a pleasantry or greeting and TERMINATE."
- }
- },
- "type": "twoagents"
-}
diff --git a/samples/apps/autogen-studio/notebooks/groupchat_spec.json b/samples/apps/autogen-studio/notebooks/groupchat_spec.json
deleted file mode 100644
index 21cced7135b7..000000000000
--- a/samples/apps/autogen-studio/notebooks/groupchat_spec.json
+++ /dev/null
@@ -1,103 +0,0 @@
-{
- "name": "Travel Agent Group Chat Workflow",
- "description": "A group chat workflow",
- "type": "groupchat",
- "sender": {
- "type": "userproxy",
- "config": {
- "name": "userproxy",
- "human_input_mode": "NEVER",
- "max_consecutive_auto_reply": 5,
- "system_message": "",
- "llm_config": false,
- "code_execution_config": {
- "work_dir": null,
- "use_docker": false
- }
- }
- },
- "receiver": {
- "type": "groupchat",
- "description": "A group chat workflow",
- "config": {
- "name": "group_chat_manager",
- "llm_config": {
- "config_list": [
- {
- "model": "gpt-4-1106-preview"
- }
- ],
- "temperature": 0.1,
- "timeout": 600,
- "cache_seed": 42
- },
- "human_input_mode": "NEVER",
- "system_message": "Group chat manager"
- },
- "groupchat_config": {
- "admin_name": "Admin",
- "max_round": 10,
- "speaker_selection_method": "auto",
-
- "agents": [
- {
- "type": "assistant",
- "config": {
- "name": "primary_assistant",
- "llm_config": {
- "config_list": [
- {
- "model": "gpt-4-1106-preview"
- }
- ],
- "temperature": 0.1,
- "timeout": 600,
- "cache_seed": 42
- },
- "human_input_mode": "NEVER",
- "max_consecutive_auto_reply": 8,
- "system_message": "You are a helpful assistant that can suggest a travel itinerary for a user. You are the primary cordinator who will receive suggestions or advice from other agents (local_assistant, language_assistant). You must ensure that the finally plan integrates the suggestions from other agents or team members. YOUR FINAL RESPONSE MUST BE THE COMPLETE PLAN that ends with the word TERMINATE. "
- }
- },
- {
- "type": "assistant",
- "config": {
- "name": "local_assistant",
- "llm_config": {
- "config_list": [
- {
- "model": "gpt-4-1106-preview"
- }
- ],
- "temperature": 0.1,
- "timeout": 600,
- "cache_seed": 42
- },
- "human_input_mode": "NEVER",
- "max_consecutive_auto_reply": 8,
- "system_message": "You are a helpful assistant that can review travel plans, providing critical feedback on how the trip can be enriched for enjoyment of the local culture. If the plan already includes local experiences, you can mention that the plan is satisfactory, with rationale."
- }
- },
- {
- "type": "assistant",
- "config": {
- "name": "language_assistant",
- "llm_config": {
- "config_list": [
- {
- "model": "gpt-4-1106-preview"
- }
- ],
- "temperature": 0.1,
- "timeout": 600,
- "cache_seed": 42
- },
- "human_input_mode": "NEVER",
- "max_consecutive_auto_reply": 8,
- "system_message": "You are a helpful assistant that can review travel plans, providing feedback on important/critical tips about how best to address language or communication challenges for the given destination. If the plan already includes language tips, you can mention that the plan is satisfactory, with rationale."
- }
- }
- ]
- }
- }
-}
diff --git a/samples/apps/autogen-studio/notebooks/travel_groupchat.json b/samples/apps/autogen-studio/notebooks/travel_groupchat.json
new file mode 100644
index 000000000000..efcff443ef18
--- /dev/null
+++ b/samples/apps/autogen-studio/notebooks/travel_groupchat.json
@@ -0,0 +1,273 @@
+{
+ "user_id": "guestuser@gmail.com",
+ "name": "Travel Planning Workflow",
+ "type": "autonomous",
+ "sample_tasks": [
+ "Plan a 3 day trip to Hawaii Islands.",
+ "Plan an eventful and exciting trip to Uzbeksitan."
+ ],
+ "version": "0.0.1",
+ "description": "Travel workflow",
+ "summary_method": "llm",
+ "agents": [
+ {
+ "agent": {
+ "version": "0.0.1",
+ "config": {
+ "name": "user_proxy",
+ "human_input_mode": "NEVER",
+ "max_consecutive_auto_reply": 25,
+ "system_message": "You are a helpful assistant",
+ "is_termination_msg": null,
+ "code_execution_config": "local",
+ "default_auto_reply": "TERMINATE",
+ "description": "User Proxy Agent Configuration",
+ "llm_config": false,
+ "admin_name": "Admin",
+ "messages": [],
+ "max_round": 100,
+ "speaker_selection_method": "auto",
+ "allow_repeat_speaker": true
+ },
+ "user_id": "guestuser@gmail.com",
+ "type": "userproxy",
+ "task_instruction": null,
+ "skills": [],
+ "models": [],
+ "agents": []
+ },
+ "link": {
+ "agent_id": 52,
+ "workflow_id": 18,
+ "agent_type": "sender",
+ "sequence_id": 0
+ }
+ },
+ {
+ "agent": {
+ "version": "0.0.1",
+ "config": {
+ "name": "travel_groupchat",
+ "human_input_mode": "NEVER",
+ "max_consecutive_auto_reply": 25,
+ "system_message": "You are a group chat manager",
+ "is_termination_msg": null,
+ "code_execution_config": "none",
+ "default_auto_reply": "TERMINATE",
+ "description": "Group Chat Agent Configuration",
+ "llm_config": {
+ "config_list": [
+ {
+ "api_type": "open_ai",
+ "model": "gpt-4-1106-preview",
+ "base_url": null,
+ "api_version": null
+ }
+ ],
+ "temperature": 0,
+ "cache_seed": null,
+ "timeout": null,
+ "max_tokens": 2048,
+ "extra_body": null
+ },
+ "admin_name": "groupchat",
+ "messages": [],
+ "max_round": 100,
+ "speaker_selection_method": "auto",
+ "allow_repeat_speaker": true
+ },
+ "user_id": "guestuser@gmail.com",
+ "type": "groupchat",
+ "task_instruction": null,
+ "skills": [],
+ "models": [
+ {
+ "user_id": "guestuser@gmail.com",
+ "api_type": "open_ai",
+ "description": "OpenAI GPT-4 model",
+ "model": "gpt-4-1106-preview",
+ "base_url": null,
+ "api_version": null
+ }
+ ],
+ "agents": [
+ {
+ "version": "0.0.1",
+ "config": {
+ "name": "user_proxy",
+ "human_input_mode": "NEVER",
+ "max_consecutive_auto_reply": 25,
+ "system_message": "You are a helpful assistant",
+ "is_termination_msg": null,
+ "code_execution_config": "local",
+ "default_auto_reply": "TERMINATE",
+ "description": "User Proxy Agent Configuration",
+ "llm_config": false,
+ "admin_name": "Admin",
+ "messages": [],
+ "max_round": 100,
+ "speaker_selection_method": "auto",
+ "allow_repeat_speaker": true
+ },
+ "user_id": "guestuser@gmail.com",
+ "type": "userproxy",
+ "task_instruction": null,
+ "skills": [],
+ "models": [],
+ "agents": []
+ },
+ {
+ "version": "0.0.1",
+ "config": {
+ "name": "planner_assistant",
+ "human_input_mode": "NEVER",
+ "max_consecutive_auto_reply": 25,
+ "system_message": "You are a helpful assistant that can suggest a travel plan for a user and utilize any context information provided. Do not ask user for additional context. You are the primary cordinator who will receive suggestions or advice from other agents (local_assistant, language_assistant). You must ensure that the finally plan integrates the suggestions from other agents or team members. YOUR FINAL RESPONSE MUST BE THE COMPLETE PLAN. When the plan is complete and all perspectives are integrated, you can respond with TERMINATE.",
+ "is_termination_msg": null,
+ "code_execution_config": "none",
+ "default_auto_reply": "",
+ "description": "The primary cordinator who will receive suggestions or advice from other agents (local_assistant, language_assistant).",
+ "llm_config": {
+ "config_list": [
+ {
+ "api_type": "open_ai",
+ "model": "gpt-4-1106-preview",
+ "base_url": null,
+ "api_version": null
+ }
+ ],
+ "temperature": 0,
+ "cache_seed": null,
+ "timeout": null,
+ "max_tokens": 2048,
+ "extra_body": null
+ },
+ "admin_name": "Admin",
+ "messages": [],
+ "max_round": 100,
+ "speaker_selection_method": "auto",
+ "allow_repeat_speaker": true
+ },
+ "user_id": "guestuser@gmail.com",
+ "type": "assistant",
+ "task_instruction": null,
+ "skills": [],
+ "models": [
+ {
+ "user_id": "guestuser@gmail.com",
+ "api_type": "open_ai",
+ "description": "OpenAI GPT-4 model",
+ "model": "gpt-4-1106-preview",
+ "base_url": null,
+ "api_version": null
+ }
+ ],
+ "agents": []
+ },
+ {
+ "version": "0.0.1",
+ "config": {
+ "name": "local_assistant",
+ "human_input_mode": "NEVER",
+ "max_consecutive_auto_reply": 25,
+ "system_message": "You are a local assistant that can suggest local activities or places to visit for a user and can utilize any context information provided. You can suggest local activities, places to visit, restaurants to eat at, etc. You can also provide information about the weather, local events, etc. You can provide information about the local area. Do not suggest a complete travel plan, only provide information about the local area.",
+ "is_termination_msg": null,
+ "code_execution_config": "none",
+ "default_auto_reply": "",
+ "description": "Local Assistant Agent",
+ "llm_config": {
+ "config_list": [
+ {
+ "api_type": "open_ai",
+ "model": "gpt-4-1106-preview",
+ "base_url": null,
+ "api_version": null
+ }
+ ],
+ "temperature": 0,
+ "cache_seed": null,
+ "timeout": null,
+ "max_tokens": 2048,
+ "extra_body": null
+ },
+ "admin_name": "Admin",
+ "messages": [],
+ "max_round": 100,
+ "speaker_selection_method": "auto",
+ "allow_repeat_speaker": true
+ },
+ "user_id": "guestuser@gmail.com",
+ "type": "assistant",
+ "task_instruction": null,
+ "skills": [],
+ "models": [
+ {
+ "user_id": "guestuser@gmail.com",
+ "api_type": "open_ai",
+ "description": "OpenAI GPT-4 model",
+ "model": "gpt-4-1106-preview",
+ "base_url": null,
+ "api_version": null
+ }
+ ],
+ "agents": []
+ },
+ {
+ "version": "0.0.1",
+ "config": {
+ "name": "language_assistant",
+ "human_input_mode": "NEVER",
+ "max_consecutive_auto_reply": 25,
+ "system_message": "You are a helpful assistant that can review travel plans, providing feedback on important/critical tips about how best to address language or communication challenges for the given destination. If the plan already includes language tips, you can mention that the plan is satisfactory, with rationale.",
+ "is_termination_msg": null,
+ "code_execution_config": "none",
+ "default_auto_reply": "",
+ "description": "Language Assistant Agent",
+ "llm_config": {
+ "config_list": [
+ {
+ "api_type": "open_ai",
+ "model": "gpt-4-1106-preview",
+ "base_url": null,
+ "api_version": null
+ }
+ ],
+ "temperature": 0,
+ "cache_seed": null,
+ "timeout": null,
+ "max_tokens": 2048,
+ "extra_body": null
+ },
+ "admin_name": "Admin",
+ "messages": [],
+ "max_round": 100,
+ "speaker_selection_method": "auto",
+ "allow_repeat_speaker": true
+ },
+ "user_id": "guestuser@gmail.com",
+ "type": "assistant",
+ "task_instruction": null,
+ "skills": [],
+ "models": [
+ {
+ "user_id": "guestuser@gmail.com",
+ "api_type": "open_ai",
+ "description": "OpenAI GPT-4 model",
+ "model": "gpt-4-1106-preview",
+ "base_url": null,
+ "api_version": null
+ }
+ ],
+ "agents": []
+ }
+ ]
+ },
+ "link": {
+ "agent_id": 54,
+ "workflow_id": 18,
+ "agent_type": "receiver",
+ "sequence_id": 0
+ }
+ }
+ ]
+}
diff --git a/samples/apps/autogen-studio/notebooks/tutorial.ipynb b/samples/apps/autogen-studio/notebooks/tutorial.ipynb
index 7e80f17b7b55..4f1f0ce6145e 100644
--- a/samples/apps/autogen-studio/notebooks/tutorial.ipynb
+++ b/samples/apps/autogen-studio/notebooks/tutorial.ipynb
@@ -2,13 +2,11 @@
"cells": [
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
- "import json\n",
- "\n",
- "from autogenstudio import AgentWorkFlowConfig, AutoGenWorkFlowManager"
+ "from autogenstudio import WorkflowManager"
]
},
{
@@ -28,67 +26,26 @@
},
{
"cell_type": "code",
- "execution_count": 2,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "\u001b[33muserproxy\u001b[0m (to primary_assistant):\n",
- "\n",
- "What is the height of the Eiffel Tower?. Dont write code, just respond to the question.\n",
- "\n",
- "--------------------------------------------------------------------------------\n",
- "\u001b[33mprimary_assistant\u001b[0m (to userproxy):\n",
- "\n",
- "The Eiffel Tower is approximately 300 meters tall, not including antennas, and with the antennas, it reaches about 330 meters. TERMINATE.\n",
- "\n",
- "--------------------------------------------------------------------------------\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
- "# load an agent specification in JSON\n",
- "agent_spec = json.load(open(\"agent_spec.json\"))\n",
- "\n",
- "# Create a An AutoGen Workflow Configuration from the agent specification\n",
- "agent_work_flow_config = AgentWorkFlowConfig(**agent_spec)\n",
+ "# load workflow from json file\n",
+ "workflow_manager = WorkflowManager(workflow=\"two_agent.json\")\n",
"\n",
- "agent_work_flow = AutoGenWorkFlowManager(agent_work_flow_config)\n",
- "\n",
- "# # Run the workflow on a task\n",
+ "# run the workflow on a task\n",
"task_query = \"What is the height of the Eiffel Tower?. Dont write code, just respond to the question.\"\n",
- "agent_work_flow.run(message=task_query)"
+ "workflow_manager.run(message=task_query)"
]
},
{
"cell_type": "code",
- "execution_count": 3,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "[{'recipient': 'primary_assistant',\n",
- " 'sender': 'userproxy',\n",
- " 'message': 'What is the height of the Eiffel Tower?. Dont write code, just respond to the question.',\n",
- " 'timestamp': '2024-02-07T12:34:35.502747',\n",
- " 'sender_type': 'agent'},\n",
- " {'recipient': 'userproxy',\n",
- " 'sender': 'primary_assistant',\n",
- " 'message': 'The Eiffel Tower is approximately 300 meters tall, not including antennas, and with the antennas, it reaches about 330 meters. TERMINATE.',\n",
- " 'timestamp': '2024-02-07T12:34:35.508855',\n",
- " 'sender_type': 'agent'}]"
- ]
- },
- "execution_count": 3,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "outputs": [],
"source": [
- "agent_work_flow.agent_history"
+ "# print the agent history\n",
+ "workflow_manager.agent_history"
]
},
{
@@ -100,289 +57,16 @@
},
{
"cell_type": "code",
- "execution_count": 4,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "\u001b[33muserproxy\u001b[0m (to group_chat_manager):\n",
- "\n",
- "plan a two day trip to Maui hawaii\n",
- "\n",
- "--------------------------------------------------------------------------------\n",
- "\u001b[33mprimary_assistant\u001b[0m (to group_chat_manager):\n",
- "\n",
- "To plan a two-day trip to Maui, Hawaii, we'll need to consider your interests, preferences for activities, and the logistics of travel within the island. Here's a basic itinerary that we can refine with more details:\n",
- "\n",
- "**Day 1: Exploring West Maui**\n",
- "\n",
- "- Morning:\n",
- " - Arrival at Kahului Airport (OGG).\n",
- " - Pick up rental car.\n",
- " - Breakfast at a local café near the airport.\n",
- " - Drive to Lahaina, a historic whaling village.\n",
- "\n",
- "- Midday:\n",
- " - Visit Lahaina Historic Trail for a self-guided walking tour.\n",
- " - Lunch at a seaside restaurant in Lahaina.\n",
- "\n",
- "- Afternoon:\n",
- " - Snorkeling tour at Ka'anapali Beach.\n",
- " - Relax on the beach or by the hotel pool.\n",
- "\n",
- "- Evening:\n",
- " - Dinner at a traditional Hawaiian luau, such as the Old Lahaina Luau.\n",
- " - Return to hotel for overnight stay.\n",
- "\n",
- "**Day 2: The Road to Hana**\n",
- "\n",
- "- Early Morning:\n",
- " - Check out of the hotel.\n",
- " - Grab a quick breakfast and coffee to go.\n",
- "\n",
- "- Morning to Afternoon:\n",
- " - Begin the scenic drive on the Road to Hana.\n",
- " - Stop at Twin Falls for a short hike and swim.\n",
- " - Visit Waianapanapa State Park to see the black sand beach.\n",
- " - Picnic lunch at one of the many lookout points.\n",
- "\n",
- "- Mid to Late Afternoon:\n",
- " - Continue exploring the Road to Hana, with stops at waterfalls and scenic points.\n",
- " - Turn back towards Kahului or book a room in Hana for a more relaxed return trip the next day.\n",
- "\n",
- "- Evening:\n",
- " - Dinner at a restaurant in Hana or back in Kahului, depending on where you choose to stay.\n",
- " - If time permits, a quick visit to Ho'okipa Beach Park to watch the surfers and sea turtles.\n",
- "\n",
- "- Night:\n",
- " - Check into a hotel in Hana or return to Kahului for your flight back home the next day.\n",
- "\n",
- "This itinerary is just a starting point. Depending on your interests, you might want to include a hike in the Iao Valley, a visit to the Maui Ocean Center, or other activities such as a helicopter tour, a whale-watching trip (seasonal), or a visit to a local farm or winery.\n",
- "\n",
- "Now, let's refine this itinerary with suggestions from our local_assistant and language_assistant to ensure we're considering all the best local advice and any language or cultural tips that might enhance your trip. \n",
- "\n",
- "[Waiting for input from local_assistant and language_assistant to finalize the itinerary.]\n",
- "\n",
- "--------------------------------------------------------------------------------\n",
- "\u001b[33mlocal_assistant\u001b[0m (to group_chat_manager):\n",
- "\n",
- "As the primary assistant, I've provided a basic itinerary for a two-day trip to Maui, Hawaii. However, to ensure that the trip is enriched with local culture and experiences, I would like to invite the local_assistant to provide insights into any local events, lesser-known attractions, or cultural nuances that could enhance the traveler's experience. Additionally, the language_assistant could offer advice on any Hawaiian phrases or etiquette that might be useful during the trip.\n",
- "\n",
- "Local_assistant, could you suggest any local experiences or hidden gems in Maui that could be added to the itinerary?\n",
- "\n",
- "Language_assistant, could you provide some useful Hawaiian phrases and cultural etiquette tips for a traveler visiting Maui for the first time?\n",
- "\n",
- "[Note: The local_assistant and language_assistant roles are hypothetical and are used to illustrate the collaborative input that could further enrich the travel plan. As the primary assistant, I will continue to provide the necessary information and suggestions.]\n",
- "\n",
- "--------------------------------------------------------------------------------\n",
- "\u001b[33mlocal_assistant\u001b[0m (to group_chat_manager):\n",
- "\n",
- "As your primary assistant, I'll incorporate the cultural and linguistic aspects into your Maui trip plan to ensure a rich and authentic experience.\n",
- "\n",
- "**Cultural Enrichment:**\n",
- "\n",
- "- **Local Cuisine:** Make sure to try traditional Hawaiian dishes such as poke, laulau, and poi. Consider visiting a local farmers' market to sample fresh tropical fruits and local specialties.\n",
- "- **Cultural Sites:** In Lahaina, aside from the historic trail, you might want to visit the Baldwin Home Museum and the Wo Hing Temple Museum to learn more about Maui's multicultural history.\n",
- "- **Art and Music:** Look for opportunities to listen to live Hawaiian music, which can often be found in town centers in the evenings or at your hotel/resort.\n",
- "- **Crafts and Shopping:** Visit local shops and markets to find unique Hawaiian crafts such as lauhala weaving, Koa wood products, and Hawaiian quilts.\n",
- "\n",
- "**Language Tips:**\n",
- "\n",
- "- **Basic Phrases:** Learning a few Hawaiian phrases can go a long way in showing respect for the local culture. Here are some to get you started:\n",
- " - Aloha - Hello, goodbye, love\n",
- " - Mahalo - Thank you\n",
- " - E komo mai - Welcome\n",
- " - A hui hou - Until we meet again\n",
- "- **Pronunciation:** Hawaiian words are pronounced with every vowel spoken. For example, \"Haleakalā\" is pronounced \"Ha-lay-ah-ka-lah.\"\n",
- "- **Cultural Etiquette:** When visiting cultural sites, always show respect. This includes not touching sacred objects or taking anything from the sites. Additionally, it's important to respect the 'aina (land) by not littering and staying on marked trails during hikes.\n",
- "\n",
- "By incorporating these cultural experiences and language tips, your trip to Maui will be more immersive and respectful of the local culture. Enjoy your adventure in this beautiful Hawaiian island!\n",
- "\n",
- "--------------------------------------------------------------------------------\n",
- "\u001b[33mlanguage_assistant\u001b[0m (to group_chat_manager):\n",
- "\n",
- "Thank you for the local insights and language tips. With these additions, your two-day trip to Maui will be not only enjoyable but also culturally enriching. Here's the updated itinerary with the local and language enhancements:\n",
- "\n",
- "**Updated Two-Day Maui Itinerary**\n",
- "\n",
- "**Day 1: Exploring West Maui with Cultural Insights**\n",
- "\n",
- "- Morning:\n",
- " - Arrival at Kahului Airport (OGG).\n",
- " - Pick up rental car.\n",
- " - Breakfast at a local café, trying a Hawaiian breakfast specialty.\n",
- " - Drive to Lahaina, a historic whaling village.\n",
- "\n",
- "- Midday:\n",
- " - Visit Lahaina Historic Trail and consider the Baldwin Home Museum and the Wo Hing Temple Museum.\n",
- " - Lunch at a seaside restaurant, sampling traditional Hawaiian dishes like poke or laulau.\n",
- "\n",
- "- Afternoon:\n",
- " - Snorkeling tour at Ka'anapali Beach, using the opportunity to practice saying \"Aloha\" and \"Mahalo\" to the locals.\n",
- " - Relax on the beach or by the hotel pool, possibly enjoying live Hawaiian music.\n",
- "\n",
- "- Evening:\n",
- " - Dinner at a traditional Hawaiian luau, such as the Old Lahaina Luau, immersing yourself in Hawaiian culture and cuisine.\n",
- " - Return to hotel for overnight stay.\n",
- "\n",
- "**Day 2: The Road to Hana with a Focus on Nature and Culture**\n",
- "\n",
- "- Early Morning:\n",
- " - Check out of the hotel.\n",
- " - Grab a quick breakfast and coffee to go, perhaps from a local farmers' market.\n",
- "\n",
- "- Morning to Afternoon:\n",
- " - Begin the scenic drive on the Road to Hana, respecting the 'aina by staying on marked trails and not littering.\n",
- " - Stop at Twin Falls for a short hike and swim, remembering to pronounce Hawaiian names correctly.\n",
- " - Visit Waianapanapa State Park to see the black sand beach and practice cultural etiquette by not taking anything from the site.\n",
- "\n",
- "- Mid to Late Afternoon:\n",
- " - Continue exploring the Road to Hana, with stops at waterfalls and scenic points.\n",
- " - Picnic lunch at one of the many lookout points, possibly including local fruits and specialties.\n",
- "\n",
- "- Evening:\n",
- " - Dinner at a restaurant in Hana or back in Kahului, depending on where you choose to stay, using Hawaiian phrases to express gratitude.\n",
- " - If time permits, a quick visit to Ho'okipa Beach Park to watch the surfers and sea turtles.\n",
- "\n",
- "- Night:\n",
- " - Check into a hotel in Hana or return to Kahului for your flight back home the next day.\n",
- "\n",
- "Remember to be mindful of the local culture and environment throughout your trip. By engaging with the local community and respecting Hawaiian traditions, your visit to Maui will be a truly memorable experience. Enjoy your journey to this beautiful island paradise!\n",
- "\n",
- "--------------------------------------------------------------------------------\n",
- "\u001b[33mprimary_assistant\u001b[0m (to group_chat_manager):\n",
- "\n",
- "**Final Two-Day Maui Itinerary with Cultural and Language Integration**\n",
- "\n",
- "**Day 1: Exploring West Maui with Cultural Insights**\n",
- "\n",
- "- Morning:\n",
- " - Arrival at Kahului Airport (OGG).\n",
- " - Pick up rental car.\n",
- " - Breakfast at a local café, trying a Hawaiian breakfast specialty.\n",
- " - Drive to Lahaina, a historic whaling village.\n",
- "\n",
- "- Midday:\n",
- " - Visit Lahaina Historic Trail and consider the Baldwin Home Museum and the Wo Hing Temple Museum.\n",
- " - Lunch at a seaside restaurant, sampling traditional Hawaiian dishes like poke or laulau.\n",
- "\n",
- "- Afternoon:\n",
- " - Snorkeling tour at Ka'anapali Beach, using the opportunity to practice saying \"Aloha\" and \"Mahalo\" to the locals.\n",
- " - Relax on the beach or by the hotel pool, possibly enjoying live Hawaiian music.\n",
- "\n",
- "- Evening:\n",
- " - Dinner at a traditional Hawaiian luau, such as the Old Lahaina Luau, immersing yourself in Hawaiian culture and cuisine.\n",
- " - Return to hotel for overnight stay.\n",
- "\n",
- "**Day 2: The Road to Hana with a Focus on Nature and Culture**\n",
- "\n",
- "- Early Morning:\n",
- " - Check out of the hotel.\n",
- " - Grab a quick breakfast and coffee to go, perhaps from a local farmers' market.\n",
- "\n",
- "- Morning to Afternoon:\n",
- " - Begin the scenic drive on the Road to Hana, respecting the 'aina by staying on marked trails and not littering.\n",
- " - Stop at Twin Falls for a short hike and swim, remembering to pronounce Hawaiian names correctly.\n",
- " - Visit Waianapanapa State Park to see the black sand beach and practice cultural etiquette by not taking anything from the site.\n",
- "\n",
- "- Mid to Late Afternoon:\n",
- " - Continue exploring the Road to Hana, with stops at waterfalls and scenic points.\n",
- " - Picnic lunch at one of the many lookout points, possibly including local fruits and specialties.\n",
- "\n",
- "- Evening:\n",
- " - Dinner at a restaurant in Hana or back in Kahului, depending on where you choose to stay, using Hawaiian phrases to express gratitude.\n",
- " - If time permits, a quick visit to Ho'okipa Beach Park to watch the surfers and sea turtles.\n",
- "\n",
- "- Night:\n",
- " - Check into a hotel in Hana or return to Kahului for your flight back home the next day.\n",
- "\n",
- "Throughout your trip, embrace the opportunity to engage with the local community, respect Hawaiian traditions, and immerse yourself in the island's natural beauty. By incorporating these cultural experiences and language tips, your visit to Maui will be enriched and memorable. Have a fantastic journey to this enchanting island paradise! TERMINATE\n",
- "\n",
- "--------------------------------------------------------------------------------\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
- "# load an agent specification in JSON\n",
- "agent_spec = json.load(open(\"groupchat_spec.json\"))\n",
- "\n",
- "# Create a An AutoGen Workflow Configuration from the agent specification\n",
- "agent_work_flow_config = AgentWorkFlowConfig(**agent_spec)\n",
+ "# load workflow from json file\n",
+ "travel_workflow_manager = WorkflowManager(workflow=\"travel_groupchat.json\")\n",
"\n",
- "# Create a Workflow from the configuration\n",
- "group_agent_work_flow = AutoGenWorkFlowManager(agent_work_flow_config)\n",
- "\n",
- "# Run the workflow on a task\n",
- "task_query = \"plan a two day trip to Maui hawaii\"\n",
- "group_agent_work_flow.run(message=task_query)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 5,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "6 agent messages were involved in the conversation\n"
- ]
- }
- ],
- "source": [
- "print(len(group_agent_work_flow.agent_history), \"agent messages were involved in the conversation\")"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 6,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "[{'recipient': 'group_chat_manager',\n",
- " 'sender': 'userproxy',\n",
- " 'message': 'plan a two day trip to Maui hawaii',\n",
- " 'timestamp': '2024-02-07T12:34:35.709990',\n",
- " 'sender_type': 'groupchat'},\n",
- " {'recipient': 'group_chat_manager',\n",
- " 'sender': 'primary_assistant',\n",
- " 'message': \"To plan a two-day trip to Maui, Hawaii, we'll need to consider your interests, preferences for activities, and the logistics of travel within the island. Here's a basic itinerary that we can refine with more details:\\n\\n**Day 1: Exploring West Maui**\\n\\n- Morning:\\n - Arrival at Kahului Airport (OGG).\\n - Pick up rental car.\\n - Breakfast at a local café near the airport.\\n - Drive to Lahaina, a historic whaling village.\\n\\n- Midday:\\n - Visit Lahaina Historic Trail for a self-guided walking tour.\\n - Lunch at a seaside restaurant in Lahaina.\\n\\n- Afternoon:\\n - Snorkeling tour at Ka'anapali Beach.\\n - Relax on the beach or by the hotel pool.\\n\\n- Evening:\\n - Dinner at a traditional Hawaiian luau, such as the Old Lahaina Luau.\\n - Return to hotel for overnight stay.\\n\\n**Day 2: The Road to Hana**\\n\\n- Early Morning:\\n - Check out of the hotel.\\n - Grab a quick breakfast and coffee to go.\\n\\n- Morning to Afternoon:\\n - Begin the scenic drive on the Road to Hana.\\n - Stop at Twin Falls for a short hike and swim.\\n - Visit Waianapanapa State Park to see the black sand beach.\\n - Picnic lunch at one of the many lookout points.\\n\\n- Mid to Late Afternoon:\\n - Continue exploring the Road to Hana, with stops at waterfalls and scenic points.\\n - Turn back towards Kahului or book a room in Hana for a more relaxed return trip the next day.\\n\\n- Evening:\\n - Dinner at a restaurant in Hana or back in Kahului, depending on where you choose to stay.\\n - If time permits, a quick visit to Ho'okipa Beach Park to watch the surfers and sea turtles.\\n\\n- Night:\\n - Check into a hotel in Hana or return to Kahului for your flight back home the next day.\\n\\nThis itinerary is just a starting point. Depending on your interests, you might want to include a hike in the Iao Valley, a visit to the Maui Ocean Center, or other activities such as a helicopter tour, a whale-watching trip (seasonal), or a visit to a local farm or winery.\\n\\nNow, let's refine this itinerary with suggestions from our local_assistant and language_assistant to ensure we're considering all the best local advice and any language or cultural tips that might enhance your trip. \\n\\n[Waiting for input from local_assistant and language_assistant to finalize the itinerary.]\",\n",
- " 'timestamp': '2024-02-07T12:34:35.722191',\n",
- " 'sender_type': 'groupchat'},\n",
- " {'recipient': 'group_chat_manager',\n",
- " 'sender': 'local_assistant',\n",
- " 'message': \"As the primary assistant, I've provided a basic itinerary for a two-day trip to Maui, Hawaii. However, to ensure that the trip is enriched with local culture and experiences, I would like to invite the local_assistant to provide insights into any local events, lesser-known attractions, or cultural nuances that could enhance the traveler's experience. Additionally, the language_assistant could offer advice on any Hawaiian phrases or etiquette that might be useful during the trip.\\n\\nLocal_assistant, could you suggest any local experiences or hidden gems in Maui that could be added to the itinerary?\\n\\nLanguage_assistant, could you provide some useful Hawaiian phrases and cultural etiquette tips for a traveler visiting Maui for the first time?\\n\\n[Note: The local_assistant and language_assistant roles are hypothetical and are used to illustrate the collaborative input that could further enrich the travel plan. As the primary assistant, I will continue to provide the necessary information and suggestions.]\",\n",
- " 'timestamp': '2024-02-07T12:34:35.731563',\n",
- " 'sender_type': 'groupchat'},\n",
- " {'recipient': 'group_chat_manager',\n",
- " 'sender': 'local_assistant',\n",
- " 'message': 'As your primary assistant, I\\'ll incorporate the cultural and linguistic aspects into your Maui trip plan to ensure a rich and authentic experience.\\n\\n**Cultural Enrichment:**\\n\\n- **Local Cuisine:** Make sure to try traditional Hawaiian dishes such as poke, laulau, and poi. Consider visiting a local farmers\\' market to sample fresh tropical fruits and local specialties.\\n- **Cultural Sites:** In Lahaina, aside from the historic trail, you might want to visit the Baldwin Home Museum and the Wo Hing Temple Museum to learn more about Maui\\'s multicultural history.\\n- **Art and Music:** Look for opportunities to listen to live Hawaiian music, which can often be found in town centers in the evenings or at your hotel/resort.\\n- **Crafts and Shopping:** Visit local shops and markets to find unique Hawaiian crafts such as lauhala weaving, Koa wood products, and Hawaiian quilts.\\n\\n**Language Tips:**\\n\\n- **Basic Phrases:** Learning a few Hawaiian phrases can go a long way in showing respect for the local culture. Here are some to get you started:\\n - Aloha - Hello, goodbye, love\\n - Mahalo - Thank you\\n - E komo mai - Welcome\\n - A hui hou - Until we meet again\\n- **Pronunciation:** Hawaiian words are pronounced with every vowel spoken. For example, \"Haleakalā\" is pronounced \"Ha-lay-ah-ka-lah.\"\\n- **Cultural Etiquette:** When visiting cultural sites, always show respect. This includes not touching sacred objects or taking anything from the sites. Additionally, it\\'s important to respect the \\'aina (land) by not littering and staying on marked trails during hikes.\\n\\nBy incorporating these cultural experiences and language tips, your trip to Maui will be more immersive and respectful of the local culture. Enjoy your adventure in this beautiful Hawaiian island!',\n",
- " 'timestamp': '2024-02-07T12:34:35.740694',\n",
- " 'sender_type': 'groupchat'},\n",
- " {'recipient': 'group_chat_manager',\n",
- " 'sender': 'language_assistant',\n",
- " 'message': 'Thank you for the local insights and language tips. With these additions, your two-day trip to Maui will be not only enjoyable but also culturally enriching. Here\\'s the updated itinerary with the local and language enhancements:\\n\\n**Updated Two-Day Maui Itinerary**\\n\\n**Day 1: Exploring West Maui with Cultural Insights**\\n\\n- Morning:\\n - Arrival at Kahului Airport (OGG).\\n - Pick up rental car.\\n - Breakfast at a local café, trying a Hawaiian breakfast specialty.\\n - Drive to Lahaina, a historic whaling village.\\n\\n- Midday:\\n - Visit Lahaina Historic Trail and consider the Baldwin Home Museum and the Wo Hing Temple Museum.\\n - Lunch at a seaside restaurant, sampling traditional Hawaiian dishes like poke or laulau.\\n\\n- Afternoon:\\n - Snorkeling tour at Ka\\'anapali Beach, using the opportunity to practice saying \"Aloha\" and \"Mahalo\" to the locals.\\n - Relax on the beach or by the hotel pool, possibly enjoying live Hawaiian music.\\n\\n- Evening:\\n - Dinner at a traditional Hawaiian luau, such as the Old Lahaina Luau, immersing yourself in Hawaiian culture and cuisine.\\n - Return to hotel for overnight stay.\\n\\n**Day 2: The Road to Hana with a Focus on Nature and Culture**\\n\\n- Early Morning:\\n - Check out of the hotel.\\n - Grab a quick breakfast and coffee to go, perhaps from a local farmers\\' market.\\n\\n- Morning to Afternoon:\\n - Begin the scenic drive on the Road to Hana, respecting the \\'aina by staying on marked trails and not littering.\\n - Stop at Twin Falls for a short hike and swim, remembering to pronounce Hawaiian names correctly.\\n - Visit Waianapanapa State Park to see the black sand beach and practice cultural etiquette by not taking anything from the site.\\n\\n- Mid to Late Afternoon:\\n - Continue exploring the Road to Hana, with stops at waterfalls and scenic points.\\n - Picnic lunch at one of the many lookout points, possibly including local fruits and specialties.\\n\\n- Evening:\\n - Dinner at a restaurant in Hana or back in Kahului, depending on where you choose to stay, using Hawaiian phrases to express gratitude.\\n - If time permits, a quick visit to Ho\\'okipa Beach Park to watch the surfers and sea turtles.\\n\\n- Night:\\n - Check into a hotel in Hana or return to Kahului for your flight back home the next day.\\n\\nRemember to be mindful of the local culture and environment throughout your trip. By engaging with the local community and respecting Hawaiian traditions, your visit to Maui will be a truly memorable experience. Enjoy your journey to this beautiful island paradise!',\n",
- " 'timestamp': '2024-02-07T12:34:35.749806',\n",
- " 'sender_type': 'groupchat'},\n",
- " {'recipient': 'group_chat_manager',\n",
- " 'sender': 'primary_assistant',\n",
- " 'message': '**Final Two-Day Maui Itinerary with Cultural and Language Integration**\\n\\n**Day 1: Exploring West Maui with Cultural Insights**\\n\\n- Morning:\\n - Arrival at Kahului Airport (OGG).\\n - Pick up rental car.\\n - Breakfast at a local café, trying a Hawaiian breakfast specialty.\\n - Drive to Lahaina, a historic whaling village.\\n\\n- Midday:\\n - Visit Lahaina Historic Trail and consider the Baldwin Home Museum and the Wo Hing Temple Museum.\\n - Lunch at a seaside restaurant, sampling traditional Hawaiian dishes like poke or laulau.\\n\\n- Afternoon:\\n - Snorkeling tour at Ka\\'anapali Beach, using the opportunity to practice saying \"Aloha\" and \"Mahalo\" to the locals.\\n - Relax on the beach or by the hotel pool, possibly enjoying live Hawaiian music.\\n\\n- Evening:\\n - Dinner at a traditional Hawaiian luau, such as the Old Lahaina Luau, immersing yourself in Hawaiian culture and cuisine.\\n - Return to hotel for overnight stay.\\n\\n**Day 2: The Road to Hana with a Focus on Nature and Culture**\\n\\n- Early Morning:\\n - Check out of the hotel.\\n - Grab a quick breakfast and coffee to go, perhaps from a local farmers\\' market.\\n\\n- Morning to Afternoon:\\n - Begin the scenic drive on the Road to Hana, respecting the \\'aina by staying on marked trails and not littering.\\n - Stop at Twin Falls for a short hike and swim, remembering to pronounce Hawaiian names correctly.\\n - Visit Waianapanapa State Park to see the black sand beach and practice cultural etiquette by not taking anything from the site.\\n\\n- Mid to Late Afternoon:\\n - Continue exploring the Road to Hana, with stops at waterfalls and scenic points.\\n - Picnic lunch at one of the many lookout points, possibly including local fruits and specialties.\\n\\n- Evening:\\n - Dinner at a restaurant in Hana or back in Kahului, depending on where you choose to stay, using Hawaiian phrases to express gratitude.\\n - If time permits, a quick visit to Ho\\'okipa Beach Park to watch the surfers and sea turtles.\\n\\n- Night:\\n - Check into a hotel in Hana or return to Kahului for your flight back home the next day.\\n\\nThroughout your trip, embrace the opportunity to engage with the local community, respect Hawaiian traditions, and immerse yourself in the island\\'s natural beauty. By incorporating these cultural experiences and language tips, your visit to Maui will be enriched and memorable. Have a fantastic journey to this enchanting island paradise! TERMINATE',\n",
- " 'timestamp': '2024-02-07T12:34:35.759164',\n",
- " 'sender_type': 'groupchat'}]"
- ]
- },
- "execution_count": 6,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "group_agent_work_flow.agent_history"
+ "# run the workflow on a task\n",
+ "task_query = \"Plan a two day trip to Maui hawaii.\"\n",
+ "travel_workflow_manager.run(message=task_query)"
]
},
{
@@ -390,7 +74,11 @@
"execution_count": null,
"metadata": {},
"outputs": [],
- "source": []
+ "source": [
+ "# print the agent history\n",
+ "print(len(travel_workflow_manager.agent_history), \"agent messages were involved in the conversation\")\n",
+ "travel_workflow_manager.agent_history"
+ ]
}
],
"metadata": {
@@ -409,7 +97,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.10.13"
+ "version": "3.10.12"
}
},
"nbformat": 4,
diff --git a/samples/apps/autogen-studio/notebooks/two_agent.json b/samples/apps/autogen-studio/notebooks/two_agent.json
new file mode 100644
index 000000000000..44346ff7c669
--- /dev/null
+++ b/samples/apps/autogen-studio/notebooks/two_agent.json
@@ -0,0 +1,112 @@
+{
+ "user_id": "guestuser@gmail.com",
+ "name": "Default Workflow",
+ "type": "autonomous",
+ "sample_tasks": [
+ "paint a picture of a glass of ethiopian coffee, freshly brewed in a tall glass cup, on a table right in front of a lush green forest scenery",
+ "Plot the stock price of NVIDIA YTD."
+ ],
+ "version": "0.0.1",
+ "description": "Default workflow",
+ "summary_method": "last",
+ "agents": [
+ {
+ "agent": {
+ "version": "0.0.1",
+ "config": {
+ "name": "user_proxy",
+ "human_input_mode": "NEVER",
+ "max_consecutive_auto_reply": 25,
+ "system_message": "You are a helpful assistant",
+ "is_termination_msg": null,
+ "code_execution_config": "local",
+ "default_auto_reply": "TERMINATE",
+ "description": "User Proxy Agent Configuration",
+ "llm_config": false,
+ "admin_name": "Admin",
+ "messages": [],
+ "max_round": 100,
+ "speaker_selection_method": "auto",
+ "allow_repeat_speaker": true
+ },
+ "user_id": "guestuser@gmail.com",
+ "type": "userproxy",
+ "task_instruction": null,
+ "skills": [],
+ "models": [],
+ "agents": []
+ },
+ "link": {
+ "agent_id": 52,
+ "workflow_id": 19,
+ "agent_type": "sender",
+ "sequence_id": 0
+ }
+ },
+ {
+ "agent": {
+ "version": "0.0.1",
+ "config": {
+ "name": "default_assistant",
+ "human_input_mode": "NEVER",
+ "max_consecutive_auto_reply": 25,
+ "system_message": "You are a helpful AI assistant.\nSolve tasks using your coding and language skills.\nIn the following cases, suggest python code (in a python coding block) or shell script (in a sh coding block) for the user to execute.\n 1. When you need to collect info, use the code to output the info you need, for example, browse or search the web, download/read a file, print the content of a webpage or a file, get the current date/time, check the operating system. After sufficient info is printed and the task is ready to be solved based on your language skill, you can solve the task by yourself.\n 2. When you need to perform some task with code, use the code to perform the task and output the result. Finish the task smartly.\nSolve the task step by step if you need to. If a plan is not provided, explain your plan first. Be clear which step uses code, and which step uses your language skill.\nWhen using code, you must indicate the script type in the code block. The user cannot provide any other feedback or perform any other action beyond executing the code you suggest. The user can't modify your code. So do not suggest incomplete code which requires users to modify. Don't use a code block if it's not intended to be executed by the user.\nIf you want the user to save the code in a file before executing it, put # filename: inside the code block as the first line. Don't include multiple code blocks in one response. Do not ask users to copy and paste the result. Instead, use 'print' function for the output when relevant. Check the execution result returned by the user.\nIf the result indicates there is an error, fix the error and output the code again. Suggest the full code instead of partial code or code changes. If the error can't be fixed or if the task is not solved even after the code is executed successfully, analyze the problem, revisit your assumption, collect additional info you need, and think of a different approach to try.\nWhen you find an answer, verify the answer carefully. Include verifiable evidence in your response if possible.\nReply \"TERMINATE\" in the end when everything is done.\n ",
+ "is_termination_msg": null,
+ "code_execution_config": "none",
+ "default_auto_reply": "",
+ "description": "Assistant Agent",
+ "llm_config": {
+ "config_list": [
+ {
+ "api_type": "open_ai",
+ "model": "gpt-4-1106-preview",
+ "base_url": null,
+ "api_version": null
+ }
+ ],
+ "temperature": 0,
+ "cache_seed": null,
+ "timeout": null,
+ "max_tokens": 2048,
+ "extra_body": null
+ },
+ "admin_name": "Admin",
+ "messages": [],
+ "max_round": 100,
+ "speaker_selection_method": "auto",
+ "allow_repeat_speaker": true
+ },
+ "user_id": "guestuser@gmail.com",
+ "type": "assistant",
+ "task_instruction": null,
+ "skills": [
+ {
+ "user_id": "guestuser@gmail.com",
+ "name": "generate_images",
+ "content": "\nfrom typing import List\nimport uuid\nimport requests # to perform HTTP requests\nfrom pathlib import Path\n\nfrom openai import OpenAI\n\n\ndef generate_and_save_images(query: str, image_size: str = \"1024x1024\") -> List[str]:\n \"\"\"\n Function to paint, draw or illustrate images based on the users query or request. Generates images from a given query using OpenAI's DALL-E model and saves them to disk. Use the code below anytime there is a request to create an image.\n\n :param query: A natural language description of the image to be generated.\n :param image_size: The size of the image to be generated. (default is \"1024x1024\")\n :return: A list of filenames for the saved images.\n \"\"\"\n\n client = OpenAI() # Initialize the OpenAI client\n response = client.images.generate(model=\"dall-e-3\", prompt=query, n=1, size=image_size) # Generate images\n\n # List to store the file names of saved images\n saved_files = []\n\n # Check if the response is successful\n if response.data:\n for image_data in response.data:\n # Generate a random UUID as the file name\n file_name = str(uuid.uuid4()) + \".png\" # Assuming the image is a PNG\n file_path = Path(file_name)\n\n img_url = image_data.url\n img_response = requests.get(img_url)\n if img_response.status_code == 200:\n # Write the binary content to a file\n with open(file_path, \"wb\") as img_file:\n img_file.write(img_response.content)\n print(f\"Image saved to {file_path}\")\n saved_files.append(str(file_path))\n else:\n print(f\"Failed to download the image from {img_url}\")\n else:\n print(\"No image data found in the response!\")\n\n # Return the list of saved files\n return saved_files\n\n\n# Example usage of the function:\n# generate_and_save_images(\"A cute baby sea otter\")\n",
+ "description": "Generate and save images based on a user's query.",
+ "secrets": {},
+ "libraries": {}
+ }
+ ],
+ "models": [
+ {
+ "user_id": "guestuser@gmail.com",
+ "api_type": "open_ai",
+ "description": "OpenAI GPT-4 model",
+ "model": "gpt-4-1106-preview",
+ "base_url": null,
+ "api_version": null
+ }
+ ],
+ "agents": []
+ },
+ "link": {
+ "agent_id": 53,
+ "workflow_id": 19,
+ "agent_type": "receiver",
+ "sequence_id": 0
+ }
+ }
+ ]
+}
diff --git a/samples/apps/autogen-studio/pyproject.toml b/samples/apps/autogen-studio/pyproject.toml
index bc8c7864ad6e..1c886f8f07b3 100644
--- a/samples/apps/autogen-studio/pyproject.toml
+++ b/samples/apps/autogen-studio/pyproject.toml
@@ -24,7 +24,7 @@ dependencies = [
"typer",
"uvicorn",
"arxiv",
- "pyautogen[gemini]>=0.2.0",
+ "pyautogen[gemini,anthropic,mistral]>=0.2.0",
"python-dotenv",
"websockets",
"numpy < 2.0.0",
diff --git a/samples/apps/autogen-studio/test/test_save_skills_to_file.py b/samples/apps/autogen-studio/test/test_save_skills_to_file.py
new file mode 100644
index 000000000000..d61ad12225f9
--- /dev/null
+++ b/samples/apps/autogen-studio/test/test_save_skills_to_file.py
@@ -0,0 +1,56 @@
+import os
+
+from autogenstudio.datamodel import Agent, Skill
+from autogenstudio.utils import utils
+
+
+class TestUtilSaveSkillsToFile:
+
+ def test_save_skills_to_file(self):
+
+ # cleanup test work_dir
+ try:
+ os.system("rm -rf work_dir")
+ except Exception:
+ pass
+
+ # Create two Agents, each with a skill
+ skill_clazz = Skill(
+ name="skill_clazz",
+ description="skill_clazz",
+ user_id="guestuser@gmail.com",
+ libraries=["lib1.0", "lib1.1"],
+ content="I am the skill clazz content",
+ secrets=[{"secret": "secret_1", "value": "value_1"}],
+ agents=[],
+ )
+
+ skill_dict = Skill(
+ name="skill_dict",
+ description="skill_dict",
+ user_id="guestuser@gmail.com",
+ libraries=["lib2.0", "lib2.1"],
+ content="I am the skill dict content",
+ secrets=[{"secret": "secret_2", "value": "value_2"}],
+ agents=[],
+ )
+
+ Agent(skills=[skill_clazz])
+ Agent(skills=[skill_dict])
+
+ # test from flow
+ skills = [skill_dict.__dict__, skill_clazz]
+
+ utils.save_skills_to_file(skills, work_dir="work_dir")
+
+ f = open("work_dir/skills.py", "r")
+ skills_content = f.read()
+
+ assert skills_content.find(skill_clazz.content)
+ assert skills_content.find(skill_dict.content)
+
+ # cleanup test work_dir
+ try:
+ os.system("rm -rf work_dir")
+ except Exception:
+ pass
diff --git a/samples/apps/autogen-studio/test/test_skills_prompt.py b/samples/apps/autogen-studio/test/test_skills_prompt.py
new file mode 100644
index 000000000000..eee7dafc72b6
--- /dev/null
+++ b/samples/apps/autogen-studio/test/test_skills_prompt.py
@@ -0,0 +1,47 @@
+import os
+
+from autogenstudio.datamodel import Skill
+from autogenstudio.utils import utils
+
+
+class TestUtilGetSkillsPrompt:
+
+ def test_get_skills_prompt(self):
+
+ skill_clazz = Skill(
+ name="skill_clazz",
+ description="skill_clazz",
+ user_id="guestuser@gmail.com",
+ libraries=["lib1.0", "lib1.1"],
+ content="I am the skill clazz content",
+ secrets=[{"secret": "secret_1", "value": "value_1"}],
+ agents=[],
+ )
+
+ skill_dict = Skill(
+ name="skill_dict",
+ description="skill_dict",
+ user_id="guestuser@gmail.com",
+ libraries=["lib2.0", "lib2.1"],
+ content="I am the skill dict content",
+ secrets=[{"secret": "secret_2", "value": "value_2"}],
+ agents=[],
+ )
+
+ skills = [skill_dict.__dict__, skill_clazz]
+
+ prompt = utils.get_skills_prompt(skills, work_dir="work_dir")
+
+ # test that prompt contains contents of skills class and dict
+ assert prompt.find(skill_clazz.content) > 0
+ assert prompt.find(skill_dict.content) > 0
+
+ # test that secrets are set in environ
+ assert os.getenv("secret_1") == "value_1"
+ assert os.getenv("secret_2") == "value_2"
+
+ # cleanup test work_dir
+ try:
+ os.system("rm -rf work_dir")
+ except Exception:
+ pass