Skip to content

Commit 39316fa

Browse files
committed
Refactor agent guardrails and update versioning
- Removed the outdated agent_guardrails_example.py file. - Introduced a new guardrail_agents_example.py file with improved structure and user-friendly naming. - Updated version in pyproject.toml from 0.0.97 to 0.0.98. - Added revision information in uv.lock for better dependency tracking. - Imported asyncio in agent.py for enhanced functionality.
1 parent 4089c45 commit 39316fa

6 files changed

Lines changed: 6974 additions & 2112 deletions

File tree

src/praisonai-agents/agent_guardrails_example.py

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from praisonaiagents import Agent, Task, TaskOutput, PraisonAIAgents
2+
from typing import Tuple, Any
3+
4+
def validate_content(task_output: TaskOutput) -> Tuple[bool, Any]:
5+
if len(task_output.raw) < 50:
6+
return False, "Content too short"
7+
return True, task_output
8+
9+
agent = Agent(
10+
instructions="You are a writer",
11+
)
12+
13+
task = Task(
14+
description="Write a welcome message",
15+
guardrail=validate_content,
16+
agent=agent
17+
)
18+
19+
praison_agents = PraisonAIAgents(agents=[agent], tasks=[task])
20+
21+
praison_agents.start()

src/praisonai-agents/praisonaiagents/agent/agent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,6 +1693,7 @@ def run_server():
16931693
import threading
16941694
import time
16951695
import inspect
1696+
import asyncio # Import asyncio in the MCP scope
16961697
# logging is already imported at the module level
16971698

16981699
except ImportError as e:

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 = "0.0.97"
7+
version = "0.0.98"
88
description = "Praison AI agents for completing complex tasks with Self Reflection Agents"
99
requires-python = ">=3.10"
1010
authors = [

0 commit comments

Comments
 (0)