Skip to content

Commit adcfa29

Browse files
author
praison
committed
Release v4.6.38
1 parent 7efd007 commit adcfa29

11 files changed

Lines changed: 648 additions & 554 deletions

File tree

docker/Dockerfile.chat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN mkdir -p /root/.praison
1616
# Install Python packages (using latest versions)
1717
RUN pip install --no-cache-dir \
1818
praisonai_tools \
19-
"praisonai>=4.6.37" \
19+
"praisonai>=4.6.38" \
2020
"praisonai[chat]" \
2121
"embedchain[github,youtube]"
2222

docker/Dockerfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RUN mkdir -p /root/.praison
2020
# Install Python packages (using latest versions)
2121
RUN pip install --no-cache-dir \
2222
praisonai_tools \
23-
"praisonai>=4.6.37" \
23+
"praisonai>=4.6.38" \
2424
"praisonai[ui]" \
2525
"praisonai[chat]" \
2626
"praisonai[realtime]" \

docker/Dockerfile.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN mkdir -p /root/.praison
1616
# Install Python packages (using latest versions)
1717
RUN pip install --no-cache-dir \
1818
praisonai_tools \
19-
"praisonai>=4.6.37" \
19+
"praisonai>=4.6.38" \
2020
"praisonai[ui]" \
2121
"praisonai[crewai]"
2222

src/praisonai-agents/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "praisonaiagents"
7-
version = "1.6.37"
7+
version = "1.6.38"
88
description = "Praison AI agents for completing complex tasks with Self Reflection Agents"
99
readme = "README.md"
1010
requires-python = ">=3.10"

src/praisonai-agents/uv.lock

Lines changed: 207 additions & 174 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/praisonai/README.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,35 @@ def search(query: str) -> str:
294294

295295
@tool
296296
def calculate(expression: str) -> float:
297-
"""Evaluate a math expression."""
298-
return eval(expression)
297+
"""Safely evaluate a numeric arithmetic expression."""
298+
import ast
299+
import operator
300+
301+
# Define allowed operations
302+
_OPS = {
303+
ast.Add: operator.add,
304+
ast.Sub: operator.sub,
305+
ast.Mult: operator.mul,
306+
ast.Div: operator.truediv,
307+
ast.Pow: operator.pow,
308+
ast.USub: operator.neg,
309+
ast.UAdd: operator.pos,
310+
}
311+
312+
def _safe_eval(node):
313+
if isinstance(node, ast.Constant) and isinstance(node.value, (int, float)):
314+
return node.value
315+
elif isinstance(node, ast.BinOp) and type(node.op) in _OPS:
316+
return _OPS[type(node.op)](_safe_eval(node.left), _safe_eval(node.right))
317+
elif isinstance(node, ast.UnaryOp) and type(node.op) in _OPS:
318+
return _OPS[type(node.op)](_safe_eval(node.operand))
319+
else:
320+
raise ValueError("Unsupported expression")
321+
322+
try:
323+
return _safe_eval(ast.parse(expression, mode="eval").body)
324+
except (ValueError, SyntaxError, TypeError, ZeroDivisionError, OverflowError):
325+
raise ValueError("Invalid arithmetic expression")
299326

300327
agent = Agent(
301328
instructions="You are a helpful assistant",
@@ -304,6 +331,7 @@ agent = Agent(
304331
agent.start("Search for AI news and calculate 15*4")
305332
```
306333

334+
> ⚠️ **Security Note:** Never use `eval()`, `exec()`, or `subprocess` in tool functions that process LLM-generated or user-supplied input. Always validate and sanitize inputs to prevent code injection attacks.
307335
> 📖 [Full tools docs](https://docs.praison.ai/docs/tools/tools) — BaseTool, tool packages, 100+ built-in tools
308336
309337
### 5. Persistence (Databases)
@@ -330,6 +358,15 @@ pip install "praisonai[claw]"
330358
praisonai claw
331359
```
332360

361+
#### Required Environment Variables
362+
363+
Copy `.env.example` to `.env` and configure the following variables:
364+
365+
| Variable | Required | Description |
366+
|----------|----------|-------------|
367+
| `OPENAI_API_KEY` | Yes | OpenAI API key for all LLM calls |
368+
| `TAVILY_API_KEY` | Yes (Claw) | Tavily key for the built-in web-search tool. Get one free at https://app.tavily.com |
369+
333370
Open **http://localhost:8082** — the dashboard comes with 13 built-in pages: Chat, Agents, Memory, Knowledge, Channels, Guardrails, Cron, and more. Add messaging channels directly from the UI.
334371

335372
> 📖 [Full Claw docs](https://docs.praison.ai/docs/concepts/claw) — platform tokens, CLI options, Docker, and YAML agent mode

src/praisonai/praisonai.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ class Praisonai < Formula
33

44
desc "AI tools for various AI applications"
55
homepage "https://github.com/MervinPraison/PraisonAI"
6-
url "https://github.com/MervinPraison/PraisonAI/archive/refs/tags/v4.6.37.tar.gz"
7-
sha256 `curl -sL https://github.com/MervinPraison/PraisonAI/archive/refs/tags/v4.6.37.tar.gz | shasum -a 256`.split.first
6+
url "https://github.com/MervinPraison/PraisonAI/archive/refs/tags/v4.6.38.tar.gz"
7+
sha256 `curl -sL https://github.com/MervinPraison/PraisonAI/archive/refs/tags/v4.6.38.tar.gz | shasum -a 256`.split.first
88
license "MIT"
99

1010
depends_on "python@3.11"

src/praisonai/praisonai/deploy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def create_dockerfile(self):
5757
file.write("FROM python:3.11-slim\n")
5858
file.write("WORKDIR /app\n")
5959
file.write("COPY . .\n")
60-
file.write("RUN pip install flask praisonai==4.6.37 gunicorn markdown\n")
60+
file.write("RUN pip install flask praisonai==4.6.38 gunicorn markdown\n")
6161
file.write("EXPOSE 8080\n")
6262
file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
6363

src/praisonai/praisonai/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "4.6.37"
1+
__version__ = "4.6.38"

src/praisonai/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ dependencies = [
1212
"rich>=13.7",
1313
"markdown>=3.5",
1414
"pyparsing>=3.0.0",
15-
"praisonaiagents>=1.6.37",
15+
"praisonaiagents>=1.6.38",
1616
"python-dotenv>=0.19.0",
17-
"litellm>=1.81.0,<=1.82.6",
17+
"litellm>=1.83.14,<2",
1818
"PyYAML>=6.0",
1919
"mcp>=1.20.0",
2020
"typer>=0.9.0",

0 commit comments

Comments
 (0)