mirror of
https://github.com/microsoft/autogen.git
synced 2025-07-06 16:41:30 +00:00

* add new autogen-studio renamed folder * remove old autogen-assistant files * formatting updates * add support for upsert/updates to agents and workflows * version bump, general fixes * support deleting db items * add support for summary method to flowmanager * formatting updates * update serverl urls * version bump * add support for updated metadata messages object to include sender information * formatting updates * update documentation and blog post * blog post update * add description field example to agent workflow spec * readme and blog update * Update website/blog/2023-12-01-AutoGenStudio/index.mdx Co-authored-by: Chi Wang <wang.chi@microsoft.com> * add fix to ensure working directory is cleared after each run * update version * minor updates * formatting updates --------- Co-authored-by: Chi Wang <wang.chi@microsoft.com>
89 lines
2.6 KiB
Plaintext
89 lines
2.6 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## AutoGen Studio Agent Workflow API Example\n",
|
|
"\n",
|
|
"This notebook focuses on demonstrating capabilities of the autogen studio workflow python api. \n",
|
|
"\n",
|
|
"- Declarative Specification of an Agent Workflow \n",
|
|
"- Loading the specification and runnning the resulting agent\n",
|
|
"\n",
|
|
"\n",
|
|
"> Note: The notebook currently demonstrates support for a two agent setup. Support for GroupChat is currently in development."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"work_dir work_dir\n",
|
|
"userproxy (to primary_assistant):\n",
|
|
"\n",
|
|
"What is the height of the Eiffel Tower?\n",
|
|
"\n",
|
|
"--------------------------------------------------------------------------------\n",
|
|
"primary_assistant (to userproxy):\n",
|
|
"\n",
|
|
"The Eiffel Tower, located in Paris, France, has a height of approximately 300 meters (984 feet) to the tip. Its height can vary slightly due to temperature changes which cause the metal to expand and contract. Including antennas, the total height of the Eiffel Tower is about 330 meters (1,083 feet). TERMINATE\n",
|
|
"\n",
|
|
"--------------------------------------------------------------------------------\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"import json \n",
|
|
"from autogenstudio import AutoGenWorkFlowManager, AgentWorkFlowConfig \n",
|
|
"\n",
|
|
"# load an agent specification in JSON \n",
|
|
"agent_spec= json.load(open('agent_spec.json'))\n",
|
|
"\n",
|
|
"# Creat a An AutoGen Workflow Configuration from the agent specification\n",
|
|
"agent_work_flow_config = AgentWorkFlowConfig(**agent_spec)\n",
|
|
"\n",
|
|
"# Create a Workflow from the configuration \n",
|
|
"agent_work_flow = AutoGenWorkFlowManager(agent_work_flow_config) \n",
|
|
"\n",
|
|
"# Run the workflow on a task\n",
|
|
"task_query = \"What is the height of the Eiffel Tower?\"\n",
|
|
"agent_work_flow.run(message=task_query)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": []
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "coral",
|
|
"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.4"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|