Skip to content

Commit

Permalink
Update PraisonAI to version 2.0.52 and enhance repetitive agents func…
Browse files Browse the repository at this point in the history
…tionality

- Bumped PraisonAI version from 2.0.51 to 2.0.52 in `Dockerfile`, `pyproject.toml`, and `uv.lock` to reflect the latest updates.
- Updated the `praisonai.rb` formula to point to the new version's tarball.
- Updated the `praisonaiagents` dependency version from `0.0.42` to `0.0.43` across relevant files for improved functionality.
- Introduced new files for repetitive agents in `agents/repetitive-agents.py` and `examples/concepts/repetitive-agents.py`, enabling automated task loops.
- Enhanced documentation with a new section on repetitive agents in `docs/features/repetitive.mdx` and updated `mint.json` to include the new feature.

These changes improve the overall functionality and usability of the PraisonAI framework, particularly in handling repetitive tasks and enhancing agent capabilities.
  • Loading branch information
MervinPraison committed Jan 20, 2025
1 parent edf70d1 commit 177027d
Show file tree
Hide file tree
Showing 10 changed files with 173 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.11-slim
WORKDIR /app
COPY . .
RUN pip install flask praisonai==2.0.51 gunicorn markdown
RUN pip install flask praisonai==2.0.52 gunicorn markdown
EXPOSE 8080
CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/api/praisonai/deploy.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ <h2 id="raises">Raises</h2>
file.write(&#34;FROM python:3.11-slim\n&#34;)
file.write(&#34;WORKDIR /app\n&#34;)
file.write(&#34;COPY . .\n&#34;)
file.write(&#34;RUN pip install flask praisonai==2.0.51 gunicorn markdown\n&#34;)
file.write(&#34;RUN pip install flask praisonai==2.0.52 gunicorn markdown\n&#34;)
file.write(&#34;EXPOSE 8080\n&#34;)
file.write(&#39;CMD [&#34;gunicorn&#34;, &#34;-b&#34;, &#34;0.0.0.0:8080&#34;, &#34;api:app&#34;]\n&#39;)

Expand Down
137 changes: 137 additions & 0 deletions docs/features/repetitive.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
---
title: "Repetitive Agents"
description: "Learn how to create AI agents that can efficiently handle repetitive tasks through automated loops."
icon: "repeat"
---

```mermaid
flowchart LR
In[Input] --> LoopAgent[("Looping Agent")]
LoopAgent --> Task[Task]
Task --> |Next iteration| LoopAgent
Task --> |Done| Out[Output]
style In fill:#8B0000,color:#fff
style LoopAgent fill:#2E8B57,color:#fff,shape:circle
style Task fill:#2E8B57,color:#fff
style Out fill:#8B0000,color:#fff
```

A workflow optimization pattern where agents handle repetitive tasks through automated loops, processing multiple instances efficiently while maintaining consistency.

## Quick Start

<Steps>
<Step title="Install Package">
First, install the PraisonAI Agents package:
```bash
pip install praisonaiagents
```
</Step>

<Step title="Set API Key">
Set your OpenAI API key as an environment variable in your terminal:
```bash
export OPENAI_API_KEY=your_api_key_here
```
</Step>

<Step title="Create a file">
Create a new file `repetitive_agent.py` with the basic setup:
```python
from praisonaiagents import Agent, Task, PraisonAIAgents

agent = Agent(
instructions="You are a loop agent that creating a loop of tasks."
)

task = Task(
description="Create the list of tasks to be looped through.",
agent=agent,
task_type="loop",
input_file="tasks.csv"
)

agents = PraisonAIAgents(
agents=[agent],
tasks=[task],
process="workflow"
)

agents.start()
```
</Step>

<Step title="Start Agents">
Type this in your terminal to run your agents:
```bash
python repetitive_agent.py
```
</Step>
</Steps>

<Note>
**Requirements**
- Python 3.10 or higher
- OpenAI API key. Generate OpenAI API key [here](https://platform.openai.com/api-keys). Use Other models using [this guide](/models).
</Note>

## Understanding Repetitive Agents

<Card title="What are Repetitive Agents?" icon="question">
Repetitive agents enable:
- Automated task loops
- Batch processing
- Consistent task execution
- Efficient handling of multiple similar tasks
</Card>

## Features

<CardGroup cols={2}>
<Card title="Task Looping" icon="repeat">
Process multiple tasks through automated loops.
</Card>
<Card title="Batch Processing" icon="layer-group">
Handle multiple similar tasks efficiently.
</Card>
<Card title="Input Management" icon="file-csv">
Process tasks from structured input files.
</Card>
<Card title="Progress Tracking" icon="chart-line">
Monitor task completion and progress.
</Card>
</CardGroup>

## Troubleshooting

<CardGroup cols={2}>
<Card title="Loop Issues" icon="triangle-exclamation">
If loops aren't working as expected:
- Verify input file format
- Check task configurations
- Enable verbose mode for debugging
</Card>

<Card title="Performance Issues" icon="gauge-high">
If processing is slow:
- Check batch sizes
- Verify resource allocation
- Monitor memory usage
</Card>
</CardGroup>

## Next Steps

<CardGroup cols={2}>
<Card title="AutoAgents" icon="robot" href="./autoagents">
Learn about automatically created and managed AI agents
</Card>
<Card title="Mini Agents" icon="microchip" href="./mini">
Explore lightweight, focused AI agents
</Card>
</CardGroup>

<Note>
For optimal results, ensure your input files are properly formatted and your task configurations are appropriate for your use case.
</Note>
3 changes: 2 additions & 1 deletion docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
"features/autonomous-workflow",
"features/parallelisation",
"features/promptchaining",
"features/evaluator-optimiser"
"features/evaluator-optimiser",
"features/repetitive"
]
},
{
Expand Down
21 changes: 21 additions & 0 deletions examples/concepts/repetitive-agents.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from praisonaiagents import Agent, Task, PraisonAIAgents

agent = Agent(
instructions="You are a loop agent that creating a loop of tasks.",
llm="gpt-4o-mini"
)

task = Task(
description="Create the list of tasks to be looped through.",
agent=agent,
task_type="loop",
input_file="tasks.csv"
)

agents = PraisonAIAgents(
agents=[agent],
tasks=[task],
process="workflow"
)

agents.start()
2 changes: 1 addition & 1 deletion praisonai.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Praisonai < Formula

desc "AI tools for various AI applications"
homepage "https://github.com/MervinPraison/PraisonAI"
url "https://github.com/MervinPraison/PraisonAI/archive/refs/tags/2.0.51.tar.gz"
url "https://github.com/MervinPraison/PraisonAI/archive/refs/tags/2.0.52.tar.gz"
sha256 "1828fb9227d10f991522c3f24f061943a254b667196b40b1a3e4a54a8d30ce32" # Replace with actual SHA256 checksum
license "MIT"

Expand Down
2 changes: 1 addition & 1 deletion praisonai/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def create_dockerfile(self):
file.write("FROM python:3.11-slim\n")
file.write("WORKDIR /app\n")
file.write("COPY . .\n")
file.write("RUN pip install flask praisonai==2.0.51 gunicorn markdown\n")
file.write("RUN pip install flask praisonai==2.0.52 gunicorn markdown\n")
file.write("EXPOSE 8080\n")
file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')

Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "PraisonAI"
version = "2.0.51"
version = "2.0.52"
description = "PraisonAI is an AI Agents Framework with Self Reflection. PraisonAI application combines PraisonAI Agents, AutoGen, and CrewAI into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customisation, and efficient human-agent collaboration."
readme = "README.md"
license = ""
Expand All @@ -12,7 +12,7 @@ dependencies = [
"rich>=13.7",
"markdown>=3.5",
"pyparsing>=3.0.0",
"praisonaiagents>=0.0.42",
"praisonaiagents>=0.0.43",
"python-dotenv>=0.19.0",
"instructor>=1.3.3",
"PyYAML>=6.0",
Expand Down Expand Up @@ -84,7 +84,7 @@ autogen = ["pyautogen>=0.2.19", "praisonai-tools>=0.0.7", "crewai"]

[tool.poetry]
name = "PraisonAI"
version = "2.0.51"
version = "2.0.52"
description = "PraisonAI is an AI Agents Framework with Self Reflection. PraisonAI application combines PraisonAI Agents, AutoGen, and CrewAI into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customisation, and efficient human–agent collaboration."
authors = ["Mervin Praison"]
license = ""
Expand All @@ -102,7 +102,7 @@ python = ">=3.10,<3.13"
rich = ">=13.7"
markdown = ">=3.5"
pyparsing = ">=3.0.0"
praisonaiagents = ">=0.0.42"
praisonaiagents = ">=0.0.43"
python-dotenv = ">=0.19.0"
instructor = ">=1.3.3"
PyYAML = ">=6.0"
Expand Down
10 changes: 5 additions & 5 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 177027d

Please sign in to comment.