A programming framework for agentic AI
simplify getting-started; update news (#2175)
Chi Wange6237d44a1b2
diff --git a/README.md b/README.mdindex 76f469ece..a5f4ea36f 100644--- a/README.md+++ b/README.md@@ -12,23 +12,25 @@<img src="https://github.com/microsoft/autogen/blob/main/website/static/img/flaml.svg" width=200><br></p> -->+:fire: Mar 26: Andrew Ng gave a shoutout to AutoGen in [What's next for AI agentic workflows](https://youtu.be/sal78ACtGTc?si=JduUzN_1kDnMq0vF) at Sequoia Capital's AI Ascent.+:fire: Mar 3: What's new in AutoGen? 📰[Blog](https://microsoft.github.io/autogen/blog/2024/03/03/AutoGen-Update); 📺[Youtube](https://www.youtube.com/watch?v=j_mtwQiaLGU).:fire: Mar 1: the first AutoGen multi-agent experiment on the challenging [GAIA](https://huggingface.co/spaces/gaia-benchmark/leaderboard) benchmark achieved the No. 1 accuracy in all the three levels.-:fire: Jan 30: AutoGen is highlighted by Peter Lee in Microsoft Research Forum [Keynote](https://t.co/nUBSjPDjqD).+:tada: Jan 30: AutoGen is highlighted by Peter Lee in Microsoft Research Forum [Keynote](https://t.co/nUBSjPDjqD).-:fire: Dec 31: [AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation Framework](https://arxiv.org/abs/2308.08155) is selected by [TheSequence: My Five Favorite AI Papers of 2023](https://thesequence.substack.com/p/my-five-favorite-ai-papers-of-2023).+:tada: Dec 31: [AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation Framework](https://arxiv.org/abs/2308.08155) is selected by [TheSequence: My Five Favorite AI Papers of 2023](https://thesequence.substack.com/p/my-five-favorite-ai-papers-of-2023).<!-- :fire: Nov 24: pyautogen [v0.2](https://github.com/microsoft/autogen/releases/tag/v0.2.0) is released with many updates and new features compared to v0.1.1. It switches to using openai-python v1. Please read the [migration guide](https://microsoft.github.io/autogen/docs/Installation#python). --><!-- :fire: Nov 11: OpenAI's Assistants are available in AutoGen and interoperatable with other AutoGen agents! Checkout our [blogpost](https://microsoft.github.io/autogen/blog/2023/11/13/OAI-assistants) for details and examples. -->-:fire: Nov 8: AutoGen is selected into [Open100: Top 100 Open Source achievements](https://www.benchcouncil.org/evaluation/opencs/annual.html) 35 days after spinoff.+:tada: Nov 8: AutoGen is selected into [Open100: Top 100 Open Source achievements](https://www.benchcouncil.org/evaluation/opencs/annual.html) 35 days after spinoff.-:fire: Nov 6: AutoGen is mentioned by Satya Nadella in a [fireside chat](https://youtu.be/0pLBvgYtv6U).+:tada: Nov 6: AutoGen is mentioned by Satya Nadella in a [fireside chat](https://youtu.be/0pLBvgYtv6U).-:fire: Nov 1: AutoGen is the top trending repo on GitHub in October 2023.+:tada: Nov 1: AutoGen is the top trending repo on GitHub in October 2023.:tada: Oct 03: AutoGen spins off from FLAML on GitHub and has a major paper update (first version on Aug 16).diff --git a/autogen/coding/docker_commandline_code_executor.py b/autogen/coding/docker_commandline_code_executor.pyindex f1db7cd07..8d8931a83 100644--- a/autogen/coding/docker_commandline_code_executor.py+++ b/autogen/coding/docker_commandline_code_executor.py@@ -83,8 +83,7 @@ class DockerCommandLineCodeExecutor(CodeExecutor):if isinstance(work_dir, str):work_dir = Path(work_dir)- if not work_dir.exists():- raise ValueError(f"Working directory {work_dir} does not exist.")+ work_dir.mkdir(exist_ok=True)client = docker.from_env()diff --git a/autogen/coding/local_commandline_code_executor.py b/autogen/coding/local_commandline_code_executor.pyindex b75f54ff1..4bcf98874 100644--- a/autogen/coding/local_commandline_code_executor.py+++ b/autogen/coding/local_commandline_code_executor.py@@ -71,8 +71,7 @@ $functions"""if isinstance(work_dir, str):work_dir = Path(work_dir)- if not work_dir.exists():- raise ValueError(f"Working directory {work_dir} does not exist.")+ work_dir.mkdir(exist_ok=True)self._timeout = timeoutself._work_dir: Path = work_dirdiff --git a/autogen/version.py b/autogen/version.pyindex 198d6db62..f28927419 100644--- a/autogen/version.py+++ b/autogen/version.py@@ -1 +1 @@-__version__ = "0.2.20"+__version__ = "0.2.21"diff --git a/test/coding/test_commandline_code_executor.py b/test/coding/test_commandline_code_executor.pyindex aeb62349b..49d4d35cf 100644--- a/test/coding/test_commandline_code_executor.py+++ b/test/coding/test_commandline_code_executor.py@@ -1,5 +1,6 @@from pathlib import Pathimport sys+import osimport tempfileimport uuidimport pytest@@ -10,7 +11,8 @@ from autogen.coding.factory import CodeExecutorFactoryfrom autogen.coding.docker_commandline_code_executor import DockerCommandLineCodeExecutorfrom autogen.coding.local_commandline_code_executor import LocalCommandLineCodeExecutor-from conftest import MOCK_OPEN_AI_API_KEY, skip_docker+sys.path.append(os.path.join(os.path.dirname(__file__), ".."))+from conftest import MOCK_OPEN_AI_API_KEY, skip_docker # noqa: E402if skip_docker or not is_docker_running():classes_to_test = [LocalCommandLineCodeExecutor]@@ -52,7 +54,7 @@ def test_commandline_executor_init(cls) -> None:assert executor.timeout == 10 and str(executor.work_dir) == "."# Try invalid working directory.- with pytest.raises(ValueError, match="Working directory .* does not exist."):+ with pytest.raises(FileNotFoundError):executor = cls(timeout=111, work_dir="/invalid/directory")diff --git a/website/docs/Getting-Started.mdx b/website/docs/Getting-Started.mdxindex 0e90a322f..a933ae3cc 100644--- a/website/docs/Getting-Started.mdx+++ b/website/docs/Getting-Started.mdx@@ -38,30 +38,37 @@ pip install pyautogen```<Tabs>+ <TabItem value="nocode" label="No code execution" default>++```python+from autogen import AssistantAgent, UserProxyAgent++llm_config = {"model": "gpt-4", "api_key": os.environ["OPENAI_API_KEY"]}+assistant = AssistantAgent("assistant", llm_config=llm_config)+user_proxy = UserProxyAgent("user_proxy", code_execution_config=False)++# Start the chat+user_proxy.initiate_chat(+ assistant,+ message="Tell me a joke about NVDA and TESLA stock prices.",+)+```++ </TabItem><TabItem value="local" label="Local execution" default>:::warningWhen asked, be sure to check the generated code before continuing to ensure it is safe to run.:::```python+import autogenfrom autogen import AssistantAgent, UserProxyAgent-from autogen.coding import LocalCommandLineCodeExecutor--import os-from pathlib import Path--llm_config = {- "config_list": [{"model": "gpt-4", "api_key": os.environ["OPENAI_API_KEY"]}],-}--work_dir = Path("coding")-work_dir.mkdir(exist_ok=True)+llm_config = {"model": "gpt-4", "api_key": os.environ["OPENAI_API_KEY"]}assistant = AssistantAgent("assistant", llm_config=llm_config)-code_executor = LocalCommandLineCodeExecutor(work_dir=work_dir)user_proxy = UserProxyAgent(- "user_proxy", code_execution_config={"executor": code_executor}+ "user_proxy", code_execution_config={"executor": autogen.coding.LocalCommandLineCodeExecutor(work_dir="coding")})# Start the chat@@ -75,20 +82,12 @@ user_proxy.initiate_chat(<TabItem value="docker" label="Docker execution" default>```python+import autogenfrom autogen import AssistantAgent, UserProxyAgent-from autogen.coding import DockerCommandLineCodeExecutor--import os-from pathlib import Path-llm_config = {- "config_list": [{"model": "gpt-4", "api_key": os.environ["OPENAI_API_KEY"]}],-}+llm_config = {"model": "gpt-4", "api_key": os.environ["OPENAI_API_KEY"]}-work_dir = Path("coding")-work_dir.mkdir(exist_ok=True)--with DockerCommandLineCodeExecutor(work_dir=work_dir) as code_executor:+with autogen.coding.DockerCommandLineCodeExecutor(work_dir="coding") as code_executor:assistant = AssistantAgent("assistant", llm_config=llm_config)user_proxy = UserProxyAgent("user_proxy", code_execution_config={"executor": code_executor}@@ -103,7 +102,7 @@ with DockerCommandLineCodeExecutor(work_dir=work_dir) as code_executor:Open `coding/plot.png` to see the generated plot.- </TabItem>+ </TabItem></Tabs>:::tip