Skip to content

v2.1.4#475

Merged
MervinPraison merged 2 commits intomainfrom
develop
May 14, 2025
Merged

v2.1.4#475
MervinPraison merged 2 commits intomainfrom
develop

Conversation

@MervinPraison
Copy link
Copy Markdown
Owner

@MervinPraison MervinPraison commented May 14, 2025

Summary by CodeRabbit

  • New Features

    • Added comprehensive deployment guides for AWS and Google Cloud, including step-by-step instructions, security best practices, and monitoring tips.
    • Introduced new example scripts for deploying single and multi-agent APIs, demonstrating how to launch agents on different endpoints.
    • Added a health check endpoint and improved multi-agent API deployment with automatic endpoint registration and server management.
  • Improvements

    • Simplified the API deployment interface by removing unnecessary parameters from the agent launch method.
    • Enhanced documentation with a new deployment overview and updated navigation for easier access to deployment resources.
  • Dependency Updates

    • Upgraded core and optional package versions for improved stability and compatibility, including PraisonAI, agent libraries, and related tools.
  • Bug Fixes

    • Improved server lifecycle management for more reliable multi-agent deployments.

… blocking parameters, update version to 0.0.79 in `pyproject.toml` and `uv.lock`, and enhance server startup logic in `agent.py` with healthcheck endpoint and improved thread management.
@netlify
Copy link
Copy Markdown

netlify bot commented May 14, 2025

Deploy Preview for praisonai ready!

Name Link
🔨 Latest commit ba3b2de
🔍 Latest deploy log https://app.netlify.com/sites/praisonai/deploys/682467093a687f00084a668e
😎 Deploy Preview https://deploy-preview-475--praisonai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@MervinPraison MervinPraison merged commit fed7ac5 into main May 14, 2025
6 of 11 checks passed
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented May 14, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces new deployment documentation for AWS and Google Cloud, reorganizes documentation navigation, and adds example scripts for multi-agent and simple API deployments. The version of the praisonai package is upgraded to 2.1.4 across Dockerfiles and deployment scripts. The Agent.launch method is refactored for simplified, automatic server management.

Changes

File(s) Change Summary
docker/Dockerfile, docker/Dockerfile.chat, docker/Dockerfile.dev, docker/Dockerfile.ui Updated praisonai package version to 2.1.4 in all Dockerfiles.
docs/api/praisonai/deploy.html, praisonai/deploy.py Updated Dockerfile creation logic to use praisonai version 2.1.4.
pyproject.toml, src/praisonai-agents/pyproject.toml Updated project and dependency versions, including praisonaiagents and related packages.
docs/deploy/aws.mdx Added comprehensive AWS deployment documentation.
docs/deploy/deploy.mdx Added detailed guide for deploying PraisonAI agents as APIs.
docs/deploy/googlecloud.mdx Added comprehensive Google Cloud deployment documentation.
docs/mint.json Reorganized documentation navigation structure and tabs.
docs/developers/local-development.mdx, docs/ui/chat.mdx, docs/ui/code.mdx Updated Dockerfile.dev install instructions to use praisonai 2.1.4.
examples/api/multi-agent-api.py Added new script for launching three specialized agents on separate endpoints.
examples/api/simple-api-mcp.py Added new script for a weather agent API using MCP tool integration.
examples/api/simple-api.py Added new script for a simple assistant agent API.
src/praisonai-agents/multi-agent-api.py Removed comments and explicit blocking parameter from agent launches; now uses default behavior.
src/praisonai-agents/praisonaiagents/agent/agent.py Refactored Agent.launch: removed autostart/blocking, added global server state, health endpoint, automatic blocking, and endpoint registration.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Script
    participant Agent
    participant FastAPI Server

    User->>Script: Runs agent script
    Script->>Agent: agent.launch(path, port, host, debug)
    Agent->>FastAPI Server: Register endpoint (if not already running)
    FastAPI Server-->>Agent: Confirms registration
    Agent->>Script: If last launch in script, block main thread
    User->>FastAPI Server: Sends request to /agent-endpoint
    FastAPI Server->>Agent: Forwards request
    Agent->>FastAPI Server: Returns response
    FastAPI Server->>User: Sends agent response
Loading

Possibly related PRs

  • MervinPraison/PraisonAI#441: Updates praisonai version in Dockerfiles and deployment scripts from 2.0.81 to 2.1.0, related as a sequential version upgrade.
  • MervinPraison/PraisonAI#432: Updates praisonai version from 2.0.80 to 2.0.81 in similar files; related by version pinning changes.
  • MervinPraison/PraisonAI#442: Updates praisonai version from 2.1.0 to 2.1.1 in the same locations; related as sequential version pinning.

Suggested labels

Review effort 1/5

Poem

In the warren of code, new docs now abound,
With agents that answer—on clouds they're found!
Version bumps hop, Dockerfiles align,
Multi-agents serve on endpoints just fine.
The launch is now simple, the server is bright—
Rabbits rejoice, for the code runs right!
🐇✨

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 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 92fed91 and ba3b2de.

⛔ Files ignored due to path filters (2)
  • src/praisonai-agents/uv.lock is excluded by !**/*.lock
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (20)
  • docker/Dockerfile (1 hunks)
  • docker/Dockerfile.chat (1 hunks)
  • docker/Dockerfile.dev (1 hunks)
  • docker/Dockerfile.ui (1 hunks)
  • docs/api/praisonai/deploy.html (1 hunks)
  • docs/deploy/aws.mdx (1 hunks)
  • docs/deploy/deploy.mdx (1 hunks)
  • docs/deploy/googlecloud.mdx (1 hunks)
  • docs/developers/local-development.mdx (1 hunks)
  • docs/mint.json (3 hunks)
  • docs/ui/chat.mdx (1 hunks)
  • docs/ui/code.mdx (1 hunks)
  • examples/api/multi-agent-api.py (1 hunks)
  • examples/api/simple-api-mcp.py (1 hunks)
  • examples/api/simple-api.py (1 hunks)
  • praisonai/deploy.py (1 hunks)
  • pyproject.toml (6 hunks)
  • src/praisonai-agents/multi-agent-api.py (1 hunks)
  • src/praisonai-agents/praisonaiagents/agent/agent.py (5 hunks)
  • src/praisonai-agents/pyproject.toml (1 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

This pull request updates the version of the PraisonAI package to 2.1.4. This involves changes to the docker/Dockerfile files, docs/api/praisonai/deploy.html, docs/developers/local-development.mdx, docs/ui/chat.mdx, docs/ui/code.mdx, praisonai/deploy.py, and pyproject.toml to reflect the new version. Additionally, it introduces new documentation files for deploying to AWS and Google Cloud, and provides examples for multi-agent APIs. The changes also include updates to dependencies and minor modifications to the agent's launch function.

Highlights

  • Version Update: The core change is updating the PraisonAI package version to 2.1.4 across all relevant files.
  • Deployment Documentation: New documentation files (docs/deploy/aws.mdx, docs/deploy/deploy.mdx, docs/deploy/googlecloud.mdx) have been added to guide users on deploying PraisonAI agents to AWS and Google Cloud.
  • API Examples: New examples (examples/api/multi-agent-api.py, examples/api/simple-api-mcp.py, examples/api/simple-api.py) are added to demonstrate how to create multi-agent APIs.
  • Agent Launch Function: The launch function in src/praisonai-agents/praisonaiagents/agent/agent.py has been modified to remove the autostart and blocking parameters, and to improve the server startup and endpoint registration process.

Changelog

Click here to see the changelog
  • docker/Dockerfile
    • Updated praisonai version from 2.1.1 to 2.1.4 in the Dockerfile.
  • docker/Dockerfile.chat
    • Updated praisonai version from 2.0.18 to 2.1.4 in the Dockerfile.chat.
  • docker/Dockerfile.dev
    • Updated praisonai version from 2.0.18 to 2.1.4 in the Dockerfile.dev.
  • docker/Dockerfile.ui
    • Updated praisonai version from 2.0.18 to 2.1.4 in the Dockerfile.ui.
  • docs/api/praisonai/deploy.html
    • Updated praisonai version from 2.1.1 to 2.1.4 in the documentation.
  • docs/deploy/aws.mdx
    • Added new documentation file for deploying to AWS, including instructions for EC2, ECS/Fargate, and Lambda deployments.
  • docs/deploy/deploy.mdx
    • Added new documentation file for deploying PraisonAI agents as APIs, including quick start, multi-agent deployment, and production deployment options.
  • docs/deploy/googlecloud.mdx
    • Added new documentation file for deploying to Google Cloud using Cloud Run, including scaling, continuous deployment, and security best practices.
  • docs/developers/local-development.mdx
    • Updated praisonai version from 2.0.18 to 2.1.4 in the local development documentation.
  • docs/mint.json
    • Reordered tabs and added a Deploy group with links to deployment documentation pages.
  • docs/ui/chat.mdx
    • Updated praisonai version from 2.0.18 to 2.1.4 in the chat UI documentation.
  • docs/ui/code.mdx
    • Updated praisonai version from 2.0.18 to 2.1.4 in the code UI documentation.
  • examples/api/multi-agent-api.py
    • Added new example file demonstrating how to create a multi-agent API with weather, stock, and travel agents.
  • examples/api/simple-api-mcp.py
    • Added new example file demonstrating a simple API with MCP (Multi-Channel Platform) integration.
  • examples/api/simple-api.py
    • Added new example file demonstrating a simple API with a helpful assistant agent.
  • praisonai/deploy.py
    • Updated praisonai version from 2.1.1 to 2.1.4 in the create_dockerfile function.
  • pyproject.toml
    • Updated praisonai version from 2.1.1 to 2.1.4.
    • Updated praisonaiagents version from 0.0.71 to 0.0.79.
    • Updated chainlit version from 2.0.3 to 2.5.5.
    • Updated langchain-google-genai version from 1.0.4 to 2.1.0.
    • Updated langchain-openai version from 0.1.7 to >=0.2.1,<0.3.0.
    • Updated langchain-anthropic version from 0.1.13 to 0.3.0.
    • Updated langchain-cohere version from 0.1.4 to >=0.3.0,<0.4.0.
    • Updated crawl4ai version from 0.3.4 to >=0.6.0.
    • Added fastapi and uvicorn as dependencies for the api extra.
  • src/praisonai-agents/multi-agent-api.py
    • Removed blocking parameter from launch calls.
    • Removed comments related to blocking execution.
  • src/praisonai-agents/praisonaiagents/agent/agent.py
    • Removed autostart and blocking parameters from the launch function.
    • Added healthcheck endpoint to the FastAPI app.
    • Improved server startup and endpoint registration process using threading and stack inspection to determine if the server should block.
    • Added more logging and error handling for server startup.
  • src/praisonai-agents/pyproject.toml
    • Updated praisonaiagents version from 0.0.78 to 0.0.79.
  • src/praisonai-agents/uv.lock
    • Updated praisonaiagents version from 0.0.78 to 0.0.79.
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.


A version ascends,
New docs guide cloud journeys,
Agents find their place.

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.

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

The pull request updates the praisonai version across multiple Dockerfiles and documentation files. It also introduces new documentation for deploying PraisonAI agents to AWS and Google Cloud, and deploying PraisonAI agents as APIs. The changes seem straightforward and necessary for keeping the project up-to-date and providing deployment guidance. However, there are a few areas that could be improved, particularly in the new documentation files.

Summary of Findings

  • Dependency Updates: The pull request updates the praisonai version in multiple files. It's crucial to ensure that these updates are thoroughly tested and compatible with the rest of the project's dependencies.
  • API Launch Parameters: The removal of autostart and blocking parameters from the launch method could affect existing users. Providing a clear migration path and documentation is essential.
  • Agent Launch Detection: The automatic detection of the last launch call might not be reliable in all scenarios. A more explicit control mechanism for blocking the main thread could improve the code's robustness.

Merge Readiness

The pull request introduces necessary updates and valuable deployment documentation. However, the potential impact of removing the autostart and blocking parameters, and the reliability of the agent launch detection, should be carefully considered. At a minimum, the high severity issues should be addressed before merging. I am unable to directly approve this pull request, and I recommend that other reviewers also examine the code before merging.

COPY . .

RUN pip install flask praisonai==2.0.18 watchdog
RUN pip install flask praisonai==2.1.4 watchdog
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

This line updates the praisonai version in the documentation. Ensure that this version is thoroughly tested and compatible with the rest of the dependencies. It would be useful to add a comment indicating why this update is being made.

RUN pip install flask praisonai==2.1.4 watchdog # Updated to version 2.1.4 for [reason]

COPY . .

RUN pip install flask praisonai==2.0.18 watchdog
RUN pip install flask praisonai==2.1.4 watchdog
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

This line updates the praisonai version in the documentation. Ensure that this version is thoroughly tested and compatible with the rest of the dependencies. It would be useful to add a comment indicating why this update is being made.

    RUN pip install flask praisonai==2.1.4 watchdog # Updated to version 2.1.4 for [reason]

COPY . .

RUN pip install flask praisonai==2.0.18 watchdog
RUN pip install flask praisonai==2.1.4 watchdog
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

This line updates the praisonai version in the documentation. Ensure that this version is thoroughly tested and compatible with the rest of the dependencies. It would be useful to add a comment indicating why this update is being made.

    RUN pip install flask praisonai==2.1.4 watchdog # Updated to version 2.1.4 for [reason]

Comment on lines +1411 to 1420
def launch(self, path: str = '/', port: int = 8000, host: str = '0.0.0.0', debug: bool = False):
"""
Launch the agent as an HTTP API endpoint.

Args:
path: API endpoint path (default: '/')
port: Server port (default: 8000)
host: Server host (default: '0.0.0.0')
autostart: Whether to start the server automatically (default: True)
debug: Enable debug mode for uvicorn (default: False)
blocking: If True, blocks the main thread to keep the server running (default: True)

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 autostart and blocking parameters have been removed from the launch method. This could affect existing users who rely on these parameters. Consider adding a note in the documentation about this change and how users can achieve the same behavior without these parameters.

    def launch(self, path: str = '/', port: int = 8000, host: str = '0.0.0.0', debug: bool = False):
        """
        Launch the agent as an HTTP API endpoint.
        
        Args:
            path: API endpoint path (default: '/')
            port: Server port (default: 8000)
            host: Server host (default: '0.0.0.0')
            debug: Enable debug mode for uvicorn (default: False)
        Returns:
            None
        """

Comment on lines +1550 to +1587
# Get the stack frame to check if this is the last launch() call in the script
import inspect
stack = inspect.stack()

# If this is called from a Python script (not interactive), try to detect if it's the last launch call
if len(stack) > 1 and stack[1].filename.endswith('.py'):
caller_frame = stack[1]
caller_line = caller_frame.lineno

print(f"✅ FastAPI server started at http://{host}:{port}")
print(f"📚 API documentation available at http://{host}:{port}/docs")

# If blocking is True, keep the main thread alive
if blocking:
print("\nServer is running in blocking mode. Press Ctrl+C to stop...")
try:
# Read the file to check if there are more launch calls after this one
with open(caller_frame.filename, 'r') as f:
lines = f.readlines()

# Check if there are more launch() calls after the current line
has_more_launches = False
for line in lines[caller_line:]:
if '.launch(' in line and not line.strip().startswith('#'):
has_more_launches = True
break

# If this is the last launch call, block the main thread
if not has_more_launches:
try:
print("\nAll agents registered. Press Ctrl+C to stop the server.")
while True:
time.sleep(1)
except KeyboardInterrupt:
print("\nServer stopped")
except Exception as e:
# If something goes wrong with detection, block anyway to be safe
logging.error(f"Error in launch detection: {e}")
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
print("\nServer stopped")
else:
# Note for non-blocking mode
print("\nNote: Server is running in a background thread. To keep it alive, either:")
print("1. Set blocking=True when calling launch()")
print("2. Keep your main application running")
print("3. Use a loop in your code to prevent the program from exiting")


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

This section attempts to detect if the launch call is the last one in a script and blocks the main thread accordingly. While this is a clever approach, it might not be reliable in all cases. Consider providing a more explicit way for users to control whether the server blocks the main thread or not, perhaps through a separate function call or a global setting.

@coderabbitai coderabbitai bot mentioned this pull request May 14, 2025
This was referenced May 24, 2025
shaneholloman pushed a commit to shaneholloman/praisonai that referenced this pull request Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant