Skip to content

Develop#601

Merged
MervinPraison merged 4 commits intomainfrom
develop
Jun 4, 2025
Merged

Develop#601
MervinPraison merged 4 commits intomainfrom
develop

Conversation

@MervinPraison
Copy link
Copy Markdown
Owner

@MervinPraison MervinPraison commented Jun 4, 2025

PR Type

enhancement, documentation


Description

  • Bump PraisonAI version from 2.2.26 to 2.2.27 across all relevant files

    • Updated Dockerfiles, README, Homebrew formula, and pyproject.toml
    • Ensured consistent version pinning in install scripts and docs
  • Add new agent guardrails example for PraisonAI Agents

    • Introduced guardrail_agents_example.py with improved structure and validation logic
  • Minor enhancement: import asyncio in agent runtime for future async support

  • Bump PraisonAI Agents version from 0.0.97 to 0.0.98


Changes walkthrough 📝

Relevant files
Enhancement
10 files
Dockerfile
Update PraisonAI version to 2.2.27 in base Dockerfile       
+1/-1     
Dockerfile.chat
Update PraisonAI version to 2.2.27 in chat Dockerfile       
+1/-1     
Dockerfile.dev
Update PraisonAI version to 2.2.27 in dev Dockerfile         
+1/-1     
Dockerfile.ui
Update PraisonAI version to 2.2.27 in UI Dockerfile           
+1/-1     
guardrail_agents_example.py
Add new agent guardrails example with validation logic     
+21/-0   
agent.py
Import asyncio in agent runtime for async support               
+1/-0     
pyproject.toml
Bump PraisonAI Agents version to 0.0.98                                   
+1/-1     
praisonai.rb
Update Homebrew formula to PraisonAI 2.2.27                           
+2/-2     
pyproject.toml
Bump PraisonAI version to 2.2.27 in project config             
+2/-2     
deploy.py
Update install command to use PraisonAI 2.2.27                     
+1/-1     
Documentation
1 files
README.md
Update PraisonAI version references to 2.2.27 in documentation
+2/-2     
Additional files
1 files
pnpm-lock.yaml +4862/-0

Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Summary by CodeRabbit

    • New Features

      • Added a new example script demonstrating how to use guardrails with AI agent workflows.
    • Chores

      • Updated the minimum required version of the PraisonAI package to 2.2.27 across Dockerfiles, documentation, and deployment scripts.
      • Bumped the PraisonAIAgents package version to 0.0.98.
      • Updated the PraisonAI project version to 2.2.27.
      • Updated the PraisonAI Homebrew formula to use version 2.2.27.

    - Removed the outdated agent_guardrails_example.py file.
    - Introduced a new guardrail_agents_example.py file with improved structure and user-friendly naming.
    - Updated version in pyproject.toml from 0.0.97 to 0.0.98.
    - Added revision information in uv.lock for better dependency tracking.
    - Imported asyncio in agent.py for enhanced functionality.
    - Updated the version of PraisonAI from 2.2.26 to 2.2.27 in Dockerfiles (Dockerfile, Dockerfile.chat, Dockerfile.dev, Dockerfile.ui).
    - Modified the version in the README.md and pyproject.toml files to reflect the new version.
    - Adjusted the deploy.py script to install the updated version of PraisonAI.
    - Ensured consistency across all relevant files for seamless integration.
    @MervinPraison MervinPraison merged commit 3588f1c into main Jun 4, 2025
    4 of 8 checks passed
    @coderabbitai
    Copy link
    Copy Markdown
    Contributor

    coderabbitai Bot commented Jun 4, 2025

    Caution

    Review failed

    The pull request is closed.

    Walkthrough

    This update increments the minimum required version of the praisonai Python package from 2.2.26 to 2.2.27 across Dockerfiles, deployment scripts, documentation, and Homebrew formula. It also bumps the praisonaiagents package version to 0.0.98 and introduces a new example script demonstrating agent guardrails.

    Changes

    Files/Paths Change Summary
    docker/Dockerfile, docker/Dockerfile.chat, docker/Dockerfile.dev, docker/Dockerfile.ui Updated pip install command to require praisonai>=2.2.27 instead of >=2.2.26.
    docker/README.md Updated documentation to reflect praisonai version bump to >=2.2.27.
    src/praisonai-agents/guardrail_agents_example.py Added new example script showing agent workflow with guardrail validation.
    src/praisonai-agents/pyproject.toml Bumped praisonaiagents version from 0.0.97 to 0.0.98.
    src/praisonai-agents/praisonaiagents/agent/agent.py Added import asyncio to the MCP server launch code block in the Agent class.
    src/praisonai/praisonai.rb Updated Homebrew formula to use praisonai version 2.2.27 and new SHA256 checksum.
    src/praisonai/praisonai/deploy.py Updated Dockerfile creation to install praisonai==2.2.27.
    src/praisonai/pyproject.toml Updated praisonai version to 2.2.27 in both [project] and [tool.poetry] sections.

    Sequence Diagram(s)

    sequenceDiagram
        participant User
        participant PraisonAIAgents
        participant Agent
        participant Guardrail
    
        User->>PraisonAIAgents: start()
        PraisonAIAgents->>Agent: execute Task
        Agent->>Guardrail: validate_content(task_output)
        Guardrail-->>Agent: validation result
        Agent-->>PraisonAIAgents: task output (if valid)
        PraisonAIAgents-->>User: final result
    
    Loading

    Possibly related PRs

    Suggested labels

    Review effort 1/5

    Poem

    In the meadow of code, a version hops high,
    From twenty-six to twenty-seven, it leaps to the sky!
    Agents now guarded, examples anew,
    With Docker refreshed and Homebrew too.
    The rabbit approves, with a whisker twitch—
    Another smooth hop, without a glitch! 🐇✨


    📜 Recent review details

    Configuration used: CodeRabbit UI
    Review profile: CHILL
    Plan: Pro

    📥 Commits

    Reviewing files that changed from the base of the PR and between 6809118 and 27792f1.

    ⛔ Files ignored due to path filters (3)
    • src/praisonai-agents/uv.lock is excluded by !**/*.lock
    • src/praisonai-ts/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
    • src/praisonai/uv.lock is excluded by !**/*.lock
    📒 Files selected for processing (11)
    • docker/Dockerfile (1 hunks)
    • docker/Dockerfile.chat (1 hunks)
    • docker/Dockerfile.dev (1 hunks)
    • docker/Dockerfile.ui (1 hunks)
    • docker/README.md (2 hunks)
    • src/praisonai-agents/guardrail_agents_example.py (1 hunks)
    • src/praisonai-agents/praisonaiagents/agent/agent.py (1 hunks)
    • src/praisonai-agents/pyproject.toml (1 hunks)
    • src/praisonai/praisonai.rb (1 hunks)
    • src/praisonai/praisonai/deploy.py (1 hunks)
    • src/praisonai/pyproject.toml (2 hunks)
    ✨ Finishing Touches
    • 📝 Generate Docstrings

    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.

    ❤️ Share
    🪧 Tips

    Chat

    There are 3 ways to chat with CodeRabbit:

    • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
      • I pushed a fix in commit <commit_id>, please review it.
      • Explain this complex logic.
      • Open a follow-up GitHub issue for this discussion.
    • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
      • @coderabbitai explain this code block.
      • @coderabbitai modularize this function.
    • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
      • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
      • @coderabbitai read src/utils.ts and explain its main purpose.
      • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
      • @coderabbitai help me debug CodeRabbit configuration file.

    Support

    Need 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)

    • @coderabbitai pause to pause the reviews on a PR.
    • @coderabbitai resume to resume the paused reviews.
    • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
    • @coderabbitai full review to do a full review from scratch and review all the files again.
    • @coderabbitai summary to regenerate the summary of the PR.
    • @coderabbitai generate docstrings to generate docstrings for this PR.
    • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
    • @coderabbitai resolve resolve all the CodeRabbit review comments.
    • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
    • @coderabbitai help to get help.

    Other keywords and placeholders

    • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
    • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
    • Add @coderabbitai anywhere in the PR title to generate the title automatically.

    CodeRabbit Configuration File (.coderabbit.yaml)

    • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
    • Please see the configuration documentation for more information.
    • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

    Documentation and Community

    • Visit our Documentation for detailed information on how to use CodeRabbit.
    • Join our Discord Community to get help, request features, and share feedback.
    • Follow us on X/Twitter for updates and announcements.

    Copy link
    Copy Markdown
    Contributor

    @gemini-code-assist gemini-code-assist Bot left a comment

    Choose a reason for hiding this comment

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

    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!

    Summary of Changes

    Hello team,

    gemini-code-assist here to provide a summary of this pull request. Based on the changes presented in the patch, as the PR title and description are minimal, the primary intent appears to be updating the core PraisonAI library version to 2.2.27 and the praisonaiagents library version to 0.0.98. This update is reflected across various Docker configurations, documentation, deployment scripts, and project dependency files. Additionally, a new example file demonstrating the use of guardrails within praisonaiagents has been added.

    Highlights

    • Version Updates: The core PraisonAI library has been updated from version 2.2.26 to 2.2.27. The praisonaiagents library has been updated from version 0.0.97 to 0.0.98.
    • Docker and Deployment Configuration Updates: All relevant Dockerfiles (Dockerfile, Dockerfile.chat, Dockerfile.dev, Dockerfile.ui) and the docker/README.md have been updated to reference the new PraisonAI version (>=2.2.27). The src/praisonai/praisonai/deploy.py script, which generates a Dockerfile, also now pins the version to 2.2.27.
    • Project Dependency Updates: The pyproject.toml files for both PraisonAI and praisonaiagents have been updated to reflect their new versions (2.2.27 and 0.0.98 respectively). The uv.lock file for PraisonAI has also been updated to lock the dependency to 2.2.27.
    • New PraisonAI Agents Example: A new example file, src/praisonai-agents/guardrail_agents_example.py, has been added. This example demonstrates how to define and use a guardrail function with a Task in praisonaiagents to validate task output.
    • Internal Agent Code Change: An asyncio import was added within the run_server function in src/praisonai-agents/praisonaiagents/agent/agent.py.

    Changelog

    Click here to see the changelog
    • docker/Dockerfile
      • Updated praisonai dependency version from >=2.2.26 to >=2.2.27 (line 19).
    • docker/Dockerfile.chat
      • Updated praisonai dependency version from >=2.2.26 to >=2.2.27 (line 19).
    • docker/Dockerfile.dev
      • Updated praisonai dependency version from >=2.2.26 to >=2.2.27 (line 23).
    • docker/Dockerfile.ui
      • Updated praisonai dependency version from >=2.2.26 to >=2.2.27 (line 19).
    • docker/README.md
      • Updated PraisonAI version reference in 'Package Versions' from >=2.2.26 to >=2.2.27 (line 124).
      • Updated PraisonAI version in 'Version Pinning' example from ==2.2.26 to ==2.2.27 (line 221).
    • src/praisonai-agents/guardrail_agents_example.py
      • Added new example file demonstrating guardrail usage with praisonaiagents.
    • src/praisonai-agents/praisonaiagents/agent/agent.py
      • Added import asyncio within the run_server function's import block (line 1889).
    • src/praisonai-agents/pyproject.toml
      • Updated praisonaiagents project version from 0.0.97 to 0.0.98 (line 7).
    • src/praisonai/praisonai.rb
      • Updated Homebrew formula URL and sha256 hash to reference v2.2.27 (lines 6-7).
    • src/praisonai/praisonai/deploy.py
      • Updated hardcoded praisonai version in generated Dockerfile from 2.2.26 to 2.2.27 (line 59).
    • src/praisonai/pyproject.toml
      • Updated PraisonAI project version from 2.2.26 to 2.2.27 in [project] section (line 3).
      • Updated PraisonAI project version from 2.2.26 to 2.2.27 in [tool.poetry] section (line 98).
    • src/praisonai/uv.lock
      • Updated locked praisonai dependency version from 2.2.26 to 2.2.27 (line 3935).
    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 is currently in preview and 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 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.


    Versions tick and climb,
    New numbers mark the time,
    Code grows, examples shine.

    Footnotes

    1. 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.

    @qodo-code-review
    Copy link
    Copy Markdown

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Dynamic SHA Generation

    The SHA256 hash is being dynamically generated using a shell command during formula execution. This approach may cause inconsistency or security issues as the hash should be pre-computed and hardcoded.

    url "https://github.com/MervinPraison/PraisonAI/archive/refs/tags/v2.2.27.tar.gz"
    sha256 `curl -sL https://github.com/MervinPraison/PraisonAI/archive/refs/tags/v2.2.27.tar.gz | shasum -a 256`.split.first
    Error Handling

    The example lacks error handling for task execution failures. Consider adding try/except blocks or more robust error handling to demonstrate proper guardrail implementation.

    task = Task(
        description="Write a welcome message",
        guardrail=validate_content,
        agent=agent
    )

    Copy link
    Copy Markdown
    Contributor

    @gemini-code-assist gemini-code-assist Bot left a 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 primarily focuses on bumping versions for PraisonAI and PraisonAI Agents, which has been done consistently across various configuration files, Dockerfiles, and documentation. The addition of the guardrail_agents_example.py is a welcome enhancement, providing a clear example of the guardrail functionality. There's also a minor change related to an asyncio import.

    Overall, the changes are straightforward and well-executed. I have one suggestion regarding a potentially redundant import.

    Summary of Findings

    • Redundant Import: In src/praisonai-agents/praisonaiagents/agent/agent.py, asyncio is imported within the launch method, but it's already imported at the module level. This redundant import could be removed. (Commented)
    • Example Code Enhancements (Not Commented due to Severity Settings): For the new src/praisonai-agents/guardrail_agents_example.py:
    • Consider adding a docstring to the validate_content function to explain its purpose, arguments, and return value.
    • The magic number 50 in len(task_output.raw) < 50 could be defined as a named constant for better readability and maintainability (e.g., MIN_CONTENT_LENGTH = 50).
    • The return type hint Tuple[bool, Any] for validate_content could be more specific, like Tuple[bool, Union[str, TaskOutput]], as it returns either (False, "Content too short") or (True, task_output).
      These are minor suggestions and were not added as review comments due to the configured severity threshold.

    Merge Readiness

    The pull request is in good shape for merging. The version bumps are consistent, and the new example is a useful addition. There's one minor suggestion regarding a redundant import in agent.py that you might consider addressing for code cleanliness. I am unable to approve the pull request myself, so please ensure it undergoes further review and approval as per your team's process before merging.

    import threading
    import time
    import inspect
    import asyncio # Import asyncio in the MCP scope
    Copy link
    Copy Markdown
    Contributor

    Choose a reason for hiding this comment

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

    medium

    The asyncio module is already imported at the top of this file (on line 5). Is this additional import of asyncio within the launch method (specifically in the MCP protocol handling block) necessary? It appears to be redundant and could be removed to keep the imports cleaner.

    Suggested change
    import asyncio # Import asyncio in the MCP scope
    # import asyncio # Import asyncio in the MCP scope

    @qodo-code-review
    Copy link
    Copy Markdown

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Handle None values

    The validation function should handle potential None values in task_output.raw
    to prevent TypeError exceptions. Add a check to ensure task_output.raw exists
    before checking its length.

    src/praisonai-agents/guardrail_agents_example.py [4-7]

     def validate_content(task_output: TaskOutput) -> Tuple[bool, Any]:
    -    if len(task_output.raw) < 50:
    +    if task_output.raw is None or len(task_output.raw) < 50:
             return False, "Content too short"
         return True, task_output
    • Apply / Chat
    Suggestion importance[1-10]: 6

    __

    Why: The suggestion adds defensive programming to handle potential None values in task_output.raw, which could prevent TypeError exceptions. This is a reasonable error handling improvement, though not critical.

    Low
    • More

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    1 participant