Victor Dibia 5547e3b919
Improvements to AutoGen Assistant (#828)
* improve template for files, integreate files in db

* ui update, improvements to file display grid

* add new global skill for image generation

* update readme to address #739

* utils.py refactor, separate db uitls for ease of development

* db utils

* add support for sessions both in backend api and ui

* improve implementation for session support

* add early v1 support for a gallery and publishing to a gallery

* rewrite logic for file storage representation. Store only file references on in db

* update generate image logic

* update ui layout

* fix light dark mode bug

* v1 support for showing items added to gallery

* remove viewer as it is merged in gallery

* formatting updates

* QOL refactoring

* readme and general updates

* add example notebook on assistant api

* imporve naming conventions and formatting

* readme update

* Update samples/apps/autogen-assistant/pyproject.toml

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* Update samples/apps/autogen-assistant/notebooks/tutorial.ipynb

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-12-02 00:22:02 +00:00

81 lines
2.4 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## AutoGen Assistant API\n",
"\n",
"This notebook focuses on demonstrating capabilities of the autogen assistant 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": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"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 that 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 autogenra import AutoGenWorkFlowManager, FlowConfig \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 = FlowConfig(**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)"
]
}
],
"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
}