Skip to content

Migrate from pyautogen to ag2 Library #1012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/praisonai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ call = [
]
train = []
crewai = ["crewai>=0.32.0", "praisonai-tools>=0.0.22"]
autogen = ["pyautogen==0.2.29", "praisonai-tools>=0.0.22", "crewai"]
autogen = ["ag2==0.2.29", "praisonai-tools>=0.0.22", "crewai"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider consolidating dependency definitions. Optional dependencies (extras) are defined here in [project.optional-dependencies] and also in [tool.poetry.extras] (e.g., line 289). The [tool.poetry.extras] section is a legacy way of defining extras in Poetry and maintaining both can lead to inconsistencies. To improve maintainability, remove the [tool.poetry.extras] section entirely and rely only on [project.optional-dependencies].

autogen-v4 = [
"autogen-agentchat>=0.4.0",
"autogen-ext[openai]>=0.4.0",
Expand Down Expand Up @@ -125,7 +125,7 @@ python-dotenv = ">=0.19.0"
instructor = ">=1.3.3"
PyYAML = ">=6.0"
mcp = ">=1.6.0"
pyautogen = {version = "==0.2.29", optional = true}
ag2 = {version = "==0.2.29", optional = true}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency and adherence to modern packaging standards (PEP 621), define all dependencies under the [project] table. This would mean moving dependencies from [tool.poetry.dependencies] to [project.dependencies] to centralize dependency management and make the pyproject.toml easier to understand and maintain.

autogen-agentchat = {version = ">=0.4.0", optional = true}
autogen-ext = {version = ">=0.4.0", optional = true}
autogen-core = {version = ">=0.4.0", optional = true}
Expand Down Expand Up @@ -286,7 +286,7 @@ call = [
"openai",
]
crewai = ["crewai", "praisonai-tools"]
autogen = ["pyautogen", "praisonai-tools", "crewai"]
autogen = ["ag2", "praisonai-tools", "crewai"]
autogen-v4 = ["autogen-agentchat", "autogen-ext", "autogen-core", "praisonai-tools", "crewai"]

[tool.poetry-dynamic-versioning]
Expand Down
4 changes: 2 additions & 2 deletions src/praisonai/tests/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ python -m pytest tests/integration/autogen/test_autogen_basic.py::TestAutoGenInt

### Required for AutoGen Tests:
```bash
pip install pyautogen
pip install ag2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The installation instruction is incomplete. According to pyproject.toml, the autogen extra also requires praisonai-tools and crewai. Use pip install .[autogen] from the project root to install all necessary dependencies for these tests.

Suggested change
pip install ag2
pip install .[autogen]

```

### Required for CrewAI Tests:
Expand Down Expand Up @@ -251,7 +251,7 @@ To add tests for a new framework (e.g., `langchain`):
```
ImportError: No module named 'autogen'
```
**Solution:** Install the framework: `pip install pyautogen`
**Solution:** Install the framework: `pip install ag2`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This solution is incomplete. While pip install ag2 might resolve the ImportError for the autogen module, the tests require other dependencies as well. Point to the correct installation method for all test dependencies.

Suggested change
**Solution:** Install the framework: `pip install ag2`
**Solution:** Install the framework dependencies: `pip install .[autogen]`


**Path Issues:**
```
Expand Down
Loading