Skip to content
Merged
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,5 @@ agents/praisonaiagents/praisonaiagents.egg-info
.praison
# Local Netlify folder
.netlify
.qodo
.qodo
CopilotKit*
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN mkdir -p /root/.praison
# Install Python packages (using latest versions)
RUN pip install --no-cache-dir \
flask \
"praisonai>=2.2.28" \
"praisonai>=2.2.29" \
"praisonai[api]" \
gunicorn \
markdown
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.chat
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN mkdir -p /root/.praison
# Install Python packages (using latest versions)
RUN pip install --no-cache-dir \
praisonai_tools \
"praisonai>=2.2.28" \
"praisonai>=2.2.29" \
"praisonai[chat]" \
"embedchain[github,youtube]"

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN mkdir -p /root/.praison
# Install Python packages (using latest versions)
RUN pip install --no-cache-dir \
praisonai_tools \
"praisonai>=2.2.28" \
"praisonai>=2.2.29" \
"praisonai[ui]" \
"praisonai[chat]" \
"praisonai[realtime]" \
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.ui
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN mkdir -p /root/.praison
# Install Python packages (using latest versions)
RUN pip install --no-cache-dir \
praisonai_tools \
"praisonai>=2.2.28" \
"praisonai>=2.2.29" \
"praisonai[ui]" \
"praisonai[crewai]"

Expand Down
4 changes: 2 additions & 2 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ healthcheck:
## 📦 Package Versions

All Docker images use consistent, up-to-date versions:
- PraisonAI: `>=2.2.28`
- PraisonAI: `>=2.2.29`
- PraisonAI Agents: `>=0.0.92`
- Python: `3.11-slim`

Expand Down Expand Up @@ -218,7 +218,7 @@ docker-compose up -d
### Version Pinning
To use specific versions, update the Dockerfile:
```dockerfile
RUN pip install "praisonai==2.2.28" "praisonaiagents==0.0.92"
RUN pip install "praisonai==2.2.29" "praisonaiagents==0.0.92"
```

## 🌐 Production Deployment
Expand Down
14 changes: 14 additions & 0 deletions src/praisonai-agents/guardrail_agent_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from praisonaiagents import Agent

def validate_content(data):
if len(str(data)) < 50:
return False, "Content too short"
return True, data

agent = Agent(
instructions="You are a writer",
guardrail=validate_content,
max_guardrail_retries=1
)

agent.start("Write a welcome message with 5 words")
7 changes: 2 additions & 5 deletions src/praisonai-agents/praisonaiagents/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,12 +619,9 @@ def _apply_guardrail_with_retry(self, response_text, prompt, temperature=0.2, to
while retry_count <= self.max_guardrail_retries:
# Create TaskOutput object
task_output = TaskOutput(
description="Agent response output",
raw=current_response,
output=current_response,
pydantic=None,
json_dict=None,
name=f"{self.name}_output",
description="Agent response output"
agent=self.name
)

# Process guardrail
Expand Down
11 changes: 7 additions & 4 deletions src/praisonai-agents/praisonaiagents/memory/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,11 +910,14 @@ def calculate_quality_metrics(
"""

try:
# Use OpenAI client from main.py
from ..main import client
# Use LiteLLM for consistency with the rest of the codebase
import litellm

response = client.chat.completions.create(
model=llm or "gpt-4o",
# Convert model name if it's in litellm format
model_name = llm or "gpt-4o-mini"

response = litellm.completion(
model=model_name,
messages=[{
"role": "user",
"content": custom_prompt or default_prompt
Expand Down
6 changes: 5 additions & 1 deletion src/praisonai-agents/praisonaiagents/task/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,11 @@ async def execute_callback(self, task_output: TaskOutput) -> None:
if self.agent:
if getattr(self.agent, '_using_custom_llm', False) and hasattr(self.agent, 'llm_instance'):
# For custom LLM instances (like Ollama)
llm_model = self.agent.llm_instance
# Extract the model name from the LLM instance
if hasattr(self.agent.llm_instance, 'model'):
llm_model = self.agent.llm_instance.model
else:
llm_model = "gpt-4o-mini" # Default fallback
elif hasattr(self.agent, 'llm') and self.agent.llm:
# For standard model strings
llm_model = self.agent.llm
Expand Down
10 changes: 6 additions & 4 deletions src/praisonai-agents/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "praisonaiagents"
version = "0.0.99"
version = "0.0.101"
description = "Praison AI agents for completing complex tasks with Self Reflection Agents"
requires-python = ">=3.10"
authors = [
Expand All @@ -25,7 +25,8 @@ mcp = [
]

memory = [
"chromadb>=1.0.0"
"chromadb>=1.0.0",
"litellm>=1.50.0",
]

knowledge = [
Expand Down Expand Up @@ -63,5 +64,6 @@ all = [
"praisonaiagents[api]"
]

[tool.setuptools]
packages = ["praisonaiagents"]
[tool.setuptools.packages.find]
where = ["."]
include = ["praisonaiagents*"]
33 changes: 33 additions & 0 deletions src/praisonai-agents/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from praisonaiagents import Agent, Task, PraisonAIAgents
import os
from dotenv import load_dotenv

load_dotenv()

llm_config = {
"model": "openai/gpt-4o-mini",
"api_key": os.getenv('OPENAI_API_KEY'),
"temperature": 0.7,
"max_tokens": 2000
}

blog_agent = Agent(
role="Blog Writer",
goal="Write a blog post about AI",
backstory="Expert at writing blog posts",
llm="gpt-4o-mini",
)

blog_task = Task(
description="Write a blog post about AI trends in 1 paragraph",
expected_output="Well-written blog post about AI trends",
agent=blog_agent
)

agents = PraisonAIAgents(
agents=[blog_agent],
tasks=[blog_task],
memory=True
)

result = agents.start()
4 changes: 3 additions & 1 deletion src/praisonai-agents/uv.lock

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

4 changes: 2 additions & 2 deletions src/praisonai/praisonai.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ 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/v2.2.28.tar.gz"
sha256 `curl -sL https://github.com/MervinPraison/PraisonAI/archive/refs/tags/v2.2.28.tar.gz | shasum -a 256`.split.first
url "https://github.com/MervinPraison/PraisonAI/archive/refs/tags/v2.2.29.tar.gz"
sha256 `curl -sL https://github.com/MervinPraison/PraisonAI/archive/refs/tags/v2.2.29.tar.gz | shasum -a 256`.split.first
license "MIT"

depends_on "python@3.11"
Expand Down
2 changes: 1 addition & 1 deletion src/praisonai/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.2.28 gunicorn markdown\n")
file.write("RUN pip install flask praisonai==2.2.29 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 src/praisonai/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "PraisonAI"
version = "2.2.28"
version = "2.2.29"
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.99",
"praisonaiagents>=0.0.101",
"python-dotenv>=0.19.0",
"instructor>=1.3.3",
"PyYAML>=6.0",
Expand Down Expand Up @@ -95,7 +95,7 @@ autogen = ["pyautogen>=0.2.19", "praisonai-tools>=0.0.15", "crewai"]

[tool.poetry]
name = "PraisonAI"
version = "2.2.28"
version = "2.2.29"
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 @@ -113,7 +113,7 @@ python = ">=3.10,<3.13"
rich = ">=13.7"
markdown = ">=3.5"
pyparsing = ">=3.0.0"
praisonaiagents = ">=0.0.99"
praisonaiagents = ">=0.0.101"
python-dotenv = ">=0.19.0"
instructor = ">=1.3.3"
PyYAML = ">=6.0"
Expand Down
10 changes: 5 additions & 5 deletions src/praisonai/uv.lock

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

Loading