A programming framework for agentic AI
Fix definition of workspace package, remove uv pin (#4830)
Jack Gerritsfadff4aece75
diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.ymlindex c01b3bfd4..6d99af595 100644--- a/.github/workflows/checks.yml+++ b/.github/workflows/checks.yml@@ -18,7 +18,6 @@ jobs:- uses: astral-sh/setup-uv@v5with:enable-cache: true- version: "0.5.11"- uses: actions/setup-python@v5with:python-version: "3.11"@@ -37,7 +36,6 @@ jobs:- uses: astral-sh/setup-uv@v5with:enable-cache: true- version: "0.5.11"- uses: actions/setup-python@v5with:python-version: "3.11"@@ -66,7 +64,6 @@ jobs:- uses: astral-sh/setup-uv@v5with:enable-cache: true- version: "0.5.11"- uses: actions/setup-python@v5with:python-version: "3.11"@@ -95,7 +92,6 @@ jobs:- uses: astral-sh/setup-uv@v5with:enable-cache: true- version: "0.5.11"- uses: actions/setup-python@v5with:python-version: "3.11"@@ -122,7 +118,6 @@ jobs:- uses: astral-sh/setup-uv@v5with:enable-cache: true- version: "0.5.11"- uses: actions/setup-python@v5with:python-version: "3.11"@@ -147,7 +142,6 @@ jobs:- uses: astral-sh/setup-uv@v5with:enable-cache: true- version: "0.5.11"- uses: actions/setup-python@v5with:python-version: "3.11"@@ -169,7 +163,6 @@ jobs:- uses: astral-sh/setup-uv@v5with:enable-cache: true- version: "0.5.11"- uses: actions/setup-python@v5with:python-version: "3.11"@@ -188,7 +181,6 @@ jobs:- uses: astral-sh/setup-uv@v5with:enable-cache: true- version: "0.5.11"- uses: actions/setup-python@v5with:python-version: "3.11"diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.ymlindex c7776791b..6c2ca98cc 100644--- a/.github/workflows/codeql.yml+++ b/.github/workflows/codeql.yml@@ -61,7 +61,7 @@ jobs:- name: Checkout repositoryuses: actions/checkout@v4- - name: Set up Python+ - name: Set up Pythonuses: actions/setup-python@v5with:python-version: 3.11@@ -76,7 +76,6 @@ jobs:- uses: astral-sh/setup-uv@v5with:enable-cache: true- version: "0.5.11"- run: uv sync --locked --all-extrasworking-directory: ./python- name: Prepare python venvdiff --git a/.github/workflows/docs.yml b/.github/workflows/docs.ymlindex cf205af09..35cc7c137 100644--- a/.github/workflows/docs.yml+++ b/.github/workflows/docs.yml@@ -31,19 +31,20 @@ jobs:matrix:version:[- { ref: main, dest-dir: dev },- { ref: "v0.4.0.dev0", dest-dir: "0.4.0.dev0" },- { ref: "v0.4.0.dev1", dest-dir: "0.4.0.dev1" },- { ref: "v0.4.0.dev2", dest-dir: "0.4.0.dev2" },- { ref: "v0.4.0.dev3", dest-dir: "0.4.0.dev3" },- { ref: "v0.4.0.dev4", dest-dir: "0.4.0.dev4" },- { ref: "v0.4.0.dev5", dest-dir: "0.4.0.dev5" },- { ref: "v0.4.0.dev6", dest-dir: "0.4.0.dev6" },- { ref: "v0.4.0.dev7", dest-dir: "0.4.0.dev7" },- { ref: "v0.4.0.dev8", dest-dir: "0.4.0.dev8" },- { ref: "v0.4.0.dev9", dest-dir: "0.4.0.dev9" },- { ref: "v0.4.0.dev10", dest-dir: "0.4.0.dev10" },- { ref: "v0.4.0.dev11", dest-dir: "0.4.0.dev11" },+ # For main use the workflow target+ { ref: "${{github.ref}}", dest-dir: dev, uv-version: "0.5.13" },+ { ref: "v0.4.0.dev0", dest-dir: "0.4.0.dev0", uv-version: "0.5.11" },+ { ref: "v0.4.0.dev1", dest-dir: "0.4.0.dev1", uv-version: "0.5.11" },+ { ref: "v0.4.0.dev2", dest-dir: "0.4.0.dev2", uv-version: "0.5.11" },+ { ref: "v0.4.0.dev3", dest-dir: "0.4.0.dev3", uv-version: "0.5.11" },+ { ref: "v0.4.0.dev4", dest-dir: "0.4.0.dev4", uv-version: "0.5.11" },+ { ref: "v0.4.0.dev5", dest-dir: "0.4.0.dev5", uv-version: "0.5.11" },+ { ref: "v0.4.0.dev6", dest-dir: "0.4.0.dev6", uv-version: "0.5.11" },+ { ref: "v0.4.0.dev7", dest-dir: "0.4.0.dev7", uv-version: "0.5.11" },+ { ref: "v0.4.0.dev8", dest-dir: "0.4.0.dev8", uv-version: "0.5.11" },+ { ref: "v0.4.0.dev9", dest-dir: "0.4.0.dev9", uv-version: "0.5.11" },+ { ref: "v0.4.0.dev10", dest-dir: "0.4.0.dev10", uv-version: "0.5.11" },+ { ref: "v0.4.0.dev11", dest-dir: "0.4.0.dev11", uv-version: "0.5.11" },]steps:- name: Checkout@@ -54,7 +55,7 @@ jobs:- uses: astral-sh/setup-uv@v5with:enable-cache: true- version: "0.5.11"+ version: ${{ matrix.version.uv-version }}- uses: actions/setup-python@v5with:python-version: "3.11"@@ -103,7 +104,6 @@ jobs:- uses: astral-sh/setup-uv@v5with:enable-cache: true- version: "0.5.11"- uses: actions/setup-python@v5with:python-version: "3.11"diff --git a/.github/workflows/dotnet-build.yml b/.github/workflows/dotnet-build.ymlindex e1fa05095..06a9713df 100644--- a/.github/workflows/dotnet-build.yml+++ b/.github/workflows/dotnet-build.yml@@ -79,7 +79,6 @@ jobs:- uses: astral-sh/setup-uv@v5with:enable-cache: true- version: "0.5.11"- run: uv sync --locked --all-extrasworking-directory: ./python- name: Prepare python venv@@ -104,10 +103,10 @@ jobs:dotnet build --no-restore --configuration Release -bl /p:SignAssembly=true- name: Unit Testrun: dotnet test --no-build -bl --configuration Release --filter type=!integration-+integration-test:strategy:- fail-fast: true+ fail-fast: truematrix:os: [ ubuntu-latest]version: [ net8.0 ]@@ -123,7 +122,6 @@ jobs:- uses: astral-sh/setup-uv@v5with:enable-cache: true- version: "0.5.11"- uses: actions/setup-python@v5with:python-version: "3.11"@@ -208,7 +206,6 @@ jobs:- uses: astral-sh/setup-uv@v5with:enable-cache: true- version: "0.5.11"- uses: actions/setup-python@v5with:python-version: "3.11"@@ -302,4 +299,4 @@ jobs:env:MYGET_TOKEN: ${{ secrets.MYGET_TOKEN }}continue-on-error: true-+diff --git a/.github/workflows/single-python-package.yml b/.github/workflows/single-python-package.ymlindex d8d2c66a1..b4657a5f5 100644--- a/.github/workflows/single-python-package.yml+++ b/.github/workflows/single-python-package.yml@@ -35,7 +35,6 @@ jobs:- uses: astral-sh/setup-uv@v5with:enable-cache: true- version: "0.5.11"- run: uv build --package ${{ github.event.inputs.package }} --out-dir dist/working-directory: python- name: Publish package to PyPIdiff --git a/python/packages/agbench/pyproject.toml b/python/packages/agbench/pyproject.tomlindex 7cdfc89c0..de5f9df22 100644--- a/python/packages/agbench/pyproject.toml+++ b/python/packages/agbench/pyproject.toml@@ -28,8 +28,8 @@ dependencies = ["scipy"]-[tool.uv]-dev-dependencies = [+[dependency-groups]+dev = ["types-tabulate","types-docker"]diff --git a/python/packages/autogen-agentchat/pyproject.toml b/python/packages/autogen-agentchat/pyproject.tomlindex 5f11afc07..0e586ea44 100644--- a/python/packages/autogen-agentchat/pyproject.toml+++ b/python/packages/autogen-agentchat/pyproject.toml@@ -18,10 +18,6 @@ dependencies = ["autogen-core==0.4.0.dev11",]-[tool.uv]-dev-dependencies = []--[tool.ruff]extend = "../../pyproject.toml"include = ["src/**", "tests/*.py"]diff --git a/python/packages/autogen-core/pyproject.toml b/python/packages/autogen-core/pyproject.tomlindex 9602e0f8d..116b2ced8 100644--- a/python/packages/autogen-core/pyproject.toml+++ b/python/packages/autogen-core/pyproject.toml@@ -28,8 +28,9 @@ dependencies = ["jsonref~=1.1.0",]-[tool.uv]-dev-dependencies = [++[dependency-groups]+dev = ["autogen_test_utils","aiofiles","azure-identity",diff --git a/python/packages/autogen-ext/pyproject.toml b/python/packages/autogen-ext/pyproject.tomlindex 0d04e747e..522de50e7 100644--- a/python/packages/autogen-ext/pyproject.toml+++ b/python/packages/autogen-ext/pyproject.toml@@ -56,8 +56,8 @@ grpc = [[tool.hatch.build.targets.wheel]packages = ["src/autogen_ext"]-[tool.uv]-dev-dependencies = [+[dependency-groups]+dev = ["autogen_test_utils"]diff --git a/python/packages/autogen-magentic-one/README.md b/python/packages/autogen-magentic-one/README.mdindex 5b95154e8..8d81ad7ce 100644--- a/python/packages/autogen-magentic-one/README.md+++ b/python/packages/autogen-magentic-one/README.md@@ -35,15 +35,15 @@ Find additional information about Magentic-one in our [blog post](https://aka.msMagentic-One work is based on a multi-agent architecture where a lead Orchestrator agent is responsible for high-level planning, directing other agents and tracking task progress. The Orchestrator begins by creating a plan to tackle the task, gathering needed facts and educated guesses in a Task Ledger that is maintained. At each step of its plan, the Orchestrator creates a Progress Ledger where it self-reflects on task progress and checks whether the task is completed. If the task is not yet completed, it assigns one of Magentic-One other agents a subtask to complete. After the assigned agent completes its subtask, the Orchestrator updates the Progress Ledger and continues in this way until the task is complete. If the Orchestrator finds that progress is not being made for enough steps, it can update the Task Ledger and create a new plan. This is illustrated in the figure above; the Orchestrator work is thus divided into an outer loop where it updates the Task Ledger and an inner loop to update the Progress Ledger.Overall, Magentic-One consists of the following agents:-- Orchestrator: the lead agent responsible for task decomposition and planning, directing other agents in executing subtasks, tracking overall progress, and taking corrective actions as needed+- Orchestrator: the lead agent responsible for task decomposition and planning, directing other agents in executing subtasks, tracking overall progress, and taking corrective actions as needed- WebSurfer: This is an LLM-based agent that is proficient in commanding and managing the state of a Chromium-based web browser. With each incoming request, the WebSurfer performs an action on the browser then reports on the new state of the web page The action space of the WebSurfer includes navigation (e.g. visiting a URL, performing a web search); web page actions (e.g., clicking and typing); and reading actions (e.g., summarizing or answering questions). The WebSurfer relies on the accessibility tree of the browser and on set-of-marks prompting to perform its actions.- FileSurfer: This is an LLM-based agent that commands a markdown-based file preview application to read local files of most types. The FileSurfer can also perform common navigation tasks such as listing the contents of directories and navigating a folder structure.- Coder: This is an LLM-based agent specialized through its system prompt for writing code, analyzing information collected from the other agents, or creating new artifacts.- ComputerTerminal: Finally, ComputerTerminal provides the team with access to a console shell where the Coder’s programs can be executed, and where new programming libraries can be installed.-Together, Magentic-One’s agents provide the Orchestrator with the tools and capabilities that it needs to solve a broad variety of open-ended problems, as well as the ability to autonomously adapt to, and act in, dynamic and ever-changing web and file-system environments.+Together, Magentic-One’s agents provide the Orchestrator with the tools and capabilities that it needs to solve a broad variety of open-ended problems, as well as the ability to autonomously adapt to, and act in, dynamic and ever-changing web and file-system environments.-While the default multimodal LLM we use for all agents is GPT-4o, Magentic-One is model agnostic and can incorporate heterogonous models to support different capabilities or meet different cost requirements when getting tasks done. For example, it can use different LLMs and SLMs and their specialized versions to power different agents. We recommend a strong reasoning model for the Orchestrator agent such as GPT-4o. In a different configuration of Magentic-One, we also experiment with using OpenAI o1-preview for the outer loop of the Orchestrator and for the Coder, while other agents continue to use GPT-4o.+While the default multimodal LLM we use for all agents is GPT-4o, Magentic-One is model agnostic and can incorporate heterogonous models to support different capabilities or meet different cost requirements when getting tasks done. For example, it can use different LLMs and SLMs and their specialized versions to power different agents. We recommend a strong reasoning model for the Orchestrator agent such as GPT-4o. In a different configuration of Magentic-One, we also experiment with using OpenAI o1-preview for the outer loop of the Orchestrator and for the Coder, while other agents continue to use GPT-4o.### Logging in Team One Agents@@ -71,13 +71,13 @@ You can install the Magentic-One package and then run the example code to see hosource .venv/bin/activate```For Windows, run `.venv\Scripts\activate` to activate the environment.-+2. Install magentic-one from source:```bashcd packages/autogen-magentic-onepip install -e .```-+The following instructions are for running the example code:3. Configure the environment variables for the chat completion client. See instructions below [Environment Configuration for Chat Completion Client](#environment-configuration-for-chat-completion-client).@@ -89,11 +89,11 @@ playwright install --with-deps chromium```6. Now you can run the example code to see how the agents work together to accomplish a task.-> [!CAUTION]-> The example code may download files from the internet, execute code, and interact with web pages. Ensure you are in a safe environment before running the example code.+> [!CAUTION]+> The example code may download files from the internet, execute code, and interact with web pages. Ensure you are in a safe environment before running the example code.> [!NOTE]-> You will need to ensure Docker is running prior to running the example.+> You will need to ensure Docker is running prior to running the example.```bash@@ -113,7 +113,7 @@ playwright install --with-deps chromium- hil_mode: (Optional) Enable human-in-the-loop mode (default: disabled)- save_screenshots: (Optional) Save screenshots of browser (default: disabled)-7. [Preview] We have a preview API for Magentic-One.+7. [Preview] We have a preview API for Magentic-One.You can use the `MagenticOneHelper` class to interact with the system and stream logs. See the [interface README](interface/README.md) for more details.@@ -146,7 +146,7 @@ To configure for Azure OpenAI service, set the following environment variables:This project uses Azure OpenAI service with [Entra ID authentcation by default](https://learn.microsoft.com/azure/ai-services/openai/how-to/managed-identity). If you run the examples on a local device, you can use the Azure CLI cached credentials for testing:-Log in to Azure using `az login`, and then run the examples. The account used must have [RBAC permissions](https://learn.microsoft.com/azure/ai-services/openai/how-to/role-based-access-control) like `Azure Cognitive Services OpenAI User` for the OpenAI service; otherwise, you will receive the error: Principal does not have access to API/Operation.+Log in to Azure using `az login`, and then run the examples. The account used must have [RBAC permissions](https://learn.microsoft.com/azure/ai-services/openai/how-to/role-based-access-control) like `Azure Cognitive Services OpenAI User` for the OpenAI service; otherwise, you will receive the error: Principal does not have access to API/Operation.Note that even if you are the owner of the subscription, you still need to grant the necessary Azure Cognitive Services OpenAI permissions to call the API.@@ -178,12 +178,12 @@ export BING_API_KEY=xxxxxxx```@misc{fourney2024magenticonegeneralistmultiagentsolving,- title={Magentic-One: A Generalist Multi-Agent System for Solving Complex Tasks},+ title={Magentic-One: A Generalist Multi-Agent System for Solving Complex Tasks},author={Adam Fourney and Gagan Bansal and Hussein Mozannar and Cheng Tan and Eduardo Salinas and Erkang and Zhu and Friederike Niedtner and Grace Proebsting and Griffin Bassman and Jack Gerrits and Jacob Alber and Peter Chang and Ricky Loynd and Robert West and Victor Dibia and Ahmed Awadallah and Ece Kamar and Rafah Hosn and Saleema Amershi},year={2024},eprint={2411.04468},archivePrefix={arXiv},primaryClass={cs.AI},- url={https://arxiv.org/abs/2411.04468},+ url={https://arxiv.org/abs/2411.04468},}```diff --git a/python/packages/autogen-magentic-one/pyproject.toml b/python/packages/autogen-magentic-one/pyproject.tomlindex 65e71dd84..df1b0f2d1 100644--- a/python/packages/autogen-magentic-one/pyproject.toml+++ b/python/packages/autogen-magentic-one/pyproject.toml@@ -38,8 +38,8 @@ dependencies = ["pydantic<3.0.0,>=2.0.0",]-[tool.uv]-dev-dependencies = [+[dependency-groups]+dev = ["aiofiles","types-aiofiles","types-requests",diff --git a/python/packages/autogen-test-utils/pyproject.toml b/python/packages/autogen-test-utils/pyproject.tomlindex 6e2f2de52..22b0ba073 100644--- a/python/packages/autogen-test-utils/pyproject.toml+++ b/python/packages/autogen-test-utils/pyproject.toml@@ -11,10 +11,6 @@ dependencies = ["autogen-core",]-[tool.uv]-dev-dependencies = []--[tool.ruff]extend = "../../pyproject.toml"include = ["src/**"]diff --git a/python/packages/component-schema-gen/pyproject.toml b/python/packages/component-schema-gen/pyproject.tomlindex 8a45d6e54..272142601 100644--- a/python/packages/component-schema-gen/pyproject.toml+++ b/python/packages/component-schema-gen/pyproject.toml@@ -22,10 +22,6 @@ dependencies = [[project.scripts]gen-component-schema = "component_schema_gen.__main__:main"-[tool.uv]-dev-dependencies = []--[tool.ruff]extend = "../../pyproject.toml"include = ["src/**"]diff --git a/python/pyproject.toml b/python/pyproject.tomlindex 5829a09ab..ba5f987a4 100644--- a/python/pyproject.toml+++ b/python/pyproject.toml@@ -1,8 +1,5 @@-[tool.uv.workspace]-members = ["packages/*"]--[tool.uv]-dev-dependencies = [+[dependency-groups]+dev = ["pyright==1.1.389","mypy==1.13.0","ruff==0.4.8",@@ -20,13 +17,21 @@ dev-dependencies = ["cookiecutter","poethepoet","tomli",+ "tomli-w"]+[tool.uv.workspace]+members = ["packages/*"]+[tool.uv.sources]+agbench = { workspace = true }+autogen-agentchat = { workspace = true }autogen-core = { workspace = true }autogen-ext = { workspace = true }-autogen-agentchat = { workspace = true }+autogen-magentic-one = { workspace = true }+autogenstudio = { workspace = true }autogen-test-utils = { workspace = true }+component-schema-gen = { workspace = true }[tool.ruff]line-length = 120diff --git a/python/templates/new-package/hooks/post_gen_project.py b/python/templates/new-package/hooks/post_gen_project.pyindex 491d1284c..6fc5d446f 100644--- a/python/templates/new-package/hooks/post_gen_project.py+++ b/python/templates/new-package/hooks/post_gen_project.py@@ -1,7 +1,24 @@import osimport shutil+from pathlib import Path+import tomli_w+import tomllibsource_dir = os.getcwd()target_dir = "{{ cookiecutter.__final_destination }}"shutil.move(source_dir, target_dir)++THIS_FILE_DIR = Path(__file__).parent++# Add the package to the workspace def++workspace_def_path = THIS_FILE_DIR / ".." / ".." / ".." / "pyproject.toml"++with workspace_def_path.open("rb") as f:+ config = tomllib.load(f)++config["tool"]["uv"]["sources"]["{{ cookiecutter.package_name }}"] = {"workspace": True}++with workspace_def_path.open("wb") as f:+ tomli_w.dump(config, f)diff --git a/python/templates/new-package/hooks/pre_gen_project.py b/python/templates/new-package/hooks/pre_gen_project.pyindex 3e1b246e6..1a85fb859 100644--- a/python/templates/new-package/hooks/pre_gen_project.py+++ b/python/templates/new-package/hooks/pre_gen_project.py@@ -2,16 +2,16 @@ import reimport sysfrom packaging import version-MODULE_REGEX = r'^[a-zA-Z][\-a-zA-Z0-9]+$'+MODULE_REGEX = r"^[a-zA-Z][\-a-zA-Z0-9]+$"-package_name = '{{ cookiecutter.package_name }}'+package_name = "{{ cookiecutter.package_name }}"at_least_one_error = Falseif not re.match(MODULE_REGEX, package_name):print(f'ERROR: "{package_name}" must use kebab case')at_least_one_error = True-packaging_version = '{{ cookiecutter.version }}'+packaging_version = "{{ cookiecutter.version }}"# Check version format using version.VERSION_PATTERNif not re.match(version.VERSION_PATTERN, packaging_version, re.VERBOSE | re.IGNORECASE):diff --git a/python/templates/new-package/{{cookiecutter.package_name}}/pyproject.toml b/python/templates/new-package/{{cookiecutter.package_name}}/pyproject.tomlindex 4a62c5854..a313e6c28 100644--- a/python/templates/new-package/{{cookiecutter.package_name}}/pyproject.toml+++ b/python/templates/new-package/{{cookiecutter.package_name}}/pyproject.toml@@ -20,8 +20,8 @@ dependencies = [{% endif %}]-[tool.uv]-dev-dependencies = []+[dependency-groups]+dev = [][tool.ruff]diff --git a/python/uv.lock b/python/uv.lockindex afb0c2326..151634a4f 100644--- a/python/uv.lock+++ b/python/uv.lock@@ -27,7 +27,9 @@ members = ["autogenstudio","component-schema-gen",]-requirements = [++[manifest.dependency-groups]+dev = [{ name = "cookiecutter" },{ name = "grpcio-tools", specifier = "~=1.62.0" },{ name = "mypy", specifier = "==1.13.0" },@@ -43,6 +45,7 @@ requirements = [{ name = "rich" },{ name = "ruff", specifier = "==0.4.8" },{ name = "tomli" },+ { name = "tomli-w" },{ name = "typer" },]@@ -341,9 +344,6 @@ dependencies = [[package.metadata]requires-dist = [{ name = "autogen-core", editable = "packages/autogen-core" }]-[package.metadata.requires-dev]-dev = []-[[package]]name = "autogen-core"version = "0.4.0.dev11"@@ -628,9 +628,6 @@ dependencies = [[package.metadata]requires-dist = [{ name = "autogen-core", editable = "packages/autogen-core" }]-[package.metadata.requires-dev]-dev = []-[[package]]name = "autogenstudio"version = "0.4.0.dev41"@@ -957,9 +954,6 @@ requires-dist = [{ name = "autogen-ext", editable = "packages/autogen-ext" },]-[package.metadata.requires-dev]-dev = []-[[package]]name = "cookiecutter"version = "2.6.0"@@ -4658,6 +4652,15 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/cf/db/ce8eda256fa131af12e0a76d481711abe4681b6923c27efb9a255c9e4594/tomli-2.0.2-py3-none-any.whl", hash = "sha256:2ebe24485c53d303f690b0ec092806a085f07af5a5aa1464f3931eec36caaa38", size = 13237 },]+[[package]]+name = "tomli-w"+version = "1.1.0"+source = { registry = "https://pypi.org/simple" }+sdist = { url = "https://files.pythonhosted.org/packages/d4/19/b65f1a088ee23e37cdea415b357843eca8b1422a7b11a9eee6e35d4ec273/tomli_w-1.1.0.tar.gz", hash = "sha256:49e847a3a304d516a169a601184932ef0f6b61623fe680f836a2aa7128ed0d33", size = 6929 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/c4/ac/ce90573ba446a9bbe65838ded066a805234d159b4446ae9f8ec5bbd36cbd/tomli_w-1.1.0-py3-none-any.whl", hash = "sha256:1403179c78193e3184bfaade390ddbd071cba48a32a2e62ba11aae47490c63f7", size = 6440 },+]+[[package]]name = "torch"version = "2.5.1"