Skip to content

Commit

Permalink
Merge pull request #316 from MervinPraison/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
MervinPraison authored Jan 21, 2025
2 parents 23de58d + f89c6e1 commit ded94e3
Show file tree
Hide file tree
Showing 14 changed files with 88 additions and 18 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.54 gunicorn markdown
RUN pip install flask praisonai==2.0.55 gunicorn markdown
EXPOSE 8080
CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]
39 changes: 39 additions & 0 deletions agents/deepseek-agents.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from praisonaiagents import Agent, Task, PraisonAIAgents

# Define the configuration for the Knowledge instance
config = {
"vector_store": {
"provider": "chroma",
"config": {
"collection_name": "praison",
"path": ".praison"
}
}
}

# Create an agent
rag_agent = Agent(
name="RAG Agent",
role="Information Specialist",
goal="Retrieve knowledge efficiently",
llm="deepseek-r1"
)

# Define a task for the agent
rag_task = Task(
name="RAG Task",
description="What is KAG?",
expected_output="Answer to the question",
agent=rag_agent,
context=[config] # Vector Database provided as context
)

# Build Agents
agents = PraisonAIAgents(
agents=[rag_agent],
tasks=[rag_task],
user_id="user1"
)

# Start Agents
agents.start()
2 changes: 0 additions & 2 deletions agents/praisonaiagents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from .agents.autoagents import AutoAgents
from .knowledge.knowledge import Knowledge
from .knowledge.chunking import Chunking
from .memory.memory import Memory
from .main import (
TaskOutput,
ReflectionOutput,
Expand Down Expand Up @@ -38,7 +37,6 @@
'TaskOutput',
'ReflectionOutput',
'AutoAgents',
'Memory',
'display_interaction',
'display_self_reflection',
'display_instruction',
Expand Down
11 changes: 11 additions & 0 deletions agents/praisonaiagents/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,17 @@ def __init__(
reflect_llm: Optional[str] = None,
user_id: Optional[str] = None
):
# Add check at start if memory is requested
if memory is not None:
try:
from ..memory.memory import Memory
MEMORY_AVAILABLE = True
except ImportError:
raise ImportError(
"Memory features requested in Agent but memory dependencies not installed. "
"Please install with: pip install \"praisonaiagents[memory]\""
)

# Handle backward compatibility for required fields
if all(x is None for x in [name, role, goal, backstory, instructions]):
raise ValueError("At least one of name, role, goal, backstory, or instructions must be provided")
Expand Down
11 changes: 11 additions & 0 deletions agents/praisonaiagents/agents/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ def process_video(video_path: str, seconds_per_frame=2):

class PraisonAIAgents:
def __init__(self, agents, tasks=None, verbose=0, completion_checker=None, max_retries=5, process="sequential", manager_llm=None, memory=False, memory_config=None, embedder=None, user_id=None, max_iter=10):
# Add check at the start if memory is requested
if memory:
try:
from ..memory.memory import Memory
MEMORY_AVAILABLE = True
except ImportError:
raise ImportError(
"Memory features requested but memory dependencies not installed. "
"Please install with: pip install \"praisonaiagents[memory]\""
)

if not agents:
raise ValueError("At least one agent must be provided")

Expand Down
2 changes: 1 addition & 1 deletion agents/praisonaiagents/memory/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
CHROMADB_AVAILABLE = True
except ImportError:
CHROMADB_AVAILABLE = False
logger.warning("To use memory features, please run: pip install \"praisonaiagents[memory]\"")
pass

try:
import mem0
Expand Down
11 changes: 11 additions & 0 deletions agents/praisonaiagents/task/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ def __init__(
quality_check=True,
input_file: Optional[str] = None
):
# Add check if memory config is provided
if memory is not None or (config and config.get('memory_config')):
try:
from ..memory.memory import Memory
MEMORY_AVAILABLE = True
except ImportError:
raise ImportError(
"Memory features requested in Task but memory dependencies not installed. "
"Please install with: pip install \"praisonaiagents[memory]\""
)

self.input_file = input_file
self.id = str(uuid.uuid4()) if id is None else str(id)
self.name = name
Expand Down
2 changes: 1 addition & 1 deletion 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.45"
version = "0.0.46"
description = "Praison AI agents for completing complex tasks with Self Reflection Agents"
authors = [
{ name="Mervin Praison" }
Expand Down
2 changes: 1 addition & 1 deletion agents/uv.lock

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

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.54 gunicorn markdown\n&#34;)
file.write(&#34;RUN pip install flask praisonai==2.0.55 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
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.54.tar.gz"
url "https://github.com/MervinPraison/PraisonAI/archive/refs/tags/2.0.55.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.54 gunicorn markdown\n")
file.write("RUN pip install flask praisonai==2.0.55 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.54"
version = "2.0.55"
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.45",
"praisonaiagents>=0.0.46",
"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.54"
version = "2.0.55"
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.45"
praisonaiagents = ">=0.0.46"
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 ded94e3

Please sign in to comment.