-
-
Notifications
You must be signed in to change notification settings - Fork 731
feat: upgrade from pyautogen to ag2 package #1052
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
base: main
Are you sure you want to change the base?
Conversation
- Replace pyautogen==0.2.29 with ag2>=0.3.2 in pyproject.toml - Update installation instructions in integration tests README - Maintain backward compatibility as both packages provide autogen module - ag2 is the official successor to Microsoft AutoGen project Fixes #1051 Co-authored-by: Mervin Praison <MervinPraison@users.noreply.github.com>
WalkthroughThe changes update the project configuration and integration test documentation to replace the "pyautogen" dependency with "ag2" (version >=0.3.2) in all relevant locations. This includes dependency declarations, optional dependency groups, and installation instructions for integration tests. Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant Poetry
participant ag2
participant IntegrationTests
Developer->>Poetry: Add 'ag2' as dependency (pyproject.toml)
Poetry->>ag2: Install ag2 (>=0.3.2)
Developer->>IntegrationTests: Run integration tests
IntegrationTests->>ag2: Import and use ag2 for AutoGen tests
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Possibly related PRs
Suggested labels
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@claude review this pull request and do a detailed analysis and fix this if the existing code doesn't have the solution implemented. Making sure it has backward compatibility, no existing features removed. After making those changes, again review the applied changes. Use @web to search if you dont know any information or to find the latest documentation or to find the latest version. Run the code if you think you need to run it to test it. Minimal code change to start with if required any changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @MervinPraison, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request aims to modernize the project's dependency on the AutoGen framework by migrating from the pyautogen
package to ag2
. This upgrade is crucial as ag2
is the official continuation of Microsoft AutoGen, ensuring the project stays current with the latest developments and improvements in the ecosystem. The transition is designed to be seamless due to the shared module structure between the two packages.
Highlights
- Dependency Upgrade: I've updated the
pyproject.toml
file to replacepyautogen==0.2.29
withag2>=0.3.2
across all relevant dependency groups, includingproject.optional-dependencies.autogen
,project.dependencies
, andtool.poetry.group.dev.dependencies
. This aligns the project with the official successor package for Microsoft AutoGen. - Documentation Update: I've modified the
src/praisonai/tests/integration/README.md
to reflect the new dependency. Specifically, the installation instructions and troubleshooting tips for AutoGen tests now correctly referencepip install ag2
instead ofpip install pyautogen
. - Backward Compatibility: The change maintains backward compatibility as both
pyautogen
andag2
provide theautogen
module, ensuring existing code that importsautogen
will continue to function without modification.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
Claude finished @MervinPraison's task —— View job PR Review: Upgrade from pyautogen to ag2 packageI've completed a comprehensive review of this PR to ensure the upgrade from pyautogen to ag2 is properly implemented with full backward compatibility. Tasks:
✅ Review Results: APPROVEDChanges Analysis:✅ pyproject.toml Updates (Correct):
✅ Documentation Updates (Correct):
Compatibility Testing Results:✅ Successfully Verified:
✅ Version Specification:
Codebase Impact Assessment:No Breaking Changes Found:
Lock File Status:
🎯 Final Recommendation: MERGEThis PR correctly implements the upgrade from pyautogen to ag2 with:
The PR successfully addresses issue #1051 and maintains all existing functionality while upgrading to the official ag2 package (Microsoft AutoGen's successor). Note: Lock file updates can be handled in a separate maintenance PR to avoid complicating this focused upgrade. View Job Run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly upgrades the pyautogen
dependency to its official successor, ag2
. The changes in pyproject.toml
and the integration test README.md
are consistent with this goal. I've added a couple of suggestions to the README.md
to improve the clarity and completeness of the test setup instructions by recommending the installation of the full autogen
optional dependency group.
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To ensure a complete and correct testing environment for AutoGen integration, it's better to install the full autogen
extra. This will install ag2
along with other required dependencies like praisonai-tools
and crewai
, as defined in pyproject.toml
. This prevents potential missing dependency issues and aligns with how the application's extras are defined.
pip install ag2 | |
pip install "praisonai[autogen]" |
@@ -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` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the installation instruction, the solution for the ImportError
should point to installing the complete autogen
extra. This ensures all necessary dependencies for the AutoGen framework integration are installed correctly.
**Solution:** Install the framework: `pip install ag2` | |
**Solution:** Install the framework: `pip install "praisonai[autogen]"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
src/praisonai/pyproject.toml (2)
94-94
: Keep the same version spec everywhere for clarity
In[project.optional-dependencies]
you explicitly pin the minimum version (ag2>=0.3.2
) while the[tool.poetry.extras]
list relies on the implicit spec coming from the main dependency table. This works, but readers may assume the extras pull the latest any version.-autogen = ["ag2", "praisonai-tools", "crewai"] +autogen = ["ag2>=0.3.2", "praisonai-tools", "crewai"]Aligning the two locations avoids subtle confusion.
Also applies to: 289-289
128-128
: Consider adding an upper bound to protect against future breaking changes
ag2
is still pre-1.0; the authors may ship backward-incompatible 0.x bumps. A conservative spec keeps CI green:-ag2 = {version = ">=0.3.2", optional = true} +ag2 = {version = ">=0.3.2,<0.4.0", optional = true}If you prefer to stay on the bleeding edge, feel free to ignore.
src/praisonai/tests/integration/README.md (2)
148-149
: Mention the minimum supported version in the install hint-pip install ag2 +pip install "ag2>=0.3.2"Keeps the doc in sync with
pyproject.toml
.
252-255
: Ditto for the troubleshooting snippet-**Solution:** Install the framework: `pip install ag2` +**Solution:** Install the framework: `pip install "ag2>=0.3.2"`Readers hit this section only when things break; giving them the exact requirement saves a round-trip.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/praisonai/pyproject.toml
(3 hunks)src/praisonai/tests/integration/README.md
(2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: MervinPraison/PraisonAI#0
File: src/praisonai-agents/CLAUDE.md:0-0
Timestamp: 2025-07-21T11:20:34.197Z
Learning: Applies to src/praisonai-agents/praisonaiagents/**/*.py : Graceful degradation should be implemented for optional dependencies.
Learnt from: CR
PR: MervinPraison/PraisonAI#0
File: src/praisonai-agents/CLAUDE.md:0-0
Timestamp: 2025-07-21T11:20:34.197Z
Learning: Applies to src/praisonai-agents/praisonaiagents/llm/**/*.py : LLM integration should use the unified wrapper in `praisonaiagents/llm/` and support multiple providers via LiteLLM.
src/praisonai/tests/integration/README.md (6)
Learnt from: CR
PR: MervinPraison/PraisonAI#0
File: src/praisonai-agents/CLAUDE.md:0-0
Timestamp: 2025-07-21T11:20:34.197Z
Learning: Applies to src/praisonai-agents/tests/**/*.py : Test files should be placed in the tests/
directory and demonstrate specific usage patterns, serving as both test and documentation.
Learnt from: CR
PR: MervinPraison/PraisonAI#0
File: src/praisonai-ts/.windsurfrules:0-0
Timestamp: 2025-07-18T14:40:53.720Z
Learning: Applies to src/praisonai-ts/src/tools/README.md : The 'src/tools/README.md' file should provide documentation for tool developers
Learnt from: CR
PR: MervinPraison/PraisonAI#0
File: src/praisonai-agents/CLAUDE.md:0-0
Timestamp: 2025-07-21T11:20:34.197Z
Learning: Applies to src/praisonai-agents/tests/**/*.py : Use example-driven testing rather than a formal test runner; each test file should be runnable individually.
Learnt from: CR
PR: MervinPraison/PraisonAI#0
File: src/praisonai-agents/CLAUDE.md:0-0
Timestamp: 2025-07-21T11:20:34.197Z
Learning: Applies to src/praisonai-agents/praisonaiagents/**/*.py : Graceful degradation should be implemented for optional dependencies.
Learnt from: CR
PR: MervinPraison/PraisonAI#0
File: src/praisonai-agents/CLAUDE.md:0-0
Timestamp: 2025-07-21T11:20:34.197Z
Learning: Applies to src/praisonai-agents/praisonaiagents/llm/**/*.py : LLM integration should use the unified wrapper in praisonaiagents/llm/
and support multiple providers via LiteLLM.
Learnt from: CR
PR: MervinPraison/PraisonAI#0
File: src/praisonai-agents/CLAUDE.md:0-0
Timestamp: 2025-07-21T11:20:34.197Z
Learning: Use conda environment activation (conda activate praisonai-agents
) before running development or test commands.
src/praisonai/pyproject.toml (1)
Learnt from: CR
PR: MervinPraison/PraisonAI#0
File: src/praisonai-agents/CLAUDE.md:0-0
Timestamp: 2025-07-21T11:20:34.197Z
Learning: Applies to src/praisonai-agents/praisonaiagents/**/*.py : Graceful degradation should be implemented for optional dependencies.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: test-core (3.11)
- GitHub Check: Run tests and collect coverage
- GitHub Check: quick-test
@claude review if the changes made in the above branch are as per the requirements and make changes to the above branch if issues still exist. |
Claude finished @MervinPraison's task —— View job ✅ PR Review Complete - pyautogen to ag2 UpgradeI've thoroughly reviewed the PR changes and made necessary fixes to address reviewer feedback. Tasks Completed:
✅ Issues Fixed (Commit: e1a4ce5):1. Missing version specification in poetry extras ( -autogen = ["ag2", "praisonai-tools", "crewai"]
+autogen = ["ag2>=0.3.2", "praisonai-tools>=0.0.22", "crewai"] 2. Missing version specifications in README documentation ( # Line 148:
-pip install ag2
+pip install "ag2>=0.3.2"
# Line 254:
-pip install ag2
+pip install "ag2>=0.3.2" ✅ Review Summary:Core Requirements Met:
Compatibility Verified:
Code Quality:
🎯 Final Recommendation: APPROVED & READY TO MERGEThe PR now correctly implements the pyautogen to ag2 upgrade with:
The upgrade successfully addresses issue #1051 and positions the project to use Microsoft AutoGen's official successor (ag2) while maintaining all existing functionality. |
- Add version spec ag2>=0.3.2 to poetry extras in pyproject.toml - Update installation instructions in integration test README - Ensures consistent version requirements across all dependency declarations Co-authored-by: Mervin Praison <MervinPraison@users.noreply.github.com>
/review |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
/improve |
PR Code Suggestions ✨No code suggestions found for the PR. |
Upgrades PraisonAI from pyautogen to ag2, the official successor to Microsoft AutoGen.
Changes
Technical Notes
Fixes #1051
Search @web with multi agents and make sure that is the latest version and compatible with all existing packages
Summary by CodeRabbit