Skip to content

A programming framework for agentic AI

Python: organize packages in package directory (#420)

Jack Gerrits5e8840d13c40
diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml
index 0ec8ed4fa..c98d6de58 100644
--- a/.github/workflows/checks.yml
+++ b/.github/workflows/checks.yml
@@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
working-directory:
- ["./python", "./python/teams/team-one", "./python/tools/agbench"]
+ ["./python/packages/autogen-core", "./python/packages/team-one", "./python/packages/agbench"]
steps:
- uses: actions/checkout@v4
- name: Install Hatch
@@ -27,7 +27,7 @@ jobs:
strategy:
matrix:
working-directory:
- ["./python", "./python/teams/team-one", "./python/tools/agbench"]
+ ["./python/packages/autogen-core", "./python/packages/team-one", "./python/packages/agbench"]
steps:
- uses: actions/checkout@v4
- name: Install Hatch
@@ -40,7 +40,7 @@ jobs:
strategy:
matrix:
working-directory:
- ["./python", "./python/teams/team-one", "./python/tools/agbench"]
+ ["./python/packages/autogen-core", "./python/packages/team-one", "./python/packages/agbench"]
steps:
- uses: actions/checkout@v4
- name: Install Hatch
@@ -53,7 +53,7 @@ jobs:
strategy:
matrix:
working-directory:
- ["./python", "./python/teams/team-one", "./python/tools/agbench"]
+ ["./python/packages/autogen-core", "./python/packages/team-one", "./python/packages/agbench"]
steps:
- uses: actions/checkout@v4
- name: Install Hatch
@@ -71,7 +71,7 @@ jobs:
- name: Install Hatch
uses: pypa/hatch@install
- run: hatch run +python=${{ matrix.python-version }} test-matrix:pytest -n auto
- working-directory: ./python
+ working-directory: ./python/packages/autogen-core
team-one-test:
runs-on: ubuntu-latest
@@ -85,7 +85,7 @@ jobs:
- run: |
hatch run +python=${{ matrix.python-version }} teamone-test-matrix:playwright install
hatch run +python=${{ matrix.python-version }} teamone-test-matrix:pytest -n auto
- working-directory: ./python/teams/team-one
+ working-directory: ./python/packages/team-one
mypy-notebooks:
runs-on: ubuntu-latest
@@ -94,7 +94,7 @@ jobs:
- name: Install Hatch
uses: pypa/hatch@install
- run: hatch run nbqa mypy docs/src
- working-directory: ./python
+ working-directory: ./python/packages/autogen-core
docs:
runs-on: ubuntu-latest
@@ -103,4 +103,4 @@ jobs:
- name: Install Hatch
uses: pypa/hatch@install
- run: hatch run docs:check
- working-directory: ./python
+ working-directory: ./python/packages/autogen-core
diff --git a/python/README.md b/python/README.md
index 5a2125b4e..47aee22ff 100644
--- a/python/README.md
+++ b/python/README.md
@@ -1,61 +1,3 @@
-# AGNext
+# AutoGen Python packages
-- [Documentation](http://microsoft.github.io/agnext)
-- [Examples](https://github.com/microsoft/agnext/tree/main/python/samples)
-
-## Package layering
-
-- `core` are the the foundational generic interfaces upon which all else is built. This module must not depend on any other module.
-- `application` are implementations of core components that are used to compose an application.
-- `components` are the building blocks for creating agents.
-
-## Development
-
-**TL;DR**, run all checks with:
-
-```sh
-hatch run check
-```
-
-### Setup
-
-- [Install `hatch`](https://hatch.pypa.io/1.12/install/).
-
-### Virtual environment
-
-To get a shell with the package available (virtual environment),
-in the current directory,
-run:
-
-```sh
-hatch shell
-```
-
-### Common tasks
-
-- Format: `hatch run check`
-- Lint: `hatch run lint`
-- Test: `hatch run pytest -n auto`
-- Mypy: `hatch run mypy`
-- Pyright: `hatch run pyright`
-- Build docs: `hatch run docs:build`
-- Auto rebuild+serve docs: `hatch run docs:serve`
-
-> [!NOTE]
-> These don't need to be run in a virtual environment, `hatch` will automatically manage it for you.
-
-
-#### IntelliJ Support
-To enable the `hatch` virtual environment in IntelliJ, follow these steps:
-Under the `[tool.hatch.envs.default]` heading in `pyproject.toml`, add this:
-
-```toml
-[tool.hatch.envs.default]
-type = "virtual"
-path = ".venv"
-```
-Run `hatch shell` in the terminal to create the virtual environment.
-
-Then, in IntelliJ, go to `File` -> `Project Structure` -> `Project Settings` -> `Project` -> `Project SDK` and select the Python interpreter in the `.venv` directory.
-
-Once complete, your IDE should be able to resolve, run, and debug code.
+See [`autogen-core`](./packages/autogen-core/) package for main functionality.
diff --git a/python/tools/agbench/.gitignore b/python/packages/agbench/.gitignore
similarity index 100%
rename from python/tools/agbench/.gitignore
rename to python/packages/agbench/.gitignore
diff --git a/python/tools/agbench/CONTRIBUTING.md b/python/packages/agbench/CONTRIBUTING.md
similarity index 100%
rename from python/tools/agbench/CONTRIBUTING.md
rename to python/packages/agbench/CONTRIBUTING.md
diff --git a/python/tools/agbench/MANIFEST.in b/python/packages/agbench/MANIFEST.in
similarity index 100%
rename from python/tools/agbench/MANIFEST.in
rename to python/packages/agbench/MANIFEST.in
diff --git a/python/tools/agbench/README.md b/python/packages/agbench/README.md
similarity index 100%
rename from python/tools/agbench/README.md
rename to python/packages/agbench/README.md
diff --git a/python/tools/agbench/pyproject.toml b/python/packages/agbench/pyproject.toml
similarity index 100%
rename from python/tools/agbench/pyproject.toml
rename to python/packages/agbench/pyproject.toml
diff --git a/python/tools/agbench/setup.py b/python/packages/agbench/setup.py
similarity index 100%
rename from python/tools/agbench/setup.py
rename to python/packages/agbench/setup.py
diff --git a/python/tools/agbench/src/agbench/__init__.py b/python/packages/agbench/src/agbench/__init__.py
similarity index 100%
rename from python/tools/agbench/src/agbench/__init__.py
rename to python/packages/agbench/src/agbench/__init__.py
diff --git a/python/tools/agbench/src/agbench/__main__.py b/python/packages/agbench/src/agbench/__main__.py
similarity index 100%
rename from python/tools/agbench/src/agbench/__main__.py
rename to python/packages/agbench/src/agbench/__main__.py
diff --git a/python/tools/agbench/src/agbench/cli.py b/python/packages/agbench/src/agbench/cli.py
similarity index 100%
rename from python/tools/agbench/src/agbench/cli.py
rename to python/packages/agbench/src/agbench/cli.py
diff --git a/python/tools/agbench/src/agbench/load_module.py b/python/packages/agbench/src/agbench/load_module.py
similarity index 100%
rename from python/tools/agbench/src/agbench/load_module.py
rename to python/packages/agbench/src/agbench/load_module.py
diff --git a/python/tools/agbench/src/agbench/res/Dockerfile b/python/packages/agbench/src/agbench/res/Dockerfile
similarity index 100%
rename from python/tools/agbench/src/agbench/res/Dockerfile
rename to python/packages/agbench/src/agbench/res/Dockerfile
diff --git a/python/tools/agbench/src/agbench/run_cmd.py b/python/packages/agbench/src/agbench/run_cmd.py
similarity index 100%
rename from python/tools/agbench/src/agbench/run_cmd.py
rename to python/packages/agbench/src/agbench/run_cmd.py
diff --git a/python/tools/agbench/src/agbench/tabulate_cmd.py b/python/packages/agbench/src/agbench/tabulate_cmd.py
similarity index 100%
rename from python/tools/agbench/src/agbench/tabulate_cmd.py
rename to python/packages/agbench/src/agbench/tabulate_cmd.py
diff --git a/python/tools/agbench/src/agbench/template/global_finalize.sh b/python/packages/agbench/src/agbench/template/global_finalize.sh
similarity index 100%
rename from python/tools/agbench/src/agbench/template/global_finalize.sh
rename to python/packages/agbench/src/agbench/template/global_finalize.sh
diff --git a/python/tools/agbench/src/agbench/template/global_init.sh b/python/packages/agbench/src/agbench/template/global_init.sh
similarity index 100%
rename from python/tools/agbench/src/agbench/template/global_init.sh
rename to python/packages/agbench/src/agbench/template/global_init.sh
diff --git a/python/tools/agbench/src/agbench/template/requirements.txt b/python/packages/agbench/src/agbench/template/requirements.txt
similarity index 100%
rename from python/tools/agbench/src/agbench/template/requirements.txt
rename to python/packages/agbench/src/agbench/template/requirements.txt
diff --git a/python/tools/agbench/src/agbench/version.py b/python/packages/agbench/src/agbench/version.py
similarity index 100%
rename from python/tools/agbench/src/agbench/version.py
rename to python/packages/agbench/src/agbench/version.py
diff --git a/python/packages/autogen-core/.gitignore b/python/packages/autogen-core/.gitignore
new file mode 100644
index 000000000..186e847cc
--- /dev/null
+++ b/python/packages/autogen-core/.gitignore
@@ -0,0 +1,174 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+*.py,cover
+.hypothesis/
+.pytest_cache/
+cover/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+db.sqlite3-journal
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+.pybuilder/
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+# For a library or package, you might want to ignore these files since the code is
+# intended to run in multiple environments; otherwise, check them in:
+# .python-version
+
+# pipenv
+# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+# However, in case of collaboration, if having platform-specific dependencies or dependencies
+# having no cross-platform support, pipenv may install dependencies that don't work, or not
+# install all needed dependencies.
+#Pipfile.lock
+
+# poetry
+# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
+# This is especially recommended for binary packages to ensure reproducibility, and is more
+# commonly ignored for libraries.
+# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
+#poetry.lock
+
+# pdm
+# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
+#pdm.lock
+# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
+# in version control.
+# https://pdm.fming.dev/#use-with-ide
+.pdm.toml
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
+__pypackages__/
+
+# Celery stuff
+celerybeat-schedule
+celerybeat.pid
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+# pytype static type analyzer
+.pytype/
+
+# Cython debug symbols
+cython_debug/
+
+# PyCharm
+# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
+# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
+# and can be added to the global gitignore or merged into this file. For a more nuclear
+# option (not recommended) you can uncomment the following to ignore the entire idea folder.
+#.idea/
+
+.ruff_cache/
+
+/docs/src/reference
+.DS_Store
+
+# Generated log files
+log.jsonl
+
+# Jupyter notebooks executions in docs.
+docs/**/jupyter_execute
+
+# Temporary files
+tmp_code_*.py
diff --git a/python/packages/autogen-core/README.md b/python/packages/autogen-core/README.md
new file mode 100644
index 000000000..8c6d9f9a4
--- /dev/null
+++ b/python/packages/autogen-core/README.md
@@ -0,0 +1,61 @@
+# AutoGen Core
+
+- [Documentation](http://microsoft.github.io/agnext)
+- [Examples](https://github.com/microsoft/agnext/tree/main/python/samples)
+
+## Package layering
+
+- `base` are the the foundational generic interfaces upon which all else is built. This module must not depend on any other module.
+- `application` are implementations of core components that are used to compose an application.
+- `components` are the building blocks for creating agents.
+
+## Development
+
+**TL;DR**, run all checks with:
+
+```sh
+hatch run check
+```
+
+### Setup
+
+- [Install `hatch`](https://hatch.pypa.io/1.12/install/).
+
+### Virtual environment
+
+To get a shell with the package available (virtual environment),
+in the current directory,
+run:
+
+```sh
+hatch shell
+```
+
+### Common tasks
+
+- Format: `hatch run check`
+- Lint: `hatch run lint`
+- Test: `hatch run pytest -n auto`
+- Mypy: `hatch run mypy`
+- Pyright: `hatch run pyright`
+- Build docs: `hatch run docs:build`
+- Auto rebuild+serve docs: `hatch run docs:serve`
+
+> [!NOTE]
+> These don't need to be run in a virtual environment, `hatch` will automatically manage it for you.
+
+
+#### IntelliJ Support
+To enable the `hatch` virtual environment in IntelliJ, follow these steps:
+Under the `[tool.hatch.envs.default]` heading in `pyproject.toml`, add this:
+
+```toml
+[tool.hatch.envs.default]
+type = "virtual"
+path = ".venv"
+```
+Run `hatch shell` in the terminal to create the virtual environment.
+
+Then, in IntelliJ, go to `File` -> `Project Structure` -> `Project Settings` -> `Project` -> `Project SDK` and select the Python interpreter in the `.venv` directory.
+
+Once complete, your IDE should be able to resolve, run, and debug code.
diff --git a/python/docs/drawio/agnext-application-stack.drawio b/python/packages/autogen-core/docs/drawio/agnext-application-stack.drawio
similarity index 100%
rename from python/docs/drawio/agnext-application-stack.drawio
rename to python/packages/autogen-core/docs/drawio/agnext-application-stack.drawio
diff --git a/python/docs/drawio/agnext-architecture.drawio b/python/packages/autogen-core/docs/drawio/agnext-architecture.drawio
similarity index 100%
rename from python/docs/drawio/agnext-architecture.drawio
rename to python/packages/autogen-core/docs/drawio/agnext-architecture.drawio
diff --git a/python/docs/drawio/agnext-code-gen-example.drawio b/python/packages/autogen-core/docs/drawio/agnext-code-gen-example.drawio
similarity index 100%
rename from python/docs/drawio/agnext-code-gen-example.drawio
rename to python/packages/autogen-core/docs/drawio/agnext-code-gen-example.drawio
diff --git a/python/docs/drawio/agnext-layers.drawio b/python/packages/autogen-core/docs/drawio/agnext-layers.drawio
similarity index 100%
rename from python/docs/drawio/agnext-layers.drawio
rename to python/packages/autogen-core/docs/drawio/agnext-layers.drawio
diff --git a/python/docs/drawio/coder-reviewer.drawio b/python/packages/autogen-core/docs/drawio/coder-reviewer.drawio
similarity index 100%
rename from python/docs/drawio/coder-reviewer.drawio
rename to python/packages/autogen-core/docs/drawio/coder-reviewer.drawio
diff --git a/python/docs/drawio/tool-use-agent-cfg.drawio b/python/packages/autogen-core/docs/drawio/tool-use-agent-cfg.drawio
similarity index 100%
rename from python/docs/drawio/tool-use-agent-cfg.drawio
rename to python/packages/autogen-core/docs/drawio/tool-use-agent-cfg.drawio
diff --git a/python/docs/src/_apidoc_templates/module.rst.jinja b/python/packages/autogen-core/docs/src/_apidoc_templates/module.rst.jinja
similarity index 100%
rename from python/docs/src/_apidoc_templates/module.rst.jinja
rename to python/packages/autogen-core/docs/src/_apidoc_templates/module.rst.jinja
diff --git a/python/docs/src/_apidoc_templates/package.rst.jinja b/python/packages/autogen-core/docs/src/_apidoc_templates/package.rst.jinja
similarity index 100%
rename from python/docs/src/_apidoc_templates/package.rst.jinja
rename to python/packages/autogen-core/docs/src/_apidoc_templates/package.rst.jinja
diff --git a/python/docs/src/conf.py b/python/packages/autogen-core/docs/src/conf.py
similarity index 100%
rename from python/docs/src/conf.py
rename to python/packages/autogen-core/docs/src/conf.py
diff --git a/python/docs/src/contributing.md b/python/packages/autogen-core/docs/src/contributing.md
similarity index 100%
rename from python/docs/src/contributing.md
rename to python/packages/autogen-core/docs/src/contributing.md
diff --git a/python/docs/src/cookbook/azure-openai-with-aad-auth.md b/python/packages/autogen-core/docs/src/cookbook/azure-openai-with-aad-auth.md
similarity index 100%
rename from python/docs/src/cookbook/azure-openai-with-aad-auth.md
rename to python/packages/autogen-core/docs/src/cookbook/azure-openai-with-aad-auth.md
diff --git a/python/docs/src/cookbook/buffered-memory.md b/python/packages/autogen-core/docs/src/cookbook/buffered-memory.md
similarity index 100%
rename from python/docs/src/cookbook/buffered-memory.md
rename to python/packages/autogen-core/docs/src/cookbook/buffered-memory.md
diff --git a/python/docs/src/cookbook/extracting-results-with-an-agent.md b/python/packages/autogen-core/docs/src/cookbook/extracting-results-with-an-agent.md
similarity index 100%
rename from python/docs/src/cookbook/extracting-results-with-an-agent.md
rename to python/packages/autogen-core/docs/src/cookbook/extracting-results-with-an-agent.md
diff --git a/python/docs/src/cookbook/langgraph-agent.ipynb b/python/packages/autogen-core/docs/src/cookbook/langgraph-agent.ipynb
similarity index 100%
rename from python/docs/src/cookbook/langgraph-agent.ipynb
rename to python/packages/autogen-core/docs/src/cookbook/langgraph-agent.ipynb
diff --git a/python/docs/src/cookbook/llamaindex-agent.ipynb b/python/packages/autogen-core/docs/src/cookbook/llamaindex-agent.ipynb
similarity index 100%
rename from python/docs/src/cookbook/llamaindex-agent.ipynb
rename to python/packages/autogen-core/docs/src/cookbook/llamaindex-agent.ipynb
diff --git a/python/docs/src/cookbook/openai-assistant-agent.ipynb b/python/packages/autogen-core/docs/src/cookbook/openai-assistant-agent.ipynb
similarity index 100%
rename from python/docs/src/cookbook/openai-assistant-agent.ipynb
rename to python/packages/autogen-core/docs/src/cookbook/openai-assistant-agent.ipynb
diff --git a/python/docs/src/cookbook/termination-with-intervention.md b/python/packages/autogen-core/docs/src/cookbook/termination-with-intervention.md
similarity index 100%
rename from python/docs/src/cookbook/termination-with-intervention.md
rename to python/packages/autogen-core/docs/src/cookbook/termination-with-intervention.md
diff --git a/python/docs/src/cookbook/type-routed-agent.md b/python/packages/autogen-core/docs/src/cookbook/type-routed-agent.md
similarity index 100%
rename from python/docs/src/cookbook/type-routed-agent.md
rename to python/packages/autogen-core/docs/src/cookbook/type-routed-agent.md
diff --git a/python/docs/src/core-concepts/agent-and-multi-agent-application.md b/python/packages/autogen-core/docs/src/core-concepts/agent-and-multi-agent-application.md
similarity index 100%
rename from python/docs/src/core-concepts/agent-and-multi-agent-application.md
rename to python/packages/autogen-core/docs/src/core-concepts/agent-and-multi-agent-application.md
diff --git a/python/docs/src/core-concepts/agent-identity-and-lifecycle.md b/python/packages/autogen-core/docs/src/core-concepts/agent-identity-and-lifecycle.md
similarity index 100%
rename from python/docs/src/core-concepts/agent-identity-and-lifecycle.md
rename to python/packages/autogen-core/docs/src/core-concepts/agent-identity-and-lifecycle.md
diff --git a/python/docs/src/core-concepts/agnext-application-stack.svg b/python/packages/autogen-core/docs/src/core-concepts/agnext-application-stack.svg
similarity index 100%
rename from python/docs/src/core-concepts/agnext-application-stack.svg
rename to python/packages/autogen-core/docs/src/core-concepts/agnext-application-stack.svg
diff --git a/python/docs/src/core-concepts/agnext-architecture.svg b/python/packages/autogen-core/docs/src/core-concepts/agnext-architecture.svg
similarity index 100%
rename from python/docs/src/core-concepts/agnext-architecture.svg
rename to python/packages/autogen-core/docs/src/core-concepts/agnext-architecture.svg
diff --git a/python/docs/src/core-concepts/agnext-code-gen-example.svg b/python/packages/autogen-core/docs/src/core-concepts/agnext-code-gen-example.svg
similarity index 100%
rename from python/docs/src/core-concepts/agnext-code-gen-example.svg
rename to python/packages/autogen-core/docs/src/core-concepts/agnext-code-gen-example.svg
diff --git a/python/docs/src/core-concepts/agnext-layers.svg b/python/packages/autogen-core/docs/src/core-concepts/agnext-layers.svg
similarity index 100%
rename from python/docs/src/core-concepts/agnext-layers.svg
rename to python/packages/autogen-core/docs/src/core-concepts/agnext-layers.svg
diff --git a/python/docs/src/core-concepts/application-stack.md b/python/packages/autogen-core/docs/src/core-concepts/application-stack.md
similarity index 100%
rename from python/docs/src/core-concepts/application-stack.md
rename to python/packages/autogen-core/docs/src/core-concepts/application-stack.md
diff --git a/python/docs/src/core-concepts/architecture.md b/python/packages/autogen-core/docs/src/core-concepts/architecture.md
similarity index 100%
rename from python/docs/src/core-concepts/architecture.md
rename to python/packages/autogen-core/docs/src/core-concepts/architecture.md
diff --git a/python/docs/src/core-concepts/topic-and-subscription.md b/python/packages/autogen-core/docs/src/core-concepts/topic-and-subscription.md
similarity index 100%
rename from python/docs/src/core-concepts/topic-and-subscription.md
rename to python/packages/autogen-core/docs/src/core-concepts/topic-and-subscription.md
diff --git a/python/docs/src/getting-started/agent-and-agent-runtime.ipynb b/python/packages/autogen-core/docs/src/getting-started/agent-and-agent-runtime.ipynb
similarity index 100%
rename from python/docs/src/getting-started/agent-and-agent-runtime.ipynb
rename to python/packages/autogen-core/docs/src/getting-started/agent-and-agent-runtime.ipynb
diff --git a/python/docs/src/getting-started/coder-reviewer-data-flow.svg b/python/packages/autogen-core/docs/src/getting-started/coder-reviewer-data-flow.svg
similarity index 100%
rename from python/docs/src/getting-started/coder-reviewer-data-flow.svg
rename to python/packages/autogen-core/docs/src/getting-started/coder-reviewer-data-flow.svg
diff --git a/python/docs/src/getting-started/group-chat.ipynb b/python/packages/autogen-core/docs/src/getting-started/group-chat.ipynb
similarity index 100%
rename from python/docs/src/getting-started/group-chat.ipynb
rename to python/packages/autogen-core/docs/src/getting-started/group-chat.ipynb
diff --git a/python/docs/src/getting-started/installation.md b/python/packages/autogen-core/docs/src/getting-started/installation.md
similarity index 100%
rename from python/docs/src/getting-started/installation.md
rename to python/packages/autogen-core/docs/src/getting-started/installation.md
diff --git a/python/docs/src/getting-started/message-and-communication.ipynb b/python/packages/autogen-core/docs/src/getting-started/message-and-communication.ipynb
similarity index 100%
rename from python/docs/src/getting-started/message-and-communication.ipynb
rename to python/packages/autogen-core/docs/src/getting-started/message-and-communication.ipynb
diff --git a/python/docs/src/getting-started/model-clients.ipynb b/python/packages/autogen-core/docs/src/getting-started/model-clients.ipynb
similarity index 100%
rename from python/docs/src/getting-started/model-clients.ipynb
rename to python/packages/autogen-core/docs/src/getting-started/model-clients.ipynb
diff --git a/python/docs/src/getting-started/multi-agent-design-patterns.md b/python/packages/autogen-core/docs/src/getting-started/multi-agent-design-patterns.md
similarity index 100%
rename from python/docs/src/getting-started/multi-agent-design-patterns.md
rename to python/packages/autogen-core/docs/src/getting-started/multi-agent-design-patterns.md
diff --git a/python/docs/src/getting-started/quickstart.ipynb b/python/packages/autogen-core/docs/src/getting-started/quickstart.ipynb
similarity index 100%
rename from python/docs/src/getting-started/quickstart.ipynb
rename to python/packages/autogen-core/docs/src/getting-started/quickstart.ipynb
diff --git a/python/docs/src/getting-started/reflection.ipynb b/python/packages/autogen-core/docs/src/getting-started/reflection.ipynb
similarity index 100%
rename from python/docs/src/getting-started/reflection.ipynb
rename to python/packages/autogen-core/docs/src/getting-started/reflection.ipynb
diff --git a/python/docs/src/getting-started/tool-use-agent-cfg.svg b/python/packages/autogen-core/docs/src/getting-started/tool-use-agent-cfg.svg
similarity index 100%
rename from python/docs/src/getting-started/tool-use-agent-cfg.svg
rename to python/packages/autogen-core/docs/src/getting-started/tool-use-agent-cfg.svg
diff --git a/python/docs/src/getting-started/tools.ipynb b/python/packages/autogen-core/docs/src/getting-started/tools.ipynb
similarity index 100%
rename from python/docs/src/getting-started/tools.ipynb
rename to python/packages/autogen-core/docs/src/getting-started/tools.ipynb
diff --git a/python/docs/src/guides/logging.md b/python/packages/autogen-core/docs/src/guides/logging.md
similarity index 100%
rename from python/docs/src/guides/logging.md
rename to python/packages/autogen-core/docs/src/guides/logging.md
diff --git a/python/docs/src/guides/worker-protocol.md b/python/packages/autogen-core/docs/src/guides/worker-protocol.md
similarity index 100%
rename from python/docs/src/guides/worker-protocol.md
rename to python/packages/autogen-core/docs/src/guides/worker-protocol.md
diff --git a/python/docs/src/index.rst b/python/packages/autogen-core/docs/src/index.rst
similarity index 100%
rename from python/docs/src/index.rst
rename to python/packages/autogen-core/docs/src/index.rst
diff --git a/python/pyproject.toml b/python/packages/autogen-core/pyproject.toml
similarity index 100%
rename from python/pyproject.toml
rename to python/packages/autogen-core/pyproject.toml
diff --git a/python/samples/README.md b/python/packages/autogen-core/samples/README.md
similarity index 100%
rename from python/samples/README.md
rename to python/packages/autogen-core/samples/README.md
diff --git a/python/samples/byoa/langgraph_agent.py b/python/packages/autogen-core/samples/byoa/langgraph_agent.py
similarity index 100%
rename from python/samples/byoa/langgraph_agent.py
rename to python/packages/autogen-core/samples/byoa/langgraph_agent.py
diff --git a/python/samples/byoa/llamaindex_agent.py b/python/packages/autogen-core/samples/byoa/llamaindex_agent.py
similarity index 100%
rename from python/samples/byoa/llamaindex_agent.py
rename to python/packages/autogen-core/samples/byoa/llamaindex_agent.py
diff --git a/python/samples/common/__init__.py b/python/packages/autogen-core/samples/common/__init__.py
similarity index 100%
rename from python/samples/common/__init__.py
rename to python/packages/autogen-core/samples/common/__init__.py
diff --git a/python/samples/common/agents/__init__.py b/python/packages/autogen-core/samples/common/agents/__init__.py
similarity index 100%
rename from python/samples/common/agents/__init__.py
rename to python/packages/autogen-core/samples/common/agents/__init__.py
diff --git a/python/samples/common/agents/_chat_completion_agent.py b/python/packages/autogen-core/samples/common/agents/_chat_completion_agent.py
similarity index 100%
rename from python/samples/common/agents/_chat_completion_agent.py
rename to python/packages/autogen-core/samples/common/agents/_chat_completion_agent.py
diff --git a/python/samples/common/agents/_image_generation_agent.py b/python/packages/autogen-core/samples/common/agents/_image_generation_agent.py
similarity index 100%
rename from python/samples/common/agents/_image_generation_agent.py
rename to python/packages/autogen-core/samples/common/agents/_image_generation_agent.py
diff --git a/python/samples/common/agents/_oai_assistant.py b/python/packages/autogen-core/samples/common/agents/_oai_assistant.py
similarity index 100%
rename from python/samples/common/agents/_oai_assistant.py
rename to python/packages/autogen-core/samples/common/agents/_oai_assistant.py
diff --git a/python/samples/common/agents/_user_proxy.py b/python/packages/autogen-core/samples/common/agents/_user_proxy.py
similarity index 100%
rename from python/samples/common/agents/_user_proxy.py
rename to python/packages/autogen-core/samples/common/agents/_user_proxy.py
diff --git a/python/samples/common/memory/__init__.py b/python/packages/autogen-core/samples/common/memory/__init__.py
similarity index 100%
rename from python/samples/common/memory/__init__.py
rename to python/packages/autogen-core/samples/common/memory/__init__.py
diff --git a/python/samples/common/memory/_buffered.py b/python/packages/autogen-core/samples/common/memory/_buffered.py
similarity index 100%
rename from python/samples/common/memory/_buffered.py
rename to python/packages/autogen-core/samples/common/memory/_buffered.py
diff --git a/python/samples/common/memory/_head_and_tail.py b/python/packages/autogen-core/samples/common/memory/_head_and_tail.py
similarity index 100%
rename from python/samples/common/memory/_head_and_tail.py
rename to python/packages/autogen-core/samples/common/memory/_head_and_tail.py
diff --git a/python/samples/common/patterns/__init__.py b/python/packages/autogen-core/samples/common/patterns/__init__.py
similarity index 100%
rename from python/samples/common/patterns/__init__.py
rename to python/packages/autogen-core/samples/common/patterns/__init__.py
diff --git a/python/samples/common/patterns/_group_chat_manager.py b/python/packages/autogen-core/samples/common/patterns/_group_chat_manager.py
similarity index 100%
rename from python/samples/common/patterns/_group_chat_manager.py
rename to python/packages/autogen-core/samples/common/patterns/_group_chat_manager.py
diff --git a/python/samples/common/patterns/_group_chat_utils.py b/python/packages/autogen-core/samples/common/patterns/_group_chat_utils.py
similarity index 100%
rename from python/samples/common/patterns/_group_chat_utils.py
rename to python/packages/autogen-core/samples/common/patterns/_group_chat_utils.py
diff --git a/python/samples/common/patterns/_orchestrator_chat.py b/python/packages/autogen-core/samples/common/patterns/_orchestrator_chat.py
similarity index 100%
rename from python/samples/common/patterns/_orchestrator_chat.py
rename to python/packages/autogen-core/samples/common/patterns/_orchestrator_chat.py
diff --git a/python/samples/common/types.py b/python/packages/autogen-core/samples/common/types.py
similarity index 100%
rename from python/samples/common/types.py
rename to python/packages/autogen-core/samples/common/types.py
diff --git a/python/samples/common/utils.py b/python/packages/autogen-core/samples/common/utils.py
similarity index 100%
rename from python/samples/common/utils.py
rename to python/packages/autogen-core/samples/common/utils.py
diff --git a/python/samples/core/inner_outer_direct.py b/python/packages/autogen-core/samples/core/inner_outer_direct.py
similarity index 100%
rename from python/samples/core/inner_outer_direct.py
rename to python/packages/autogen-core/samples/core/inner_outer_direct.py
diff --git a/python/samples/core/one_agent_direct.py b/python/packages/autogen-core/samples/core/one_agent_direct.py
similarity index 100%
rename from python/samples/core/one_agent_direct.py
rename to python/packages/autogen-core/samples/core/one_agent_direct.py
diff --git a/python/samples/core/two_agents_pub_sub.py b/python/packages/autogen-core/samples/core/two_agents_pub_sub.py
similarity index 100%
rename from python/samples/core/two_agents_pub_sub.py
rename to python/packages/autogen-core/samples/core/two_agents_pub_sub.py
diff --git a/python/samples/demos/assistant.py b/python/packages/autogen-core/samples/demos/assistant.py
similarity index 100%
rename from python/samples/demos/assistant.py
rename to python/packages/autogen-core/samples/demos/assistant.py
diff --git a/python/samples/demos/chess_game.py b/python/packages/autogen-core/samples/demos/chess_game.py
similarity index 100%
rename from python/samples/demos/chess_game.py
rename to python/packages/autogen-core/samples/demos/chess_game.py
diff --git a/python/samples/demos/utils.py b/python/packages/autogen-core/samples/demos/utils.py
similarity index 100%
rename from python/samples/demos/utils.py
rename to python/packages/autogen-core/samples/demos/utils.py
diff --git a/python/samples/patterns/coder_executor.py b/python/packages/autogen-core/samples/patterns/coder_executor.py
similarity index 100%
rename from python/samples/patterns/coder_executor.py
rename to python/packages/autogen-core/samples/patterns/coder_executor.py
diff --git a/python/samples/patterns/coder_reviewer.py b/python/packages/autogen-core/samples/patterns/coder_reviewer.py
similarity index 100%
rename from python/samples/patterns/coder_reviewer.py
rename to python/packages/autogen-core/samples/patterns/coder_reviewer.py
diff --git a/python/samples/patterns/group_chat.py b/python/packages/autogen-core/samples/patterns/group_chat.py
similarity index 100%
rename from python/samples/patterns/group_chat.py
rename to python/packages/autogen-core/samples/patterns/group_chat.py
diff --git a/python/samples/patterns/mixture_of_agents.py b/python/packages/autogen-core/samples/patterns/mixture_of_agents.py
similarity index 100%
rename from python/samples/patterns/mixture_of_agents.py
rename to python/packages/autogen-core/samples/patterns/mixture_of_agents.py
diff --git a/python/samples/patterns/multi_agent_debate.py b/python/packages/autogen-core/samples/patterns/multi_agent_debate.py
similarity index 100%
rename from python/samples/patterns/multi_agent_debate.py
rename to python/packages/autogen-core/samples/patterns/multi_agent_debate.py
diff --git a/python/samples/tool-use/coding_direct.py b/python/packages/autogen-core/samples/tool-use/coding_direct.py
similarity index 100%
rename from python/samples/tool-use/coding_direct.py
rename to python/packages/autogen-core/samples/tool-use/coding_direct.py
diff --git a/python/samples/tool-use/coding_direct_with_intercept.py b/python/packages/autogen-core/samples/tool-use/coding_direct_with_intercept.py
similarity index 100%
rename from python/samples/tool-use/coding_direct_with_intercept.py
rename to python/packages/autogen-core/samples/tool-use/coding_direct_with_intercept.py
diff --git a/python/samples/tool-use/coding_pub_sub.py b/python/packages/autogen-core/samples/tool-use/coding_pub_sub.py
similarity index 100%
rename from python/samples/tool-use/coding_pub_sub.py
rename to python/packages/autogen-core/samples/tool-use/coding_pub_sub.py
diff --git a/python/samples/tool-use/custom_tool_direct.py b/python/packages/autogen-core/samples/tool-use/custom_tool_direct.py
similarity index 100%
rename from python/samples/tool-use/custom_tool_direct.py
rename to python/packages/autogen-core/samples/tool-use/custom_tool_direct.py
diff --git a/python/samples/worker/run_host.py b/python/packages/autogen-core/samples/worker/run_host.py
similarity index 100%
rename from python/samples/worker/run_host.py
rename to python/packages/autogen-core/samples/worker/run_host.py
diff --git a/python/samples/worker/run_worker_pub_sub.py b/python/packages/autogen-core/samples/worker/run_worker_pub_sub.py
similarity index 100%
rename from python/samples/worker/run_worker_pub_sub.py
rename to python/packages/autogen-core/samples/worker/run_worker_pub_sub.py
diff --git a/python/samples/worker/run_worker_rpc.py b/python/packages/autogen-core/samples/worker/run_worker_rpc.py
similarity index 100%
rename from python/samples/worker/run_worker_rpc.py
rename to python/packages/autogen-core/samples/worker/run_worker_rpc.py
diff --git a/python/src/autogen_core/__init__.py b/python/packages/autogen-core/src/autogen_core/__init__.py
similarity index 100%
rename from python/src/autogen_core/__init__.py
rename to python/packages/autogen-core/src/autogen_core/__init__.py
diff --git a/python/src/autogen_core/application/__init__.py b/python/packages/autogen-core/src/autogen_core/application/__init__.py
similarity index 100%
rename from python/src/autogen_core/application/__init__.py
rename to python/packages/autogen-core/src/autogen_core/application/__init__.py
diff --git a/python/src/autogen_core/application/_helpers.py b/python/packages/autogen-core/src/autogen_core/application/_helpers.py
similarity index 100%
rename from python/src/autogen_core/application/_helpers.py
rename to python/packages/autogen-core/src/autogen_core/application/_helpers.py
diff --git a/python/src/autogen_core/application/_host_runtime_servicer.py b/python/packages/autogen-core/src/autogen_core/application/_host_runtime_servicer.py
similarity index 100%
rename from python/src/autogen_core/application/_host_runtime_servicer.py
rename to python/packages/autogen-core/src/autogen_core/application/_host_runtime_servicer.py
diff --git a/python/src/autogen_core/application/_single_threaded_agent_runtime.py b/python/packages/autogen-core/src/autogen_core/application/_single_threaded_agent_runtime.py
similarity index 100%
rename from python/src/autogen_core/application/_single_threaded_agent_runtime.py
rename to python/packages/autogen-core/src/autogen_core/application/_single_threaded_agent_runtime.py
diff --git a/python/src/autogen_core/application/_worker_runtime.py b/python/packages/autogen-core/src/autogen_core/application/_worker_runtime.py
similarity index 100%
rename from python/src/autogen_core/application/_worker_runtime.py
rename to python/packages/autogen-core/src/autogen_core/application/_worker_runtime.py
diff --git a/python/src/autogen_core/application/logging/__init__.py b/python/packages/autogen-core/src/autogen_core/application/logging/__init__.py
similarity index 100%
rename from python/src/autogen_core/application/logging/__init__.py
rename to python/packages/autogen-core/src/autogen_core/application/logging/__init__.py
diff --git a/python/src/autogen_core/application/logging/_llm_usage.py b/python/packages/autogen-core/src/autogen_core/application/logging/_llm_usage.py
similarity index 100%
rename from python/src/autogen_core/application/logging/_llm_usage.py
rename to python/packages/autogen-core/src/autogen_core/application/logging/_llm_usage.py
diff --git a/python/src/autogen_core/application/logging/events.py b/python/packages/autogen-core/src/autogen_core/application/logging/events.py
similarity index 100%
rename from python/src/autogen_core/application/logging/events.py
rename to python/packages/autogen-core/src/autogen_core/application/logging/events.py
diff --git a/python/src/autogen_core/application/protos/__init__.py b/python/packages/autogen-core/src/autogen_core/application/protos/__init__.py
similarity index 100%
rename from python/src/autogen_core/application/protos/__init__.py
rename to python/packages/autogen-core/src/autogen_core/application/protos/__init__.py
diff --git a/python/src/autogen_core/application/protos/agent_worker_pb2.py b/python/packages/autogen-core/src/autogen_core/application/protos/agent_worker_pb2.py
similarity index 100%
rename from python/src/autogen_core/application/protos/agent_worker_pb2.py
rename to python/packages/autogen-core/src/autogen_core/application/protos/agent_worker_pb2.py
diff --git a/python/src/autogen_core/application/protos/agent_worker_pb2.pyi b/python/packages/autogen-core/src/autogen_core/application/protos/agent_worker_pb2.pyi
similarity index 100%
rename from python/src/autogen_core/application/protos/agent_worker_pb2.pyi
rename to python/packages/autogen-core/src/autogen_core/application/protos/agent_worker_pb2.pyi
diff --git a/python/src/autogen_core/application/protos/agent_worker_pb2_grpc.py b/python/packages/autogen-core/src/autogen_core/application/protos/agent_worker_pb2_grpc.py
similarity index 100%
rename from python/src/autogen_core/application/protos/agent_worker_pb2_grpc.py
rename to python/packages/autogen-core/src/autogen_core/application/protos/agent_worker_pb2_grpc.py
diff --git a/python/src/autogen_core/application/protos/agent_worker_pb2_grpc.pyi b/python/packages/autogen-core/src/autogen_core/application/protos/agent_worker_pb2_grpc.pyi
similarity index 100%
rename from python/src/autogen_core/application/protos/agent_worker_pb2_grpc.pyi
rename to python/packages/autogen-core/src/autogen_core/application/protos/agent_worker_pb2_grpc.pyi
diff --git a/python/src/autogen_core/base/__init__.py b/python/packages/autogen-core/src/autogen_core/base/__init__.py
similarity index 100%
rename from python/src/autogen_core/base/__init__.py
rename to python/packages/autogen-core/src/autogen_core/base/__init__.py
diff --git a/python/src/autogen_core/base/_agent.py b/python/packages/autogen-core/src/autogen_core/base/_agent.py
similarity index 100%
rename from python/src/autogen_core/base/_agent.py
rename to python/packages/autogen-core/src/autogen_core/base/_agent.py
diff --git a/python/src/autogen_core/base/_agent_id.py b/python/packages/autogen-core/src/autogen_core/base/_agent_id.py
similarity index 100%
rename from python/src/autogen_core/base/_agent_id.py
rename to python/packages/autogen-core/src/autogen_core/base/_agent_id.py
diff --git a/python/src/autogen_core/base/_agent_instantiation.py b/python/packages/autogen-core/src/autogen_core/base/_agent_instantiation.py
similarity index 100%
rename from python/src/autogen_core/base/_agent_instantiation.py
rename to python/packages/autogen-core/src/autogen_core/base/_agent_instantiation.py
diff --git a/python/src/autogen_core/base/_agent_metadata.py b/python/packages/autogen-core/src/autogen_core/base/_agent_metadata.py
similarity index 100%
rename from python/src/autogen_core/base/_agent_metadata.py
rename to python/packages/autogen-core/src/autogen_core/base/_agent_metadata.py
diff --git a/python/src/autogen_core/base/_agent_props.py b/python/packages/autogen-core/src/autogen_core/base/_agent_props.py
similarity index 100%
rename from python/src/autogen_core/base/_agent_props.py
rename to python/packages/autogen-core/src/autogen_core/base/_agent_props.py
diff --git a/python/src/autogen_core/base/_agent_proxy.py b/python/packages/autogen-core/src/autogen_core/base/_agent_proxy.py
similarity index 100%
rename from python/src/autogen_core/base/_agent_proxy.py
rename to python/packages/autogen-core/src/autogen_core/base/_agent_proxy.py
diff --git a/python/src/autogen_core/base/_agent_runtime.py b/python/packages/autogen-core/src/autogen_core/base/_agent_runtime.py
similarity index 100%
rename from python/src/autogen_core/base/_agent_runtime.py
rename to python/packages/autogen-core/src/autogen_core/base/_agent_runtime.py
diff --git a/python/src/autogen_core/base/_agent_type.py b/python/packages/autogen-core/src/autogen_core/base/_agent_type.py
similarity index 100%
rename from python/src/autogen_core/base/_agent_type.py
rename to python/packages/autogen-core/src/autogen_core/base/_agent_type.py
diff --git a/python/src/autogen_core/base/_base_agent.py b/python/packages/autogen-core/src/autogen_core/base/_base_agent.py
similarity index 100%
rename from python/src/autogen_core/base/_base_agent.py
rename to python/packages/autogen-core/src/autogen_core/base/_base_agent.py
diff --git a/python/src/autogen_core/base/_cancellation_token.py b/python/packages/autogen-core/src/autogen_core/base/_cancellation_token.py
similarity index 100%
rename from python/src/autogen_core/base/_cancellation_token.py
rename to python/packages/autogen-core/src/autogen_core/base/_cancellation_token.py
diff --git a/python/src/autogen_core/base/_message_context.py b/python/packages/autogen-core/src/autogen_core/base/_message_context.py
similarity index 100%
rename from python/src/autogen_core/base/_message_context.py
rename to python/packages/autogen-core/src/autogen_core/base/_message_context.py
diff --git a/python/src/autogen_core/base/_message_handler_context.py b/python/packages/autogen-core/src/autogen_core/base/_message_handler_context.py
similarity index 100%
rename from python/src/autogen_core/base/_message_handler_context.py
rename to python/packages/autogen-core/src/autogen_core/base/_message_handler_context.py
diff --git a/python/src/autogen_core/base/_serialization.py b/python/packages/autogen-core/src/autogen_core/base/_serialization.py
similarity index 100%
rename from python/src/autogen_core/base/_serialization.py
rename to python/packages/autogen-core/src/autogen_core/base/_serialization.py
diff --git a/python/src/autogen_core/base/_subscription.py b/python/packages/autogen-core/src/autogen_core/base/_subscription.py
similarity index 100%
rename from python/src/autogen_core/base/_subscription.py
rename to python/packages/autogen-core/src/autogen_core/base/_subscription.py
diff --git a/python/src/autogen_core/base/_subscription_context.py b/python/packages/autogen-core/src/autogen_core/base/_subscription_context.py
similarity index 100%
rename from python/src/autogen_core/base/_subscription_context.py
rename to python/packages/autogen-core/src/autogen_core/base/_subscription_context.py
diff --git a/python/src/autogen_core/base/_topic.py b/python/packages/autogen-core/src/autogen_core/base/_topic.py
similarity index 100%
rename from python/src/autogen_core/base/_topic.py
rename to python/packages/autogen-core/src/autogen_core/base/_topic.py
diff --git a/python/src/autogen_core/base/exceptions.py b/python/packages/autogen-core/src/autogen_core/base/exceptions.py
similarity index 100%
rename from python/src/autogen_core/base/exceptions.py
rename to python/packages/autogen-core/src/autogen_core/base/exceptions.py
diff --git a/python/src/autogen_core/base/intervention.py b/python/packages/autogen-core/src/autogen_core/base/intervention.py
similarity index 100%
rename from python/src/autogen_core/base/intervention.py
rename to python/packages/autogen-core/src/autogen_core/base/intervention.py
diff --git a/python/src/autogen_core/components/__init__.py b/python/packages/autogen-core/src/autogen_core/components/__init__.py
similarity index 100%
rename from python/src/autogen_core/components/__init__.py
rename to python/packages/autogen-core/src/autogen_core/components/__init__.py
diff --git a/python/src/autogen_core/components/_closure_agent.py b/python/packages/autogen-core/src/autogen_core/components/_closure_agent.py
similarity index 100%
rename from python/src/autogen_core/components/_closure_agent.py
rename to python/packages/autogen-core/src/autogen_core/components/_closure_agent.py
diff --git a/python/src/autogen_core/components/_default_subscription.py b/python/packages/autogen-core/src/autogen_core/components/_default_subscription.py
similarity index 100%
rename from python/src/autogen_core/components/_default_subscription.py
rename to python/packages/autogen-core/src/autogen_core/components/_default_subscription.py
diff --git a/python/src/autogen_core/components/_default_topic.py b/python/packages/autogen-core/src/autogen_core/components/_default_topic.py
similarity index 100%
rename from python/src/autogen_core/components/_default_topic.py
rename to python/packages/autogen-core/src/autogen_core/components/_default_topic.py
diff --git a/python/src/autogen_core/components/_function_utils.py b/python/packages/autogen-core/src/autogen_core/components/_function_utils.py
similarity index 100%
rename from python/src/autogen_core/components/_function_utils.py
rename to python/packages/autogen-core/src/autogen_core/components/_function_utils.py
diff --git a/python/src/autogen_core/components/_image.py b/python/packages/autogen-core/src/autogen_core/components/_image.py
similarity index 100%
rename from python/src/autogen_core/components/_image.py
rename to python/packages/autogen-core/src/autogen_core/components/_image.py
diff --git a/python/src/autogen_core/components/_pydantic_compat.py b/python/packages/autogen-core/src/autogen_core/components/_pydantic_compat.py
similarity index 100%
rename from python/src/autogen_core/components/_pydantic_compat.py
rename to python/packages/autogen-core/src/autogen_core/components/_pydantic_compat.py
diff --git a/python/src/autogen_core/components/_routed_agent.py b/python/packages/autogen-core/src/autogen_core/components/_routed_agent.py
similarity index 100%
rename from python/src/autogen_core/components/_routed_agent.py
rename to python/packages/autogen-core/src/autogen_core/components/_routed_agent.py
diff --git a/python/src/autogen_core/components/_type_helpers.py b/python/packages/autogen-core/src/autogen_core/components/_type_helpers.py
similarity index 100%
rename from python/src/autogen_core/components/_type_helpers.py
rename to python/packages/autogen-core/src/autogen_core/components/_type_helpers.py
diff --git a/python/src/autogen_core/components/_type_subscription.py b/python/packages/autogen-core/src/autogen_core/components/_type_subscription.py
similarity index 100%
rename from python/src/autogen_core/components/_type_subscription.py
rename to python/packages/autogen-core/src/autogen_core/components/_type_subscription.py
diff --git a/python/src/autogen_core/components/_types.py b/python/packages/autogen-core/src/autogen_core/components/_types.py
similarity index 100%
rename from python/src/autogen_core/components/_types.py
rename to python/packages/autogen-core/src/autogen_core/components/_types.py
diff --git a/python/src/autogen_core/components/code_executor/__init__.py b/python/packages/autogen-core/src/autogen_core/components/code_executor/__init__.py
similarity index 100%
rename from python/src/autogen_core/components/code_executor/__init__.py
rename to python/packages/autogen-core/src/autogen_core/components/code_executor/__init__.py
diff --git a/python/src/autogen_core/components/code_executor/_base.py b/python/packages/autogen-core/src/autogen_core/components/code_executor/_base.py
similarity index 100%
rename from python/src/autogen_core/components/code_executor/_base.py
rename to python/packages/autogen-core/src/autogen_core/components/code_executor/_base.py
diff --git a/python/src/autogen_core/components/code_executor/_func_with_reqs.py b/python/packages/autogen-core/src/autogen_core/components/code_executor/_func_with_reqs.py
similarity index 100%
rename from python/src/autogen_core/components/code_executor/_func_with_reqs.py
rename to python/packages/autogen-core/src/autogen_core/components/code_executor/_func_with_reqs.py
diff --git a/python/src/autogen_core/components/code_executor/_impl/__init__.py b/python/packages/autogen-core/src/autogen_core/components/code_executor/_impl/__init__.py
similarity index 100%
rename from python/src/autogen_core/components/code_executor/_impl/__init__.py
rename to python/packages/autogen-core/src/autogen_core/components/code_executor/_impl/__init__.py
diff --git a/python/src/autogen_core/components/code_executor/_impl/azure_container_code_executor.py b/python/packages/autogen-core/src/autogen_core/components/code_executor/_impl/azure_container_code_executor.py
similarity index 100%
rename from python/src/autogen_core/components/code_executor/_impl/azure_container_code_executor.py
rename to python/packages/autogen-core/src/autogen_core/components/code_executor/_impl/azure_container_code_executor.py
diff --git a/python/src/autogen_core/components/code_executor/_impl/command_line_code_result.py b/python/packages/autogen-core/src/autogen_core/components/code_executor/_impl/command_line_code_result.py
similarity index 100%
rename from python/src/autogen_core/components/code_executor/_impl/command_line_code_result.py
rename to python/packages/autogen-core/src/autogen_core/components/code_executor/_impl/command_line_code_result.py
diff --git a/python/src/autogen_core/components/code_executor/_impl/local_commandline_code_executor.py b/python/packages/autogen-core/src/autogen_core/components/code_executor/_impl/local_commandline_code_executor.py
similarity index 100%
rename from python/src/autogen_core/components/code_executor/_impl/local_commandline_code_executor.py
rename to python/packages/autogen-core/src/autogen_core/components/code_executor/_impl/local_commandline_code_executor.py
diff --git a/python/src/autogen_core/components/code_executor/_impl/utils.py b/python/packages/autogen-core/src/autogen_core/components/code_executor/_impl/utils.py
similarity index 100%
rename from python/src/autogen_core/components/code_executor/_impl/utils.py
rename to python/packages/autogen-core/src/autogen_core/components/code_executor/_impl/utils.py
diff --git a/python/src/autogen_core/components/code_executor/_utils.py b/python/packages/autogen-core/src/autogen_core/components/code_executor/_utils.py
similarity index 100%
rename from python/src/autogen_core/components/code_executor/_utils.py
rename to python/packages/autogen-core/src/autogen_core/components/code_executor/_utils.py
diff --git a/python/src/autogen_core/components/memory/__init__.py b/python/packages/autogen-core/src/autogen_core/components/memory/__init__.py
similarity index 100%
rename from python/src/autogen_core/components/memory/__init__.py
rename to python/packages/autogen-core/src/autogen_core/components/memory/__init__.py
diff --git a/python/src/autogen_core/components/memory/_base.py b/python/packages/autogen-core/src/autogen_core/components/memory/_base.py
similarity index 100%
rename from python/src/autogen_core/components/memory/_base.py
rename to python/packages/autogen-core/src/autogen_core/components/memory/_base.py
diff --git a/python/src/autogen_core/components/models/__init__.py b/python/packages/autogen-core/src/autogen_core/components/models/__init__.py
similarity index 100%
rename from python/src/autogen_core/components/models/__init__.py
rename to python/packages/autogen-core/src/autogen_core/components/models/__init__.py
diff --git a/python/src/autogen_core/components/models/_model_client.py b/python/packages/autogen-core/src/autogen_core/components/models/_model_client.py
similarity index 100%
rename from python/src/autogen_core/components/models/_model_client.py
rename to python/packages/autogen-core/src/autogen_core/components/models/_model_client.py
diff --git a/python/src/autogen_core/components/models/_model_info.py b/python/packages/autogen-core/src/autogen_core/components/models/_model_info.py
similarity index 100%
rename from python/src/autogen_core/components/models/_model_info.py
rename to python/packages/autogen-core/src/autogen_core/components/models/_model_info.py
diff --git a/python/src/autogen_core/components/models/_openai_client.py b/python/packages/autogen-core/src/autogen_core/components/models/_openai_client.py
similarity index 100%
rename from python/src/autogen_core/components/models/_openai_client.py
rename to python/packages/autogen-core/src/autogen_core/components/models/_openai_client.py
diff --git a/python/src/autogen_core/components/models/_types.py b/python/packages/autogen-core/src/autogen_core/components/models/_types.py
similarity index 100%
rename from python/src/autogen_core/components/models/_types.py
rename to python/packages/autogen-core/src/autogen_core/components/models/_types.py
diff --git a/python/src/autogen_core/components/models/config/__init__.py b/python/packages/autogen-core/src/autogen_core/components/models/config/__init__.py
similarity index 100%
rename from python/src/autogen_core/components/models/config/__init__.py
rename to python/packages/autogen-core/src/autogen_core/components/models/config/__init__.py
diff --git a/python/src/autogen_core/components/tool_agent/__init__.py b/python/packages/autogen-core/src/autogen_core/components/tool_agent/__init__.py
similarity index 100%
rename from python/src/autogen_core/components/tool_agent/__init__.py
rename to python/packages/autogen-core/src/autogen_core/components/tool_agent/__init__.py
diff --git a/python/src/autogen_core/components/tool_agent/_caller_loop.py b/python/packages/autogen-core/src/autogen_core/components/tool_agent/_caller_loop.py
similarity index 100%
rename from python/src/autogen_core/components/tool_agent/_caller_loop.py
rename to python/packages/autogen-core/src/autogen_core/components/tool_agent/_caller_loop.py
diff --git a/python/src/autogen_core/components/tool_agent/_tool_agent.py b/python/packages/autogen-core/src/autogen_core/components/tool_agent/_tool_agent.py
similarity index 100%
rename from python/src/autogen_core/components/tool_agent/_tool_agent.py
rename to python/packages/autogen-core/src/autogen_core/components/tool_agent/_tool_agent.py
diff --git a/python/src/autogen_core/components/tools/__init__.py b/python/packages/autogen-core/src/autogen_core/components/tools/__init__.py
similarity index 100%
rename from python/src/autogen_core/components/tools/__init__.py
rename to python/packages/autogen-core/src/autogen_core/components/tools/__init__.py
diff --git a/python/src/autogen_core/components/tools/_base.py b/python/packages/autogen-core/src/autogen_core/components/tools/_base.py
similarity index 100%
rename from python/src/autogen_core/components/tools/_base.py
rename to python/packages/autogen-core/src/autogen_core/components/tools/_base.py
diff --git a/python/src/autogen_core/components/tools/_code_execution.py b/python/packages/autogen-core/src/autogen_core/components/tools/_code_execution.py
similarity index 100%
rename from python/src/autogen_core/components/tools/_code_execution.py
rename to python/packages/autogen-core/src/autogen_core/components/tools/_code_execution.py
diff --git a/python/src/autogen_core/components/tools/_function_tool.py b/python/packages/autogen-core/src/autogen_core/components/tools/_function_tool.py
similarity index 100%
rename from python/src/autogen_core/components/tools/_function_tool.py
rename to python/packages/autogen-core/src/autogen_core/components/tools/_function_tool.py
diff --git a/python/src/autogen_core/py.typed b/python/packages/autogen-core/src/autogen_core/py.typed
similarity index 100%
rename from python/src/autogen_core/py.typed
rename to python/packages/autogen-core/src/autogen_core/py.typed
diff --git a/python/tests/execution/test_azure_container_code_executor.py b/python/packages/autogen-core/tests/execution/test_azure_container_code_executor.py
similarity index 100%
rename from python/tests/execution/test_azure_container_code_executor.py
rename to python/packages/autogen-core/tests/execution/test_azure_container_code_executor.py
diff --git a/python/tests/execution/test_commandline_code_executor.py b/python/packages/autogen-core/tests/execution/test_commandline_code_executor.py
similarity index 100%
rename from python/tests/execution/test_commandline_code_executor.py
rename to python/packages/autogen-core/tests/execution/test_commandline_code_executor.py
diff --git a/python/tests/execution/test_extract_code_blocks.py b/python/packages/autogen-core/tests/execution/test_extract_code_blocks.py
similarity index 100%
rename from python/tests/execution/test_extract_code_blocks.py
rename to python/packages/autogen-core/tests/execution/test_extract_code_blocks.py
diff --git a/python/tests/execution/test_user_defined_functions.py b/python/packages/autogen-core/tests/execution/test_user_defined_functions.py
similarity index 100%
rename from python/tests/execution/test_user_defined_functions.py
rename to python/packages/autogen-core/tests/execution/test_user_defined_functions.py
diff --git a/python/tests/test_base_agent.py b/python/packages/autogen-core/tests/test_base_agent.py
similarity index 100%
rename from python/tests/test_base_agent.py
rename to python/packages/autogen-core/tests/test_base_agent.py
diff --git a/python/tests/test_cancellation.py b/python/packages/autogen-core/tests/test_cancellation.py
similarity index 100%
rename from python/tests/test_cancellation.py
rename to python/packages/autogen-core/tests/test_cancellation.py
diff --git a/python/tests/test_closure_agent.py b/python/packages/autogen-core/tests/test_closure_agent.py
similarity index 100%
rename from python/tests/test_closure_agent.py
rename to python/packages/autogen-core/tests/test_closure_agent.py
diff --git a/python/tests/test_intervention.py b/python/packages/autogen-core/tests/test_intervention.py
similarity index 100%
rename from python/tests/test_intervention.py
rename to python/packages/autogen-core/tests/test_intervention.py
diff --git a/python/tests/test_llm_usage.py b/python/packages/autogen-core/tests/test_llm_usage.py
similarity index 100%
rename from python/tests/test_llm_usage.py
rename to python/packages/autogen-core/tests/test_llm_usage.py
diff --git a/python/tests/test_model_client.py b/python/packages/autogen-core/tests/test_model_client.py
similarity index 100%
rename from python/tests/test_model_client.py
rename to python/packages/autogen-core/tests/test_model_client.py
diff --git a/python/tests/test_routed_agent.py b/python/packages/autogen-core/tests/test_routed_agent.py
similarity index 100%
rename from python/tests/test_routed_agent.py
rename to python/packages/autogen-core/tests/test_routed_agent.py
diff --git a/python/tests/test_runtime.py b/python/packages/autogen-core/tests/test_runtime.py
similarity index 100%
rename from python/tests/test_runtime.py
rename to python/packages/autogen-core/tests/test_runtime.py
diff --git a/python/tests/test_serialization.py b/python/packages/autogen-core/tests/test_serialization.py
similarity index 100%
rename from python/tests/test_serialization.py
rename to python/packages/autogen-core/tests/test_serialization.py
diff --git a/python/tests/test_state.py b/python/packages/autogen-core/tests/test_state.py
similarity index 100%
rename from python/tests/test_state.py
rename to python/packages/autogen-core/tests/test_state.py
diff --git a/python/tests/test_subscription.py b/python/packages/autogen-core/tests/test_subscription.py
similarity index 100%
rename from python/tests/test_subscription.py
rename to python/packages/autogen-core/tests/test_subscription.py
diff --git a/python/tests/test_tool_agent.py b/python/packages/autogen-core/tests/test_tool_agent.py
similarity index 100%
rename from python/tests/test_tool_agent.py
rename to python/packages/autogen-core/tests/test_tool_agent.py
diff --git a/python/tests/test_tools.py b/python/packages/autogen-core/tests/test_tools.py
similarity index 100%
rename from python/tests/test_tools.py
rename to python/packages/autogen-core/tests/test_tools.py
diff --git a/python/tests/test_types.py b/python/packages/autogen-core/tests/test_types.py
similarity index 100%
rename from python/tests/test_types.py
rename to python/packages/autogen-core/tests/test_types.py
diff --git a/python/tests/test_utils/__init__.py b/python/packages/autogen-core/tests/test_utils/__init__.py
similarity index 100%
rename from python/tests/test_utils/__init__.py
rename to python/packages/autogen-core/tests/test_utils/__init__.py
diff --git a/python/teams/team-one/examples/example.py b/python/packages/team-one/examples/example.py
similarity index 100%
rename from python/teams/team-one/examples/example.py
rename to python/packages/team-one/examples/example.py
diff --git a/python/teams/team-one/examples/example_coder.py b/python/packages/team-one/examples/example_coder.py
similarity index 100%
rename from python/teams/team-one/examples/example_coder.py
rename to python/packages/team-one/examples/example_coder.py
diff --git a/python/teams/team-one/examples/example_file_surfer.py b/python/packages/team-one/examples/example_file_surfer.py
similarity index 100%
rename from python/teams/team-one/examples/example_file_surfer.py
rename to python/packages/team-one/examples/example_file_surfer.py
diff --git a/python/teams/team-one/examples/example_reflexagents.py b/python/packages/team-one/examples/example_reflexagents.py
similarity index 100%
rename from python/teams/team-one/examples/example_reflexagents.py
rename to python/packages/team-one/examples/example_reflexagents.py
diff --git a/python/teams/team-one/examples/example_userproxy.py b/python/packages/team-one/examples/example_userproxy.py
similarity index 100%
rename from python/teams/team-one/examples/example_userproxy.py
rename to python/packages/team-one/examples/example_userproxy.py
diff --git a/python/teams/team-one/examples/example_websurfer.py b/python/packages/team-one/examples/example_websurfer.py
similarity index 100%
rename from python/teams/team-one/examples/example_websurfer.py
rename to python/packages/team-one/examples/example_websurfer.py
diff --git a/python/teams/team-one/imgs/team-one-arch.png b/python/packages/team-one/imgs/team-one-arch.png
similarity index 100%
rename from python/teams/team-one/imgs/team-one-arch.png
rename to python/packages/team-one/imgs/team-one-arch.png
diff --git a/python/teams/team-one/imgs/team-one-landing.png b/python/packages/team-one/imgs/team-one-landing.png
similarity index 100%
rename from python/teams/team-one/imgs/team-one-landing.png
rename to python/packages/team-one/imgs/team-one-landing.png
diff --git a/python/teams/team-one/pyproject.toml b/python/packages/team-one/pyproject.toml
similarity index 91%
rename from python/teams/team-one/pyproject.toml
rename to python/packages/team-one/pyproject.toml
index d0a073305..e5b65bb55 100644
--- a/python/teams/team-one/pyproject.toml
+++ b/python/packages/team-one/pyproject.toml
@@ -16,7 +16,7 @@ classifiers = [
"Operating System :: OS Independent",
]
dependencies = [
- "autogen-core@{root:parent:parent:uri}",
+ "autogen-core@{root:parent:uri}/autogen-core",
"aiofiles",
"requests",
"mammoth",
@@ -128,9 +128,6 @@ include = [
"src",
"tests",
"examples",
- "../../benchmarks/HumanEval/Templates/TeamOne/scenario.py",
- "../../benchmarks/HumanEval/Templates/TwoAgents/scenario.py",
- "../../benchmarks/GAIA/Templates/TeamOne/scenario.py",
]
typeCheckingMode = "strict"
reportUnnecessaryIsInstance = false
diff --git a/python/teams/team-one/readme.md b/python/packages/team-one/readme.md
similarity index 100%
rename from python/teams/team-one/readme.md
rename to python/packages/team-one/readme.md
diff --git a/python/teams/team-one/src/team_one/__init__.py b/python/packages/team-one/src/team_one/__init__.py
similarity index 100%
rename from python/teams/team-one/src/team_one/__init__.py
rename to python/packages/team-one/src/team_one/__init__.py
diff --git a/python/teams/team-one/src/team_one/agents/__init__.py b/python/packages/team-one/src/team_one/agents/__init__.py
similarity index 100%
rename from python/teams/team-one/src/team_one/agents/__init__.py
rename to python/packages/team-one/src/team_one/agents/__init__.py
diff --git a/python/teams/team-one/src/team_one/agents/base_agent.py b/python/packages/team-one/src/team_one/agents/base_agent.py
similarity index 100%
rename from python/teams/team-one/src/team_one/agents/base_agent.py
rename to python/packages/team-one/src/team_one/agents/base_agent.py
diff --git a/python/teams/team-one/src/team_one/agents/base_orchestrator.py b/python/packages/team-one/src/team_one/agents/base_orchestrator.py
similarity index 100%
rename from python/teams/team-one/src/team_one/agents/base_orchestrator.py
rename to python/packages/team-one/src/team_one/agents/base_orchestrator.py
diff --git a/python/teams/team-one/src/team_one/agents/base_worker.py b/python/packages/team-one/src/team_one/agents/base_worker.py
similarity index 100%
rename from python/teams/team-one/src/team_one/agents/base_worker.py
rename to python/packages/team-one/src/team_one/agents/base_worker.py
diff --git a/python/teams/team-one/src/team_one/agents/coder.py b/python/packages/team-one/src/team_one/agents/coder.py
similarity index 100%
rename from python/teams/team-one/src/team_one/agents/coder.py
rename to python/packages/team-one/src/team_one/agents/coder.py
diff --git a/python/teams/team-one/src/team_one/agents/file_surfer/__init__.py b/python/packages/team-one/src/team_one/agents/file_surfer/__init__.py
similarity index 100%
rename from python/teams/team-one/src/team_one/agents/file_surfer/__init__.py
rename to python/packages/team-one/src/team_one/agents/file_surfer/__init__.py
diff --git a/python/teams/team-one/src/team_one/agents/file_surfer/_tools.py b/python/packages/team-one/src/team_one/agents/file_surfer/_tools.py
similarity index 100%
rename from python/teams/team-one/src/team_one/agents/file_surfer/_tools.py
rename to python/packages/team-one/src/team_one/agents/file_surfer/_tools.py
diff --git a/python/teams/team-one/src/team_one/agents/file_surfer/file_surfer.py b/python/packages/team-one/src/team_one/agents/file_surfer/file_surfer.py
similarity index 100%
rename from python/teams/team-one/src/team_one/agents/file_surfer/file_surfer.py
rename to python/packages/team-one/src/team_one/agents/file_surfer/file_surfer.py
diff --git a/python/teams/team-one/src/team_one/agents/multimodal_web_surfer/__init__.py b/python/packages/team-one/src/team_one/agents/multimodal_web_surfer/__init__.py
similarity index 100%
rename from python/teams/team-one/src/team_one/agents/multimodal_web_surfer/__init__.py
rename to python/packages/team-one/src/team_one/agents/multimodal_web_surfer/__init__.py
diff --git a/python/teams/team-one/src/team_one/agents/multimodal_web_surfer/multimodal_web_surfer.py b/python/packages/team-one/src/team_one/agents/multimodal_web_surfer/multimodal_web_surfer.py
similarity index 100%
rename from python/teams/team-one/src/team_one/agents/multimodal_web_surfer/multimodal_web_surfer.py
rename to python/packages/team-one/src/team_one/agents/multimodal_web_surfer/multimodal_web_surfer.py
diff --git a/python/teams/team-one/src/team_one/agents/multimodal_web_surfer/page_script.js b/python/packages/team-one/src/team_one/agents/multimodal_web_surfer/page_script.js
similarity index 100%
rename from python/teams/team-one/src/team_one/agents/multimodal_web_surfer/page_script.js
rename to python/packages/team-one/src/team_one/agents/multimodal_web_surfer/page_script.js
diff --git a/python/teams/team-one/src/team_one/agents/multimodal_web_surfer/set_of_mark.py b/python/packages/team-one/src/team_one/agents/multimodal_web_surfer/set_of_mark.py
similarity index 100%
rename from python/teams/team-one/src/team_one/agents/multimodal_web_surfer/set_of_mark.py
rename to python/packages/team-one/src/team_one/agents/multimodal_web_surfer/set_of_mark.py
diff --git a/python/teams/team-one/src/team_one/agents/multimodal_web_surfer/tool_definitions.py b/python/packages/team-one/src/team_one/agents/multimodal_web_surfer/tool_definitions.py
similarity index 100%
rename from python/teams/team-one/src/team_one/agents/multimodal_web_surfer/tool_definitions.py
rename to python/packages/team-one/src/team_one/agents/multimodal_web_surfer/tool_definitions.py
diff --git a/python/teams/team-one/src/team_one/agents/multimodal_web_surfer/types.py b/python/packages/team-one/src/team_one/agents/multimodal_web_surfer/types.py
similarity index 100%
rename from python/teams/team-one/src/team_one/agents/multimodal_web_surfer/types.py
rename to python/packages/team-one/src/team_one/agents/multimodal_web_surfer/types.py
diff --git a/python/teams/team-one/src/team_one/agents/orchestrator.py b/python/packages/team-one/src/team_one/agents/orchestrator.py
similarity index 100%
rename from python/teams/team-one/src/team_one/agents/orchestrator.py
rename to python/packages/team-one/src/team_one/agents/orchestrator.py
diff --git a/python/teams/team-one/src/team_one/agents/orchestrator_prompts.py b/python/packages/team-one/src/team_one/agents/orchestrator_prompts.py
similarity index 100%
rename from python/teams/team-one/src/team_one/agents/orchestrator_prompts.py
rename to python/packages/team-one/src/team_one/agents/orchestrator_prompts.py
diff --git a/python/teams/team-one/src/team_one/agents/reflex_agents.py b/python/packages/team-one/src/team_one/agents/reflex_agents.py
similarity index 100%
rename from python/teams/team-one/src/team_one/agents/reflex_agents.py
rename to python/packages/team-one/src/team_one/agents/reflex_agents.py
diff --git a/python/teams/team-one/src/team_one/agents/user_proxy.py b/python/packages/team-one/src/team_one/agents/user_proxy.py
similarity index 100%
rename from python/teams/team-one/src/team_one/agents/user_proxy.py
rename to python/packages/team-one/src/team_one/agents/user_proxy.py
diff --git a/python/teams/team-one/src/team_one/markdown_browser/__init__.py b/python/packages/team-one/src/team_one/markdown_browser/__init__.py
similarity index 100%
rename from python/teams/team-one/src/team_one/markdown_browser/__init__.py
rename to python/packages/team-one/src/team_one/markdown_browser/__init__.py
diff --git a/python/teams/team-one/src/team_one/markdown_browser/abstract_markdown_browser.py b/python/packages/team-one/src/team_one/markdown_browser/abstract_markdown_browser.py
similarity index 100%
rename from python/teams/team-one/src/team_one/markdown_browser/abstract_markdown_browser.py
rename to python/packages/team-one/src/team_one/markdown_browser/abstract_markdown_browser.py
diff --git a/python/teams/team-one/src/team_one/markdown_browser/markdown_search.py b/python/packages/team-one/src/team_one/markdown_browser/markdown_search.py
similarity index 100%
rename from python/teams/team-one/src/team_one/markdown_browser/markdown_search.py
rename to python/packages/team-one/src/team_one/markdown_browser/markdown_search.py
diff --git a/python/teams/team-one/src/team_one/markdown_browser/mdconvert.py b/python/packages/team-one/src/team_one/markdown_browser/mdconvert.py
similarity index 100%
rename from python/teams/team-one/src/team_one/markdown_browser/mdconvert.py
rename to python/packages/team-one/src/team_one/markdown_browser/mdconvert.py
diff --git a/python/teams/team-one/src/team_one/markdown_browser/requests_markdown_browser.py b/python/packages/team-one/src/team_one/markdown_browser/requests_markdown_browser.py
similarity index 100%
rename from python/teams/team-one/src/team_one/markdown_browser/requests_markdown_browser.py
rename to python/packages/team-one/src/team_one/markdown_browser/requests_markdown_browser.py
diff --git a/python/teams/team-one/src/team_one/messages.py b/python/packages/team-one/src/team_one/messages.py
similarity index 100%
rename from python/teams/team-one/src/team_one/messages.py
rename to python/packages/team-one/src/team_one/messages.py
diff --git a/python/teams/team-one/src/team_one/py.typed b/python/packages/team-one/src/team_one/py.typed
similarity index 100%
rename from python/teams/team-one/src/team_one/py.typed
rename to python/packages/team-one/src/team_one/py.typed
diff --git a/python/teams/team-one/src/team_one/utils.py b/python/packages/team-one/src/team_one/utils.py
similarity index 100%
rename from python/teams/team-one/src/team_one/utils.py
rename to python/packages/team-one/src/team_one/utils.py
diff --git a/python/teams/team-one/tests/browser_utils/test_bing_markdown_search.py b/python/packages/team-one/tests/browser_utils/test_bing_markdown_search.py
similarity index 100%
rename from python/teams/team-one/tests/browser_utils/test_bing_markdown_search.py
rename to python/packages/team-one/tests/browser_utils/test_bing_markdown_search.py
diff --git a/python/teams/team-one/tests/browser_utils/test_files/test.docx b/python/packages/team-one/tests/browser_utils/test_files/test.docx
similarity index 100%
rename from python/teams/team-one/tests/browser_utils/test_files/test.docx
rename to python/packages/team-one/tests/browser_utils/test_files/test.docx
diff --git a/python/teams/team-one/tests/browser_utils/test_files/test.jpg b/python/packages/team-one/tests/browser_utils/test_files/test.jpg
similarity index 100%
rename from python/teams/team-one/tests/browser_utils/test_files/test.jpg
rename to python/packages/team-one/tests/browser_utils/test_files/test.jpg
diff --git a/python/teams/team-one/tests/browser_utils/test_files/test.pptx b/python/packages/team-one/tests/browser_utils/test_files/test.pptx
similarity index 100%
rename from python/teams/team-one/tests/browser_utils/test_files/test.pptx
rename to python/packages/team-one/tests/browser_utils/test_files/test.pptx
diff --git a/python/teams/team-one/tests/browser_utils/test_files/test.xlsx b/python/packages/team-one/tests/browser_utils/test_files/test.xlsx
similarity index 100%
rename from python/teams/team-one/tests/browser_utils/test_files/test.xlsx
rename to python/packages/team-one/tests/browser_utils/test_files/test.xlsx
diff --git a/python/teams/team-one/tests/browser_utils/test_files/test_blog.html b/python/packages/team-one/tests/browser_utils/test_files/test_blog.html
similarity index 100%
rename from python/teams/team-one/tests/browser_utils/test_files/test_blog.html
rename to python/packages/team-one/tests/browser_utils/test_files/test_blog.html
diff --git a/python/teams/team-one/tests/browser_utils/test_files/test_serp.html b/python/packages/team-one/tests/browser_utils/test_files/test_serp.html
similarity index 100%
rename from python/teams/team-one/tests/browser_utils/test_files/test_serp.html
rename to python/packages/team-one/tests/browser_utils/test_files/test_serp.html
diff --git a/python/teams/team-one/tests/browser_utils/test_files/test_wikipedia.html b/python/packages/team-one/tests/browser_utils/test_files/test_wikipedia.html
similarity index 100%
rename from python/teams/team-one/tests/browser_utils/test_files/test_wikipedia.html
rename to python/packages/team-one/tests/browser_utils/test_files/test_wikipedia.html
diff --git a/python/teams/team-one/tests/browser_utils/test_mdconvert.py b/python/packages/team-one/tests/browser_utils/test_mdconvert.py
similarity index 100%
rename from python/teams/team-one/tests/browser_utils/test_mdconvert.py
rename to python/packages/team-one/tests/browser_utils/test_mdconvert.py
diff --git a/python/teams/team-one/tests/browser_utils/test_requests_markdown_browser.py b/python/packages/team-one/tests/browser_utils/test_requests_markdown_browser.py
similarity index 99%
rename from python/teams/team-one/tests/browser_utils/test_requests_markdown_browser.py
rename to python/packages/team-one/tests/browser_utils/test_requests_markdown_browser.py
index 01e607fd2..2ccb2f7ab 100644
--- a/python/teams/team-one/tests/browser_utils/test_requests_markdown_browser.py
+++ b/python/packages/team-one/tests/browser_utils/test_requests_markdown_browser.py
@@ -29,7 +29,7 @@ PDF_STRING = "Figure 1: AutoGen enables diverse LLM-based applications using mul
DIR_TEST_STRINGS = [
"# Index of ",
"[.. (parent directory)]",
- "/python/teams/team-one/tests/browser_utils",
+ "/python/packages/team-one/tests/browser_utils",
]
LOCAL_FILE_TEST_STRINGS = [
diff --git a/python/teams/team-one/tests/headless_web_surfer/conftest.py b/python/packages/team-one/tests/headless_web_surfer/conftest.py
similarity index 100%
rename from python/teams/team-one/tests/headless_web_surfer/conftest.py
rename to python/packages/team-one/tests/headless_web_surfer/conftest.py
diff --git a/python/teams/team-one/tests/headless_web_surfer/test_web_surfer.py b/python/packages/team-one/tests/headless_web_surfer/test_web_surfer.py
similarity index 100%
rename from python/teams/team-one/tests/headless_web_surfer/test_web_surfer.py
rename to python/packages/team-one/tests/headless_web_surfer/test_web_surfer.py
diff --git a/python/teams/team-one/tests/test_example.py b/python/packages/team-one/tests/test_example.py
similarity index 100%
rename from python/teams/team-one/tests/test_example.py
rename to python/packages/team-one/tests/test_example.py
diff --git a/python/samples/demos/chat_room.py b/python/samples/demos/chat_room.py
deleted file mode 100644
index 350e86366..000000000
--- a/python/samples/demos/chat_room.py
+++ /dev/null
@@ -1,166 +0,0 @@
-import argparse
-import asyncio
-import json
-import logging
-import os
-import sys
-
-from autogen_core.application import SingleThreadedAgentRuntime
-from autogen_core.base import AgentId, AgentInstantiationContext, AgentProxy, AgentRuntime
-from autogen_core.components import DefaultSubscription, DefaultTopicId, RoutedAgent, message_handler
-from autogen_core.components.memory import ChatMemory
-from autogen_core.components.models import ChatCompletionClient, SystemMessage
-
-sys.path.append(os.path.abspath(os.path.dirname(__file__)))
-sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
-
-from autogen_core.base import MessageContext
-from common.memory import BufferedChatMemory
-from common.types import Message, TextMessage
-from common.utils import convert_messages_to_llm_messages, get_chat_completion_client_from_envs
-from utils import TextualChatApp, TextualUserAgent
-
-
-# Define a custom agent that can handle chat room messages.
-class ChatRoomAgent(RoutedAgent):
- def __init__(
- self,
- name: str,
- description: str,
- background_story: str,
- memory: ChatMemory[Message],
- model_client: ChatCompletionClient,
- ) -> None:
- super().__init__(description)
- system_prompt = f"""Your name is {name}.
-Your background story is:
-{background_story}
-
-Now you are in a chat room with other users.
-You can send messages to the chat room by typing your message below.
-You do not need to respond to every message.
-Use the following JSON format to provide your thought on the latest message and choose whether to respond:
-{{
- "thought": "Your thought on the message",
- "respond": <true/false>,
- "response": "Your response to the message or None if you choose not to respond."
-}}
-"""
- self._system_messages = [SystemMessage(system_prompt)]
- self._memory = memory
- self._client = model_client
-
- @message_handler()
- async def on_chat_room_message(self, message: TextMessage, ctx: MessageContext) -> None:
- # Save the message to memory as structured JSON.
- from_message = TextMessage(
- content=json.dumps({"sender": message.source, "content": message.content}), source=message.source
- )
- await self._memory.add_message(from_message)
-
- # Get a response from the model.
- raw_response = await self._client.create(
- self._system_messages
- + convert_messages_to_llm_messages(await self._memory.get_messages(), self_name=self.metadata["type"]),
- json_output=True,
- )
- assert isinstance(raw_response.content, str)
-
- # Save the response to memory.
- await self._memory.add_message(TextMessage(source=self.metadata["type"], content=raw_response.content))
-
- # Parse the response.
- data = json.loads(raw_response.content)
- respond = data.get("respond")
- response = data.get("response")
-
- # Publish the response if needed.
- if respond is True or str(respond).lower().strip() == "true":
- await self.publish_message(
- TextMessage(source=self.metadata["type"], content=str(response)), topic_id=DefaultTopicId()
- )
-
-
-class ChatRoomUserAgent(TextualUserAgent):
- """An agent that is used to receive messages from the runtime."""
-
- @message_handler
- async def on_chat_room_message(self, message: TextMessage, ctx: MessageContext) -> None:
- await self._app.post_runtime_message(message)
-
-
-# Define a chat room with participants -- the runtime is the chat room.
-async def chat_room(runtime: AgentRuntime, app: TextualChatApp) -> None:
- await runtime.register(
- "User",
- lambda: ChatRoomUserAgent(
- description="The user in the chat room.",
- app=app,
- ),
- lambda: [DefaultSubscription()],
- )
- await runtime.register(
- "Alice",
- lambda: ChatRoomAgent(
- name=AgentInstantiationContext.current_agent_id().type,
- description="Alice in the chat room.",
- background_story="Alice is a software engineer who loves to code.",
- memory=BufferedChatMemory(buffer_size=10),
- model_client=get_chat_completion_client_from_envs(model="gpt-4-turbo"),
- ),
- lambda: [DefaultSubscription()],
- )
- alice = AgentProxy(AgentId("Alice", "default"), runtime)
- await runtime.register(
- "Bob",
- lambda: ChatRoomAgent(
- name=AgentInstantiationContext.current_agent_id().type,
- description="Bob in the chat room.",
- background_story="Bob is a data scientist who loves to analyze data.",
- memory=BufferedChatMemory(buffer_size=10),
- model_client=get_chat_completion_client_from_envs(model="gpt-4-turbo"),
- ),
- lambda: [DefaultSubscription()],
- )
- bob = AgentProxy(AgentId("Bob", "default"), runtime)
- await runtime.register(
- "Charlie",
- lambda: ChatRoomAgent(
- name=AgentInstantiationContext.current_agent_id().type,
- description="Charlie in the chat room.",
- background_story="Charlie is a designer who loves to create art.",
- memory=BufferedChatMemory(buffer_size=10),
- model_client=get_chat_completion_client_from_envs(model="gpt-4-turbo"),
- ),
- lambda: [DefaultSubscription()],
- )
- charlie = AgentProxy(AgentId("Charlie", "default"), runtime)
- app.welcoming_notice = f"""Welcome to the chat room demo with the following participants:
-1. πŸ‘§ {alice.id.type}: {(await alice.metadata)['description']}
-2. πŸ‘±πŸΌβ€β™‚οΈ {bob.id.type}: {(await bob.metadata)['description']}
-3. πŸ‘¨πŸΎβ€πŸ¦³ {charlie.id.type}: {(await charlie.metadata)['description']}
-
-Each participant decides on its own whether to respond to the latest message.
-
-You can greet the chat room by typing your first message below.
-"""
-
-
-async def main() -> None:
- runtime = SingleThreadedAgentRuntime()
- app = TextualChatApp(runtime, user_name="You")
- await chat_room(runtime, app)
- runtime.start()
- await app.run_async()
-
-
-if __name__ == "__main__":
- parser = argparse.ArgumentParser(description="Chat room demo with self-driving AI agents.")
- parser.add_argument("--verbose", action="store_true", help="Enable verbose logging.")
- args = parser.parse_args()
- if args.verbose:
- logging.basicConfig(level=logging.WARNING)
- logging.getLogger("autogen_core").setLevel(logging.DEBUG)
- handler = logging.FileHandler("chat_room.log")
- logging.getLogger("autogen_core").addHandler(handler)
- asyncio.run(main())
diff --git a/python/samples/demos/illustrator_critics.py b/python/samples/demos/illustrator_critics.py
deleted file mode 100644
index 7a3c2447e..000000000
--- a/python/samples/demos/illustrator_critics.py
+++ /dev/null
@@ -1,122 +0,0 @@
-import argparse
-import asyncio
-import logging
-import os
-import sys
-
-import openai
-from autogen_core.application import SingleThreadedAgentRuntime
-from autogen_core.base import AgentInstantiationContext, AgentRuntime
-from autogen_core.components.models import SystemMessage
-
-sys.path.append(os.path.abspath(os.path.dirname(__file__)))
-sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
-
-from autogen_core.base import AgentId, AgentProxy
-from common.agents import ChatCompletionAgent, ImageGenerationAgent
-from common.memory import BufferedChatMemory
-from common.patterns._group_chat_manager import GroupChatManager
-from common.utils import get_chat_completion_client_from_envs
-from utils import TextualChatApp, TextualUserAgent
-
-
-async def illustrator_critics(runtime: AgentRuntime, app: TextualChatApp) -> None:
- await runtime.register(
- "User",
- lambda: TextualUserAgent(
- description="A user looking for illustration.",
- app=app,
- ),
- )
- await runtime.register(
- "Descriptor",
- lambda: ChatCompletionAgent(
- description="An AI agent that provides a description of the image.",
- system_messages=[
- SystemMessage(
- "You create short description for image. \n"
- "In this conversation, you will be given either: \n"
- "1. Request for new image. \n"
- "2. Feedback on some image created. \n"
- "In both cases, you will provide a description of a new image to be created. \n"
- "Only provide the description of the new image and nothing else. \n"
- "Be succinct and precise."
- ),
- ],
- memory=BufferedChatMemory(buffer_size=10),
- model_client=get_chat_completion_client_from_envs(model="gpt-4-turbo", max_tokens=500),
- ),
- )
- descriptor = AgentProxy(AgentId("Descriptor", "default"), runtime)
- await runtime.register(
- "Illustrator",
- lambda: ImageGenerationAgent(
- description="An AI agent that generates images.",
- client=openai.AsyncOpenAI(),
- model="dall-e-3",
- memory=BufferedChatMemory(buffer_size=1),
- ),
- )
- illustrator = AgentProxy(AgentId("Illustrator", "default"), runtime)
- await runtime.register(
- "Critic",
- lambda: ChatCompletionAgent(
- description="An AI agent that provides feedback on images given user's requirements.",
- system_messages=[
- SystemMessage(
- "You are an expert in image understanding. \n"
- "In this conversation, you will judge an image given the description and provide feedback. \n"
- "Pay attention to the details like the spelling of words and number of objects. \n"
- "Use the following format in your response: \n"
- "Number of each object type in the image: <Type 1 (e.g., Husky Dog)>: 1, <Type 2>: 2, ...\n"
- "Feedback: <Your feedback here> \n"
- "Approval: <APPROVE or REVISE> \n"
- ),
- ],
- memory=BufferedChatMemory(buffer_size=2),
- model_client=get_chat_completion_client_from_envs(model="gpt-4-turbo"),
- ),
- )
- critic = AgentProxy(AgentId("Critic", "default"), runtime)
- await runtime.register(
- "GroupChatManager",
- lambda: GroupChatManager(
- description="A chat manager that handles group chat.",
- memory=BufferedChatMemory(buffer_size=5),
- participants=[
- AgentId("Illustrator", AgentInstantiationContext.current_agent_id().key),
- AgentId("Descriptor", AgentInstantiationContext.current_agent_id().key),
- AgentId("Critic", AgentInstantiationContext.current_agent_id().key),
- ],
- termination_word="APPROVE",
- ),
- )
-
- app.welcoming_notice = f"""You are now in a group chat with the following agents:
-
-1. πŸ€– {(await descriptor.metadata)['type']}: {(await descriptor.metadata).get('description')}
-2. πŸ€– {(await illustrator.metadata)['type']}: {(await illustrator.metadata).get('description')}
-3. πŸ€– {(await critic.metadata)['type']}: {(await critic.metadata).get('description')}
-
-Provide a prompt for the illustrator to generate an image.
-"""
-
-
-async def main() -> None:
- runtime = SingleThreadedAgentRuntime()
- app = TextualChatApp(runtime, user_name="You")
- await illustrator_critics(runtime, app)
- runtime.start()
- await app.run_async()
-
-
-if __name__ == "__main__":
- parser = argparse.ArgumentParser(description="Illustrator-critics pattern for image generation demo.")
- parser.add_argument("--verbose", action="store_true", help="Enable verbose logging.")
- args = parser.parse_args()
- if args.verbose:
- logging.basicConfig(level=logging.WARNING)
- logging.getLogger("autogen_core").setLevel(logging.DEBUG)
- handler = logging.FileHandler("illustrator_critics.log")
- logging.getLogger("autogen_core").addHandler(handler)
- asyncio.run(main())
diff --git a/python/samples/demos/software_consultancy.py b/python/samples/demos/software_consultancy.py
deleted file mode 100644
index 5ac071a65..000000000
--- a/python/samples/demos/software_consultancy.py
+++ /dev/null
@@ -1,305 +0,0 @@
-"""This is an example demonstrates event-driven orchestration using a
-group chat manager agnent.
-
-WARNING: do not run this example in your local machine as it involves
-executing arbitrary code. Use a secure environment like a docker container
-or GitHub Codespaces to run this example.
-"""
-
-import argparse
-import asyncio
-import base64
-import logging
-import os
-import sys
-
-import aiofiles
-import aiohttp
-import openai
-from autogen_core.application import SingleThreadedAgentRuntime
-from autogen_core.base import AgentInstantiationContext, AgentRuntime
-from autogen_core.components.models import SystemMessage
-from autogen_core.components.tools import FunctionTool
-from markdownify import markdownify # type: ignore
-from tqdm import tqdm
-from typing_extensions import Annotated
-
-sys.path.append(os.path.abspath(os.path.dirname(__file__)))
-sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
-
-from autogen_core.base import AgentId
-from common.agents import ChatCompletionAgent
-from common.memory import HeadAndTailChatMemory
-from common.patterns._group_chat_manager import GroupChatManager
-from common.utils import get_chat_completion_client_from_envs
-from utils import TextualChatApp, TextualUserAgent
-
-
-async def write_file(filename: str, content: str) -> str:
- async with aiofiles.open(filename, "w") as file:
- await file.write(content)
- return f"Content written to {filename}."
-
-
-async def execute_command(command: str) -> Annotated[str, "The standard output and error of the executed command."]:
- process = await asyncio.subprocess.create_subprocess_shell(
- command,
- stdout=asyncio.subprocess.PIPE,
- stderr=asyncio.subprocess.PIPE,
- )
- stdout, stderr = await process.communicate()
- return f"stdout: {stdout.decode()}\nstderr: {stderr.decode()}"
-
-
-async def read_file(filename: str) -> Annotated[str, "The content of the file."]:
- async with aiofiles.open(filename, "r") as file:
- return await file.read()
-
-
-async def remove_file(filename: str) -> str:
- process = await asyncio.subprocess.create_subprocess_exec("rm", filename)
- await process.wait()
- if process.returncode != 0:
- raise ValueError(f"Error occurred while removing file: {filename}")
- return f"File removed: {filename}."
-
-
-async def list_files(directory: str) -> Annotated[str, "The list of files in the directory."]:
- # Ask for confirmation first.
- # await confirm(f"Are you sure you want to list files in {directory}?")
- process = await asyncio.subprocess.create_subprocess_exec(
- "ls",
- directory,
- stdout=asyncio.subprocess.PIPE,
- stderr=asyncio.subprocess.PIPE,
- )
- stdout, stderr = await process.communicate()
- if stderr:
- raise ValueError(f"Error occurred while listing files: {stderr.decode()}")
- return stdout.decode()
-
-
-async def browse_web(url: str) -> Annotated[str, "The content of the web page in Markdown format."]:
- async with aiohttp.ClientSession() as session:
- async with session.get(url) as response:
- html = await response.text()
- markdown = markdownify(html) # type: ignore
- if isinstance(markdown, str):
- return markdown
- return f"Unable to parse content from {url}."
-
-
-async def create_image(
- description: Annotated[str, "Describe the image to create"],
- filename: Annotated[str, "The path to save the created image"],
-) -> str:
- # Use Dalle to generate an image from the description.
- with tqdm(desc="Generating image...", leave=False) as pbar:
- client = openai.AsyncClient()
- response = await client.images.generate(model="dall-e-2", prompt=description, response_format="b64_json")
- pbar.close()
- assert len(response.data) > 0 and response.data[0].b64_json is not None
- # Save the image to a file.
- async with aiofiles.open(filename, "wb") as file:
- image_data = base64.b64decode(response.data[0].b64_json)
- await file.write(image_data)
- return f"Image created and saved to {filename}."
-
-
-async def software_consultancy(runtime: AgentRuntime, app: TextualChatApp) -> None: # type: ignore
- await runtime.register(
- "Customer",
- lambda: TextualUserAgent(
- description="A customer looking for help.",
- app=app,
- ),
- )
- await runtime.register(
- "Developer",
- lambda: ChatCompletionAgent(
- description="A Python software developer.",
- system_messages=[
- SystemMessage(
- "Your are a Python developer. \n"
- "You can read, write, and execute code. \n"
- "You can browse files and directories. \n"
- "You can also browse the web for documentation. \n"
- "You are entering a work session with the customer, product manager, UX designer, and illustrator. \n"
- "When you are given a task, you should immediately start working on it. \n"
- "Be concise and deliver now."
- )
- ],
- model_client=get_chat_completion_client_from_envs(model="gpt-4-turbo"),
- memory=HeadAndTailChatMemory(head_size=1, tail_size=10),
- tools=[
- FunctionTool(
- write_file,
- name="write_file",
- description="Write code to a file.",
- ),
- FunctionTool(
- read_file,
- name="read_file",
- description="Read code from a file.",
- ),
- FunctionTool(
- execute_command,
- name="execute_command",
- description="Execute a unix shell command.",
- ),
- FunctionTool(list_files, name="list_files", description="List files in a directory."),
- FunctionTool(browse_web, name="browse_web", description="Browse a web page."),
- ],
- tool_approver=AgentId("Customer", AgentInstantiationContext.current_agent_id().key),
- ),
- )
-
- await runtime.register(
- "ProductManager",
- lambda: ChatCompletionAgent(
- description="A product manager. "
- "Responsible for interfacing with the customer, planning and managing the project. ",
- system_messages=[
- SystemMessage(
- "You are a product manager. \n"
- "You can browse files and directories. \n"
- "You are entering a work session with the customer, developer, UX designer, and illustrator. \n"
- "Keep the project on track. Don't hire any more people. \n"
- "When a milestone is reached, stop and ask for customer feedback. Make sure the customer is satisfied. \n"
- "Be VERY concise."
- )
- ],
- model_client=get_chat_completion_client_from_envs(model="gpt-4-turbo"),
- memory=HeadAndTailChatMemory(head_size=1, tail_size=10),
- tools=[
- FunctionTool(
- read_file,
- name="read_file",
- description="Read from a file.",
- ),
- FunctionTool(list_files, name="list_files", description="List files in a directory."),
- FunctionTool(browse_web, name="browse_web", description="Browse a web page."),
- ],
- tool_approver=AgentId("Customer", AgentInstantiationContext.current_agent_id().key),
- ),
- )
- await runtime.register(
- "UserExperienceDesigner",
- lambda: ChatCompletionAgent(
- description="A user experience designer for creating user interfaces.",
- system_messages=[
- SystemMessage(
- "You are a user experience designer. \n"
- "You can create user interfaces from descriptions. \n"
- "You can browse files and directories. \n"
- "You are entering a work session with the customer, developer, product manager, and illustrator. \n"
- "When you are given a task, you should immediately start working on it. \n"
- "Be concise and deliver now."
- )
- ],
- model_client=get_chat_completion_client_from_envs(model="gpt-4-turbo"),
- memory=HeadAndTailChatMemory(head_size=1, tail_size=10),
- tools=[
- FunctionTool(
- write_file,
- name="write_file",
- description="Write code to a file.",
- ),
- FunctionTool(
- read_file,
- name="read_file",
- description="Read code from a file.",
- ),
- FunctionTool(list_files, name="list_files", description="List files in a directory."),
- ],
- tool_approver=AgentId("Customer", AgentInstantiationContext.current_agent_id().key),
- ),
- )
-
- await runtime.register(
- "Illustrator",
- lambda: ChatCompletionAgent(
- description="An illustrator for creating images.",
- system_messages=[
- SystemMessage(
- "You are an illustrator. "
- "You can create images from descriptions. "
- "You are entering a work session with the customer, developer, product manager, and UX designer. \n"
- "When you are given a task, you should immediately start working on it. \n"
- "Be concise and deliver now."
- )
- ],
- model_client=get_chat_completion_client_from_envs(model="gpt-4-turbo"),
- memory=HeadAndTailChatMemory(head_size=1, tail_size=10),
- tools=[
- FunctionTool(
- create_image,
- name="create_image",
- description="Create an image from a description.",
- ),
- ],
- tool_approver=AgentId("Customer", AgentInstantiationContext.current_agent_id().key),
- ),
- )
- await runtime.register(
- "GroupChatManager",
- lambda: GroupChatManager(
- description="A group chat manager.",
- memory=HeadAndTailChatMemory(head_size=1, tail_size=10),
- model_client=get_chat_completion_client_from_envs(model="gpt-4-turbo"),
- participants=[
- AgentId("Developer", AgentInstantiationContext.current_agent_id().key),
- AgentId("ProductManager", AgentInstantiationContext.current_agent_id().key),
- AgentId("UserExperienceDesigner", AgentInstantiationContext.current_agent_id().key),
- AgentId("Illustrator", AgentInstantiationContext.current_agent_id().key),
- AgentId("Customer", AgentInstantiationContext.current_agent_id().key),
- ],
- ),
- )
- art = r"""
-+----------------------------------------------------------+
-| ____ __ _ |
-| / ___| ___ / _| |___ ____ _ _ __ ___ |
-| \___ \ / _ \| |_| __\ \ /\ / / _` | '__/ _ \ |
-| ___) | (_) | _| |_ \ V V / (_| | | | __/ |
-| |____/ \___/|_| \__| \_/\_/ \__,_|_| \___| |
-| |
-| ____ _ _ |
-| / ___|___ _ __ ___ _ _| | |_ __ _ _ __ ___ _ _ |
-| | | / _ \| '_ \/ __| | | | | __/ _` | '_ \ / __| | | | |
-| | |__| (_) | | | \__ \ |_| | | || (_| | | | | (__| |_| | |
-| \____\___/|_| |_|___/\__,_|_|\__\__,_|_| |_|\___|\__, | |
-| |___/ |
-| |
-| Work with a software development consultancy to create |
-| your own Python application. You are working with a team |
-| of the following agents: |
-| 1. πŸ€– Developer: A Python software developer. |
-| 2. πŸ€– ProductManager: A product manager. |
-| 3. πŸ€– UserExperienceDesigner: A user experience designer. |
-| 4. πŸ€– Illustrator: An illustrator. |
-+----------------------------------------------------------+
-"""
- app.welcoming_notice = art
-
-
-async def main() -> None:
- runtime = SingleThreadedAgentRuntime()
- app = TextualChatApp(runtime, user_name="You")
- await software_consultancy(runtime, app)
- # Start the runtime.
- runtime.start()
- # Start the app.
- await app.run_async()
-
-
-if __name__ == "__main__":
- parser = argparse.ArgumentParser(description="Software consultancy demo.")
- parser.add_argument("--verbose", action="store_true", help="Enable verbose logging.")
- args = parser.parse_args()
- if args.verbose:
- logging.basicConfig(level=logging.WARNING)
- logging.getLogger("autogen_core").setLevel(logging.DEBUG)
- handler = logging.FileHandler("software_consultancy.log")
- logging.getLogger("autogen_core").addHandler(handler)
- asyncio.run(main())
diff --git a/python/samples/marketing-agents/app.py b/python/samples/marketing-agents/app.py
deleted file mode 100644
index 221b3313a..000000000
--- a/python/samples/marketing-agents/app.py
+++ /dev/null
@@ -1,34 +0,0 @@
-import os
-
-from auditor import AuditAgent
-from autogen_core.base import AgentRuntime
-from autogen_core.components import DefaultSubscription
-from autogen_core.components.models import AzureOpenAIChatCompletionClient
-from graphic_designer import GraphicDesignerAgent
-from openai import AsyncAzureOpenAI
-
-
-async def build_app(runtime: AgentRuntime) -> None:
- chat_client = AzureOpenAIChatCompletionClient(
- model="gpt-4-32",
- azure_endpoint=os.environ["CHAT_ENDPOINT"],
- api_version="2024-02-01",
- model_capabilities={
- "vision": True,
- "function_calling": True,
- "json_output": True,
- },
- api_key=os.environ["CHAT_ENDPOINT_KEY"],
- )
-
- image_client = AsyncAzureOpenAI(
- azure_endpoint=os.environ["IMAGE_ENDPOINT"],
- azure_deployment="dall-e-3",
- api_key=os.environ["IMAGE_ENDPOINT_KEY"],
- api_version="2024-02-01",
- )
-
- await runtime.register(
- "GraphicDesigner", lambda: GraphicDesignerAgent(client=image_client), lambda: [DefaultSubscription()]
- )
- await runtime.register("Auditor", lambda: AuditAgent(model_client=chat_client), lambda: [DefaultSubscription()])
diff --git a/python/samples/marketing-agents/auditor.py b/python/samples/marketing-agents/auditor.py
deleted file mode 100644
index e8b169438..000000000
--- a/python/samples/marketing-agents/auditor.py
+++ /dev/null
@@ -1,35 +0,0 @@
-from autogen_core.base import MessageContext
-from autogen_core.components import DefaultTopicId, RoutedAgent, message_handler
-from autogen_core.components.models import ChatCompletionClient
-from autogen_core.components.models._types import SystemMessage
-from messages import AuditorAlert, AuditText
-
-auditor_prompt = """You are an Auditor in a Marketing team
-Audit the text bello and make sure we do not give discounts larger than 10%
-If the text talks about a larger than 10% discount, reply with a message to the user saying that the discount is too large, and by company policy we are not allowed.
-If the message says who wrote it, add that information in the response as well
-In any other case, reply with NOTFORME
----
-Input: {input}
----
-"""
-
-
-class AuditAgent(RoutedAgent):
- def __init__(
- self,
- model_client: ChatCompletionClient,
- ) -> None:
- super().__init__("")
- self._model_client = model_client
-
- @message_handler
- async def handle_user_chat_input(self, message: AuditText, ctx: MessageContext) -> None:
- sys_prompt = auditor_prompt.format(input=message.text)
- completion = await self._model_client.create(messages=[SystemMessage(content=sys_prompt)])
- assert isinstance(completion.content, str)
- if "NOTFORME" in completion.content:
- return
- await self.publish_message(
- AuditorAlert(UserId=message.UserId, auditorAlertMessage=completion.content), topic_id=DefaultTopicId()
- )
diff --git a/python/samples/marketing-agents/graphic_designer.py b/python/samples/marketing-agents/graphic_designer.py
deleted file mode 100644
index 4da585ca3..000000000
--- a/python/samples/marketing-agents/graphic_designer.py
+++ /dev/null
@@ -1,41 +0,0 @@
-import logging
-from typing import Literal
-
-import openai
-from autogen_core.base import MessageContext
-from autogen_core.components import (
- DefaultTopicId,
- RoutedAgent,
- message_handler,
-)
-from messages import ArticleCreated, GraphicDesignCreated
-
-
-class GraphicDesignerAgent(RoutedAgent):
- def __init__(
- self,
- client: openai.AsyncClient,
- model: Literal["dall-e-2", "dall-e-3"] = "dall-e-3",
- ):
- super().__init__("")
- self._client = client
- self._model = model
-
- @message_handler
- async def handle_user_chat_input(self, message: ArticleCreated, ctx: MessageContext) -> None:
- logger = logging.getLogger("graphic_designer")
- try:
- logger.info(f"Asking model to generate an image for the article '{message.article}'.")
- response = await self._client.images.generate(
- model=self._model, prompt=message.article, response_format="url"
- )
- logger.info(f"Image response: '{response.data[0]}'")
- assert len(response.data) > 0 and response.data[0].url is not None
- image_uri = response.data[0].url
- logger.info(f"Generated image for article. Got response: '{image_uri}'")
-
- await self.publish_message(
- GraphicDesignCreated(UserId=message.UserId, imageUri=image_uri), topic_id=DefaultTopicId()
- )
- except Exception as e:
- logger.error(f"Failed to generate image for article. Error: {e}")
diff --git a/python/samples/marketing-agents/messages.py b/python/samples/marketing-agents/messages.py
deleted file mode 100644
index 9580d00c2..000000000
--- a/python/samples/marketing-agents/messages.py
+++ /dev/null
@@ -1,21 +0,0 @@
-from pydantic import BaseModel
-
-
-class ArticleCreated(BaseModel):
- UserId: str
- article: str
-
-
-class GraphicDesignCreated(BaseModel):
- UserId: str
- imageUri: str
-
-
-class AuditText(BaseModel):
- UserId: str
- text: str
-
-
-class AuditorAlert(BaseModel):
- UserId: str
- auditorAlertMessage: str
diff --git a/python/samples/marketing-agents/test_usage.py b/python/samples/marketing-agents/test_usage.py
deleted file mode 100644
index 30d936099..000000000
--- a/python/samples/marketing-agents/test_usage.py
+++ /dev/null
@@ -1,51 +0,0 @@
-import asyncio
-import os
-
-from app import build_app
-from autogen_core.application import SingleThreadedAgentRuntime
-from autogen_core.base import MessageContext
-from autogen_core.components import DefaultTopicId, Image, RoutedAgent, message_handler
-from dotenv import load_dotenv
-from messages import ArticleCreated, AuditorAlert, AuditText, GraphicDesignCreated
-
-
-class Printer(RoutedAgent):
- def __init__(
- self,
- ) -> None:
- super().__init__("")
-
- @message_handler
- async def handle_graphic_design(self, message: GraphicDesignCreated, ctx: MessageContext) -> None:
- image = Image.from_uri(message.imageUri)
- # Save image to random name in current directory
- image.image.save(os.path.join(os.getcwd(), f"{message.UserId}.png"))
- print(f"Received GraphicDesignCreated: user {message.UserId}, saved to {message.UserId}.png")
-
- @message_handler
- async def handle_auditor_alert(self, message: AuditorAlert, ctx: MessageContext) -> None:
- print(f"Received AuditorAlert: {message.auditorAlertMessage} for user {message.UserId}")
-
-
-async def main() -> None:
- runtime = SingleThreadedAgentRuntime()
- await build_app(runtime)
- await runtime.register("Printer", lambda: Printer())
-
- runtime.start()
-
- await runtime.publish_message(
- AuditText(text="Buy my product for a MASSIVE 50% discount.", UserId="user-1"), topic_id=DefaultTopicId()
- )
-
- await runtime.publish_message(
- ArticleCreated(article="The best article ever written about trees and rocks", UserId="user-2"),
- topic_id=DefaultTopicId(),
- )
-
- await runtime.stop_when_idle()
-
-
-if __name__ == "__main__":
- load_dotenv()
- asyncio.run(main())
diff --git a/python/samples/marketing-agents/worker.py b/python/samples/marketing-agents/worker.py
deleted file mode 100644
index e80a7dbd7..000000000
--- a/python/samples/marketing-agents/worker.py
+++ /dev/null
@@ -1,40 +0,0 @@
-import asyncio
-import logging
-
-from app import build_app
-from autogen_core.application import WorkerAgentRuntime
-from autogen_core.base import MESSAGE_TYPE_REGISTRY
-from dotenv import load_dotenv
-from messages import ArticleCreated, AuditorAlert, AuditText, GraphicDesignCreated
-
-agnext_logger = logging.getLogger("autogen_core")
-
-
-async def main() -> None:
- load_dotenv()
- runtime = WorkerAgentRuntime()
- MESSAGE_TYPE_REGISTRY.add_type(ArticleCreated)
- MESSAGE_TYPE_REGISTRY.add_type(GraphicDesignCreated)
- MESSAGE_TYPE_REGISTRY.add_type(AuditText)
- MESSAGE_TYPE_REGISTRY.add_type(AuditorAlert)
- agnext_logger.info("1")
- await runtime.start("localhost:5145")
-
- agnext_logger.info("2")
-
- await build_app(runtime)
- agnext_logger.info("3")
-
- # just to keep the runtime running
- try:
- await asyncio.sleep(1000000)
- except KeyboardInterrupt:
- pass
- await runtime.stop()
-
-
-if __name__ == "__main__":
- logging.basicConfig(level=logging.DEBUG)
- agnext_logger.setLevel(logging.DEBUG)
- agnext_logger.log(logging.DEBUG, "Starting worker")
- asyncio.run(main())