Compare commits

...
4 Commits
Author SHA1 Message Date
Mervin Praison 7a8c25621c Merge pull request #273 from MervinPraison/develop
fixing internet search tool
2025-01-07 06:55:38 +00:00
MervinPraison 218c5443b1 fixing internet search tool 2025-01-07 06:55:17 +00:00
Mervin Praison f56810341c Merge pull request #272 from MervinPraison/develop
updating docs
2025-01-07 06:09:35 +00:00
MervinPraison 4f601a573f updating docs 2025-01-07 06:09:14 +00:00
29 changed files with 29359 additions and 412 deletions

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
FROM python:3.11-slim
WORKDIR /app
COPY . .
RUN pip install flask praisonai==2.0.34 gunicorn markdown
RUN pip install flask praisonai==2.0.35 gunicorn markdown
EXPOSE 8080
CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]
+28535
View File
File diff suppressed because it is too large. Load diff
+65 -54
View File
@@ -8,6 +8,59 @@ TOOL_MAPPINGS = {
'internet_search': ('.duckduckgo_tools', None),
'duckduckgo': ('.duckduckgo_tools', None),
# arXiv Tools
'search_arxiv': ('.arxiv_tools', None),
'get_arxiv_paper': ('.arxiv_tools', None),
'get_papers_by_author': ('.arxiv_tools', None),
'get_papers_by_category': ('.arxiv_tools', None),
'arxiv_tools': ('.arxiv_tools', None),
# Wikipedia Tools
'wiki_search': ('.wikipedia_tools', None),
'wiki_summary': ('.wikipedia_tools', None),
'wiki_page': ('.wikipedia_tools', None),
'wiki_random': ('.wikipedia_tools', None),
'wiki_language': ('.wikipedia_tools', None),
'wikipedia_tools': ('.wikipedia_tools', None),
# Newspaper Tools
'get_article': ('.newspaper_tools', None),
'get_news_sources': ('.newspaper_tools', None),
'get_articles_from_source': ('.newspaper_tools', None),
'get_trending_topics': ('.newspaper_tools', None),
'newspaper_tools': ('.newspaper_tools', None),
# Spider Tools
'scrape_page': ('.spider_tools', None),
'extract_links': ('.spider_tools', None),
'crawl': ('.spider_tools', None),
'extract_text': ('.spider_tools', None),
'spider_tools': ('.spider_tools', None),
# DuckDB Tools
'query': ('.duckdb_tools', None),
'create_table': ('.duckdb_tools', None),
'load_data': ('.duckdb_tools', None),
'export_data': ('.duckdb_tools', None),
'get_table_info': ('.duckdb_tools', None),
'analyze_data': ('.duckdb_tools', None),
'duckdb_tools': ('.duckdb_tools', None),
# Shell Tools
'execute_command': ('.shell_tools', None),
'list_processes': ('.shell_tools', None),
'kill_process': ('.shell_tools', None),
'get_system_info': ('.shell_tools', None),
'shell_tools': ('.shell_tools', None),
# Calculator Tools
'evaluate': ('.calculator_tools', None),
'solve_equation': ('.calculator_tools', None),
'convert_units': ('.calculator_tools', None),
'calculate_statistics': ('.calculator_tools', None),
'calculate_financial': ('.calculator_tools', None),
'calculator_tools': ('.calculator_tools', None),
# Class methods from YFinance
'get_stock_price': ('.yfinance_tools', 'YFinanceTools'),
'get_stock_info': ('.yfinance_tools', 'YFinanceTools'),
@@ -68,14 +121,6 @@ TOOL_MAPPINGS = {
'transform_yaml': ('.yaml_tools', 'YAMLTools'),
'yaml_tools': ('.yaml_tools', 'YAMLTools'),
# Calculator Tools
'evaluate': ('.calculator_tools', 'CalculatorTools'),
'solve_equation': ('.calculator_tools', 'CalculatorTools'),
'convert_units': ('.calculator_tools', 'CalculatorTools'),
'calculate_statistics': ('.calculator_tools', 'CalculatorTools'),
'calculate_financial': ('.calculator_tools', 'CalculatorTools'),
'calculator_tools': ('.calculator_tools', 'CalculatorTools'),
# Python Tools
'execute_code': ('.python_tools', 'PythonTools'),
'analyze_code': ('.python_tools', 'PythonTools'),
@@ -90,51 +135,6 @@ TOOL_MAPPINGS = {
'group_by': ('.pandas_tools', 'PandasTools'),
'pivot_table': ('.pandas_tools', 'PandasTools'),
'pandas_tools': ('.pandas_tools', 'PandasTools'),
# Wikipedia Tools
'search': ('.wikipedia_tools', 'WikipediaTools'),
'get_wikipedia_summary': ('.wikipedia_tools', 'WikipediaTools'),
'get_wikipedia_page': ('.wikipedia_tools', 'WikipediaTools'),
'get_random_wikipedia': ('.wikipedia_tools', 'WikipediaTools'),
'set_wikipedia_language': ('.wikipedia_tools', 'WikipediaTools'),
'wikipedia_tools': ('.wikipedia_tools', 'WikipediaTools'),
# Newspaper Tools
'get_article': ('.newspaper_tools', 'NewspaperTools'),
'get_news_sources': ('.newspaper_tools', 'NewspaperTools'),
'get_articles_from_source': ('.newspaper_tools', 'NewspaperTools'),
'get_trending_topics': ('.newspaper_tools', 'NewspaperTools'),
'newspaper_tools': ('.newspaper_tools', 'NewspaperTools'),
# arXiv Tools
'search_arxiv': ('.arxiv_tools', 'ArxivTools'),
'get_arxiv_paper': ('.arxiv_tools', 'ArxivTools'),
'get_papers_by_author': ('.arxiv_tools', 'ArxivTools'),
'get_papers_by_category': ('.arxiv_tools', 'ArxivTools'),
'arxiv_tools': ('.arxiv_tools', 'ArxivTools'),
# Spider Tools
'scrape_page': ('.spider_tools', 'SpiderTools'),
'extract_links': ('.spider_tools', 'SpiderTools'),
'crawl': ('.spider_tools', 'SpiderTools'),
'extract_text': ('.spider_tools', 'SpiderTools'),
'spider_tools': ('.spider_tools', 'SpiderTools'),
# DuckDB Tools
'query': ('.duckdb_tools', 'DuckDBTools'),
'create_table': ('.duckdb_tools', 'DuckDBTools'),
'load_data': ('.duckdb_tools', 'DuckDBTools'),
'export_data': ('.duckdb_tools', 'DuckDBTools'),
'get_table_info': ('.duckdb_tools', 'DuckDBTools'),
'analyze_data': ('.duckdb_tools', 'DuckDBTools'),
'duckdb_tools': ('.duckdb_tools', 'DuckDBTools'),
# Shell Tools
'execute_command': ('.shell_tools', 'ShellTools'),
'list_processes': ('.shell_tools', 'ShellTools'),
'kill_process': ('.shell_tools', 'ShellTools'),
'get_system_info': ('.shell_tools', 'ShellTools'),
'shell_tools': ('.shell_tools', 'ShellTools'),
}
_instances = {} # Cache for class instances
@@ -149,7 +149,18 @@ def __getattr__(name: str) -> Any:
if class_name is None:
# Direct function import
module = import_module(module_path, __package__)
if name in ['duckduckgo', 'file_tools', 'pandas_tools', 'wikipedia_tools',
if name in [
'duckduckgo', 'internet_search',
'search_arxiv', 'get_arxiv_paper', 'get_papers_by_author', 'get_papers_by_category',
'wiki_search', 'wiki_summary', 'wiki_page', 'wiki_random', 'wiki_language',
'get_article', 'get_news_sources', 'get_articles_from_source', 'get_trending_topics',
'scrape_page', 'extract_links', 'crawl', 'extract_text',
'query', 'create_table', 'load_data', 'export_data', 'get_table_info', 'analyze_data',
'execute_command', 'list_processes', 'kill_process', 'get_system_info',
'evaluate', 'solve_equation', 'convert_units', 'calculate_statistics', 'calculate_financial'
]:
return getattr(module, name)
if name in ['file_tools', 'pandas_tools', 'wikipedia_tools',
'newspaper_tools', 'arxiv_tools', 'spider_tools', 'duckdb_tools', 'csv_tools', 'json_tools', 'excel_tools', 'xml_tools', 'yaml_tools', 'calculator_tools', 'python_tools', 'shell_tools']:
return module # Returns the callable module
return getattr(module, name)
@@ -12,7 +12,6 @@ results = duckduckgo("AI news")
from typing import List, Dict
import logging
from importlib import util
import sys
def internet_search(query: str) -> List[Dict]:
"""Perform an internet search using DuckDuckGo."""
@@ -40,8 +39,9 @@ def internet_search(query: str) -> List[Dict]:
logging.error(error_msg)
return [{"error": error_msg}]
# Make the module callable
sys.modules[__name__].__call__ = internet_search
def duckduckgo(query: str) -> List[Dict]:
"""Alias for internet_search function."""
return internet_search(query)
if __name__ == "__main__":
# Example usage
+21 -21
View File
@@ -2,13 +2,13 @@
Usage:
from praisonaiagents.tools import wikipedia_tools
summary = wikipedia_tools.get_summary("Python programming language")
page = wikipedia_tools.get_page("Python programming language")
results = wikipedia_tools.search("Python programming")
summary = wikipedia_tools.wiki_summary("Python programming language")
page = wikipedia_tools.wiki_page("Python programming language")
results = wikipedia_tools.wiki_search("Python programming")
or
from praisonaiagents.tools import get_wikipedia_summary, get_wikipedia_page
summary = get_wikipedia_summary("Python programming language")
from praisonaiagents.tools import wiki_search, wiki_summary, wiki_page
summary = wiki_summary("Python programming language")
"""
import logging
@@ -32,7 +32,7 @@ class WikipediaTools:
# Set default language to English
wikipedia.set_lang("en")
def search(
def wiki_search(
self,
query: str,
results: int = 10,
@@ -63,7 +63,7 @@ class WikipediaTools:
logging.error(error_msg)
return {"error": error_msg}
def get_summary(
def wiki_summary(
self,
title: str,
sentences: int = 5,
@@ -92,7 +92,7 @@ class WikipediaTools:
logging.error(error_msg)
return {"error": error_msg}
def get_page(
def wiki_page(
self,
title: str,
auto_suggest: bool = True
@@ -168,7 +168,7 @@ class WikipediaTools:
return sections
def get_random(self, pages: int = 1) -> Union[List[str], Dict[str, str]]:
def wiki_random(self, pages: int = 1) -> Union[List[str], Dict[str, str]]:
"""
Get random Wikipedia page titles.
@@ -185,7 +185,7 @@ class WikipediaTools:
logging.error(error_msg)
return {"error": error_msg}
def set_language(self, language: str) -> bool:
def wiki_language(self, language: str) -> bool:
"""
Set the language for Wikipedia searches.
@@ -205,11 +205,11 @@ class WikipediaTools:
# Create instance for direct function access
_wikipedia_tools = WikipediaTools()
search = _wikipedia_tools.search
get_summary = _wikipedia_tools.get_summary
get_page = _wikipedia_tools.get_page
get_random = _wikipedia_tools.get_random
set_language = _wikipedia_tools.set_language
wiki_search = _wikipedia_tools.wiki_search
wiki_summary = _wikipedia_tools.wiki_summary
wiki_page = _wikipedia_tools.wiki_page
wiki_random = _wikipedia_tools.wiki_random
wiki_language = _wikipedia_tools.wiki_language
if __name__ == "__main__":
# Example usage
@@ -220,7 +220,7 @@ if __name__ == "__main__":
# 1. Search for a topic
print("1. Searching Wikipedia")
print("------------------------------")
search_results = search("Python programming language")
search_results = wiki_search("Python programming language")
print("Search results:")
print(json.dumps(search_results, indent=2))
print()
@@ -228,7 +228,7 @@ if __name__ == "__main__":
# 2. Get a page summary
print("2. Getting Page Summary")
print("------------------------------")
summary = get_summary("Python programming language", sentences=3)
summary = wiki_summary("Python programming language", sentences=3)
print("Summary:")
print(summary)
print()
@@ -236,7 +236,7 @@ if __name__ == "__main__":
# 3. Get detailed page information
print("3. Getting Full Page Information")
print("------------------------------")
page = get_page("Python programming language")
page = wiki_page("Python programming language")
if isinstance(page, dict) and "error" not in page:
print("Page sections:")
for section in page["sections"]:
@@ -252,7 +252,7 @@ if __name__ == "__main__":
# 4. Get random pages
print("4. Getting Random Pages")
print("------------------------------")
random_pages = get_random(3)
random_pages = wiki_random(3)
print("Random page titles:")
print(json.dumps(random_pages, indent=2))
print()
@@ -260,9 +260,9 @@ if __name__ == "__main__":
# 5. Try different language
print("5. Changing Language")
print("------------------------------")
success = set_language("es")
success = wiki_language("es")
if success:
summary = get_summary("Python (lenguaje de programación)", sentences=1)
summary = wiki_summary("Python (lenguaje de programación)", sentences=1)
print("Spanish summary:")
print(summary)
print()
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "praisonaiagents"
version = "0.0.25"
version = "0.0.26"
description = "Praison AI agents for completing complex tasks with Self Reflection Agents"
authors = [
{ name="Mervin Praison" }
+30
View File
@@ -0,0 +1,30 @@
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import get_article, get_news_sources, get_articles_from_source, get_trending_topics
# Create Wikipedia agent
news_agent = Agent(
name="NewsAgent",
role="News Analyst",
goal="Collect and analyze news articles from various sources.",
backstory="Expert in news gathering and content analysis.",
tools=[get_article, get_news_sources, get_articles_from_source, get_trending_topics],
self_reflect=False
)
# Define research task
news_task = Task(
description="Analyze news articles about 'AI developments' from major tech news sources.",
expected_output="Summary of key AI developments with source articles.",
agent=news_agent,
name="ai_news"
)
# Run agent
agents = PraisonAIAgents(
agents=[news_agent],
tasks=[news_task],
process="sequential"
)
agents.start()
+1 -1
View File
@@ -186,7 +186,7 @@ wheels = [
[[package]]
name = "praisonaiagents"
version = "0.0.25"
version = "0.0.26"
source = { editable = "." }
dependencies = [
{ name = "openai" },
+1 -1
View File
@@ -110,7 +110,7 @@ Loads environment variables from .env file or system and sets them.</p>
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.34 gunicorn markdown\n&#34;)
file.write(&#34;RUN pip install flask praisonai==2.0.35 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;)
+1 -1
View File
@@ -1,5 +1,5 @@
---
title: "Code Execution Agent"
title: "Code Execution AI Agent"
sidebarTitle: "Code Agent"
description: "Learn how to create AI agents that can write and execute Python code safely using e2b code interpreter."
icon: "code"
+279
View File
@@ -0,0 +1,279 @@
---
title: "Math AI Agent"
sidebarTitle: "Math Agent"
description: "Learn how to create AI agents that can perform complex mathematical calculations, unit conversions, and financial computations."
icon: "calculator"
---
<Note>
**Prerequisites**
- Python 3.10 or higher
- PraisonAI Agents package installed
- Basic understanding of Python
- sympy and pint packages (automatically installed when needed)
</Note>
## Quick Start
Create AI agents that can perform complex mathematical calculations, unit conversions, and financial computations!
<Steps>
<Step title="Install Package">
First, install the required package:
```bash
pip install praisonaiagents
```
</Step>
<Step title="Import Required Components">
Import the necessary components:
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import (
evaluate, solve_equation, convert_units,
calculate_statistics, calculate_financial
)
```
</Step>
<Step title="Create Math Agent">
Set up your mathematical computation agent:
```python
math_agent = Agent(
name="MathAssistant",
description="Expert in mathematical calculations and analysis",
tools=[
evaluate, solve_equation, convert_units,
calculate_statistics, calculate_financial
]
)
```
</Step>
</Steps>
## Understanding Math Agents
<Card title="What are Math Agents?" icon="question">
Math agents are specialized AI agents that can:
- Evaluate mathematical expressions
- Solve equations and systems of equations
- Perform unit conversions
- Calculate statistical metrics
- Handle financial calculations
</Card>
## Key Components
<CardGroup cols={2}>
<Card title="Expression Evaluator" icon="function">
Evaluates mathematical expressions
```python
evaluate("2 + 2 * 3")
evaluate("sin(pi/2) + sqrt(16)")
```
</Card>
<Card title="Equation Solver" icon="equals">
Solves mathematical equations
```python
solve_equation("2*x + 3 = 7")
solve_equation("x^2 - 5*x + 6 = 0")
```
</Card>
<Card title="Unit Converter" icon="arrows-rotate">
Converts between different units
```python
convert_units(100, "meters", "kilometers")
```
</Card>
<Card title="Statistical Calculator" icon="chart-simple">
Calculates statistical metrics
```python
calculate_statistics([1, 2, 3, 4, 5])
```
</Card>
</CardGroup>
## Examples
### Basic Calculations Example
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import evaluate, solve_equation
# Create agent
math_agent = Agent(
name="MathAssistant",
description="Expert in mathematical calculations",
tools=[evaluate, solve_equation]
)
# Define tasks
calculation_task = Task(
description="Calculate the value of: (3 + 4) * 2 - sqrt(16)",
expected_output="The result of the mathematical expression",
agent=math_agent
)
equation_task = Task(
description="Solve the equation: x^2 - 5x + 6 = 0",
expected_output="The solutions to the quadratic equation",
agent=math_agent
)
# Initialize and run agents
agents = PraisonAIAgents(
agents=[math_agent],
tasks=[calculation_task, equation_task]
)
result = agents.start()
```
### Advanced Mathematical Operations
<CodeGroup>
```python Statistical Analysis
# Create a statistical analysis task
stats_task = Task(
description="""
Calculate statistical metrics for the dataset:
[12, 15, 18, 22, 25, 28, 32, 35, 38, 42]
""",
agent=math_agent
)
```
```python Financial Calculations
# Create a financial calculation task
finance_task = Task(
description="""
Calculate compound interest for:
- Principal: $10,000
- Rate: 5% annually
- Time: 3 years
- Compounding: Monthly
""",
agent=math_agent
)
```
</CodeGroup>
## Best Practices
<AccordionGroup>
<Accordion title="Expression Handling">
Handle expressions safely:
```python
# Good - Using variables dictionary
evaluate(
"x^2 + y",
variables={"x": 3, "y": 4}
)
# Good - Setting precision
evaluate(
"pi + e",
precision=5
)
```
</Accordion>
<Accordion title="Task Description">
Write clear mathematical requirements:
```python
# Good
Task(description="""
Calculate the following:
1. Area of a circle with radius 5
2. Convert the result to square inches
3. Round to 2 decimal places
""")
# Too vague
Task(description="Do some math")
```
</Accordion>
</AccordionGroup>
## Common Patterns
### Multi-Step Calculations
```python
# Calculate area
area_task = Task(
description="Calculate the area of a circle with radius 5",
agent=math_agent
)
# Convert units
conversion_task = Task(
description="Convert the area from square meters to square feet",
agent=math_agent
)
# Format result
formatting_task = Task(
description="Round the result to 2 decimal places",
agent=math_agent
)
```
### Statistical Analysis Pipeline
```python
# Gather data
data_task = Task(
description="Generate a dataset of 100 random numbers",
agent=math_agent
)
# Calculate statistics
stats_task = Task(
description="Calculate mean, median, mode, and standard deviation",
agent=math_agent
)
# Visualize results
viz_task = Task(
description="Create a summary of the statistical analysis",
agent=math_agent
)
```
## Troubleshooting
<CardGroup cols={2}>
<Card title="Expression Errors" icon="triangle-exclamation">
Check expression syntax and variable definitions:
```python
try:
result = evaluate("x + y", variables={"x": 1})
except Exception as e:
print(f"Error: Missing variable 'y'")
```
</Card>
<Card title="Unit Conversion" icon="ruler">
Ensure compatible unit types and valid unit names
```python
# Valid conversion
convert_units(100, "celsius", "fahrenheit")
# Invalid conversion
# convert_units(100, "meters", "celsius")
```
</Card>
</CardGroup>
## Next Steps
<CardGroup cols={2}>
<Card title="Advanced Mathematics" icon="graduation-cap" href="./advanced-math">
Learn about complex mathematical operations
</Card>
<Card title="Custom Math Tools" icon="wrench" href="./custom-tools">
Create custom mathematical computation tools
</Card>
</CardGroup>
<Note>
Math agents provide a powerful way to perform complex mathematical operations, statistical analysis, and financial calculations. They're perfect for data analysis, scientific computing, and financial modeling tasks.
</Note>
+19 -18
View File
@@ -85,19 +85,11 @@
"features/async",
"features/mini",
"features/codeagent",
"features/mathagent",
"features/structured",
"features/callbacks"
]
},
{
"group": "Other Features",
"pages": [
"train",
"framework/crewai",
"framework/autogen",
"framework/praisonaiagents"
]
},
{
"group": "Getting Started (No Code)",
"pages": [
@@ -109,15 +101,6 @@
"auto"
]
},
{
"group": "User Interface",
"pages": [
"ui/ui",
"ui/chat",
"ui/code",
"ui/realtime"
]
},
{
"group": "Models",
"pages": [
@@ -170,6 +153,24 @@
"tools/googlecalendar"
]
},
{
"group": "Other Features",
"pages": [
"train",
"framework/crewai",
"framework/autogen",
"framework/praisonaiagents"
]
},
{
"group": "User Interface",
"pages": [
"ui/ui",
"ui/chat",
"ui/code",
"ui/realtime"
]
},
{
"group": "Monitoring",
"pages": ["monitoring/agentops"]
+34
View File
@@ -12,6 +12,40 @@ from praisonaiagents.tools import (
)
```
## Example Code
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import (
evaluate, solve_equation, convert_units,
calculate_statistics, calculate_financial
)
agent = Agent(
name="MathAssistant",
tools=[
evaluate, solve_equation, convert_units,
calculate_statistics, calculate_financial
]
)
task = Task(
description="Calculate the area of a circle with radius 5",
expected_output="The area of the circle is 78.54 square units",
agent=agent,
name="calculate_circle_area"
)
# Run agent
agents = PraisonAIAgents(
agents=[agent],
tasks=[task],
process="sequential"
)
agents.start()
```
## Function Details
### evaluate(expression: str, variables: Optional[Dict[str, float]] = None, precision: int = 10)
+3 -3
View File
@@ -27,7 +27,7 @@ Use CSV Tools to process and manipulate CSV files with AI agents.
Import the necessary components:
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import csv, read_csv, write_csv, merge_csv
from praisonaiagents.tools import read_csv, write_csv, merge_csv
```
</Step>
@@ -39,7 +39,7 @@ Use CSV Tools to process and manipulate CSV files with AI agents.
role="CSV Processing Specialist",
goal="Process CSV files efficiently and accurately.",
backstory="Expert in CSV file manipulation and analysis.",
tools=[csv, read_csv, write_csv, merge_csv],
tools=[read_csv, write_csv, merge_csv],
self_reflect=False
)
```
@@ -87,7 +87,7 @@ Use CSV Tools to process and manipulate CSV files with AI agents.
<Card title="CSV Agent" icon="user-robot">
Create specialized CSV agents:
```python
Agent(tools=[csv, read_csv, write_csv, merge_csv])
Agent(tools=[read_csv, write_csv, merge_csv])
```
</Card>
<Card title="CSV Task" icon="list-check">
+14 -35
View File
@@ -27,7 +27,7 @@ Use DuckDB Tools to manage and query databases with AI agents.
Import the necessary components:
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import duckdb
from praisonaiagents.tools import execute_query, load_csv, export_csv
```
</Step>
@@ -39,7 +39,7 @@ Use DuckDB Tools to manage and query databases with AI agents.
role="Database Management Specialist",
goal="Manage and query databases efficiently.",
backstory="Expert in database operations and SQL.",
tools=[duckdb],
tools=[execute_query, load_csv, export_csv],
self_reflect=False
)
```
@@ -176,7 +176,7 @@ success = export_csv(
<Card title="DB Agent" icon="user-robot">
Create specialized database agents:
```python
Agent(tools=[duckdb])
Agent(tools=[execute_query, load_csv, export_csv])
```
</Card>
<Card title="DB Task" icon="list-check">
@@ -205,7 +205,7 @@ success = export_csv(
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import duckdb
from praisonaiagents.tools import execute_query, load_csv, export_csv
# Create database agent
db_agent = Agent(
@@ -213,7 +213,7 @@ db_agent = Agent(
role="Database Specialist",
goal="Query and analyze data efficiently.",
backstory="Expert in database management and SQL.",
tools=[duckdb],
tools=[execute_query, load_csv, export_csv],
self_reflect=False
)
@@ -242,39 +242,18 @@ query_agent = Agent(
name="QueryProcessor",
role="SQL Query Specialist",
goal="Execute SQL queries efficiently.",
tools=[duckdb],
tools=[execute_query],
self_reflect=False
)
# Create analysis agent
analysis_agent = Agent(
name="DataAnalyst",
role="Data Analyst",
goal="Analyze query results and generate insights.",
backstory="Expert in data analysis and reporting.",
# Create data import/export agent
data_agent = Agent(
name="DataProcessor",
role="Data Import/Export Specialist",
goal="Handle data import and export operations efficiently.",
tools=[load_csv, export_csv],
self_reflect=False
)
# Define tasks
query_task = Task(
description="Execute complex SQL queries.",
agent=query_agent,
name="query_execution"
)
analysis_task = Task(
description="Analyze query results and trends.",
agent=analysis_agent,
name="result_analysis"
)
# Run agents
agents = PraisonAIAgents(
agents=[query_agent, analysis_agent],
tasks=[query_task, analysis_task],
process="sequential"
)
agents.start()
```
## Dependencies
@@ -370,7 +349,7 @@ export_csv("SELECT * FROM transformed", "transformed.csv")
name="DBProcessor",
role="Database Specialist",
goal="Process queries accurately and efficiently",
tools=[duckdb]
tools=[execute_query, load_csv, export_csv]
)
```
</Accordion>
@@ -394,7 +373,7 @@ export_csv("SELECT * FROM transformed", "transformed.csv")
querier = Agent(
name="Querier",
role="SQL Specialist",
tools=[duckdb]
tools=[execute_query]
)
# Analysis agent
+45 -45
View File
@@ -70,6 +70,46 @@ Use Excel Tools to process and manipulate Excel files with AI agents.
</Step>
</Steps>
## Understanding Excel Tools
<Card title="What are Excel Tools?" icon="question">
Excel Tools provide Excel processing capabilities for AI agents:
- File reading and writing
- Data extraction
- Sheet manipulation
- Formula handling
- Data analysis
</Card>
## Key Components
<CardGroup cols={2}>
<Card title="Excel Agent" icon="user-robot">
Create specialized Excel agents:
```python
Agent(tools=[read_excel, write_excel, merge_excel])
```
</Card>
<Card title="Excel Task" icon="list-check">
Define Excel tasks:
```python
Task(description="excel_operation")
```
</Card>
<Card title="Process Types" icon="arrows-split-up-and-left">
Sequential or parallel processing:
```python
process="sequential"
```
</Card>
<Card title="Excel Options" icon="sliders">
Customize Excel parameters:
```python
sheet_name="Sheet1", header=0
```
</Card>
</CardGroup>
## Available Functions
```python
@@ -177,53 +217,13 @@ success = merge_excel(
# Returns: bool (True if successful)
```
## Understanding Excel Tools
<Card title="What are Excel Tools?" icon="question">
Excel Tools provide Excel processing capabilities for AI agents:
- File reading and writing
- Data extraction
- Sheet manipulation
- Formula handling
- Data analysis
</Card>
## Key Components
<CardGroup cols={2}>
<Card title="Excel Agent" icon="user-robot">
Create specialized Excel agents:
```python
Agent(tools=[excel, read_excel, write_excel, merge_excel])
```
</Card>
<Card title="Excel Task" icon="list-check">
Define Excel tasks:
```python
Task(description="excel_operation")
```
</Card>
<Card title="Process Types" icon="arrows-split-up-and-left">
Sequential or parallel processing:
```python
process="sequential"
```
</Card>
<Card title="Excel Options" icon="sliders">
Customize Excel parameters:
```python
sheet_name="Sheet1", header=0
```
</Card>
</CardGroup>
## Examples
### Basic Excel Processing Agent
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import excel, read_excel, write_excel, merge_excel
from praisonaiagents.tools import read_excel, write_excel, merge_excel
# Create Excel agent
excel_agent = Agent(
@@ -231,7 +231,7 @@ excel_agent = Agent(
role="Excel Processing Specialist",
goal="Process Excel files efficiently and accurately.",
backstory="Expert in spreadsheet manipulation and analysis.",
tools=[excel, read_excel, write_excel, merge_excel],
tools=[read_excel, write_excel, merge_excel],
self_reflect=False
)
@@ -260,7 +260,7 @@ processor_agent = Agent(
name="Processor",
role="Data Processor",
goal="Process Excel data systematically.",
tools=[excel, read_excel, write_excel, merge_excel],
tools=[read_excel, write_excel, merge_excel],
self_reflect=False
)
@@ -305,7 +305,7 @@ agents.start()
name="ExcelProcessor",
role="Excel Processing Specialist",
goal="Process Excel files accurately and efficiently",
tools=[excel, read_excel, write_excel, merge_excel]
tools=[read_excel, write_excel, merge_excel]
)
```
</Accordion>
@@ -329,7 +329,7 @@ agents.start()
processor = Agent(
name="Processor",
role="Excel Processor",
tools=[excel, read_excel, write_excel, merge_excel]
tools=[read_excel, write_excel, merge_excel]
)
# Analysis agent
+38 -36
View File
@@ -26,7 +26,7 @@ Use File Tools to manage files and directories with AI agents.
Import the necessary components:
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import file_tools
from praisonaiagents.tools import read_file, write_file, list_files, get_file_info, copy_file, move_file, delete_file
```
</Step>
@@ -38,7 +38,7 @@ Use File Tools to manage files and directories with AI agents.
role="File System Specialist",
goal="Manage files and directories efficiently.",
backstory="Expert in file system operations and organization.",
tools=[file_tools],
tools=[read_file, write_file, list_files, get_file_info, copy_file, move_file, delete_file],
self_reflect=False
)
```
@@ -86,7 +86,7 @@ Use File Tools to manage files and directories with AI agents.
<Card title="File Agent" icon="user-robot">
Create specialized file agents:
```python
Agent(tools=[file_tools])
Agent(tools=[read_file, write_file, list_files, get_file_info, copy_file, move_file, delete_file])
```
</Card>
<Card title="File Task" icon="list-check">
@@ -336,22 +336,22 @@ write_file("output.txt", processed)
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import file_tools
from praisonaiagents.tools import read_file, write_file, list_files, get_file_info
# Create file management agent
file_agent = Agent(
name="FileOrganizer",
role="File System Manager",
goal="Organize and manage files efficiently.",
backstory="Expert in file organization and system management.",
tools=[file_tools],
name="FileExpert",
role="File Manager",
goal="Process and organize files efficiently.",
backstory="Expert in file system operations and organization.",
tools=[read_file, write_file, list_files, get_file_info],
self_reflect=False
)
# Define file task
file_task = Task(
description="Sort documents by type and create backup copies.",
expected_output="Organized file structure with backups.",
description="Organize and process documents.",
expected_output="Organized file structure.",
agent=file_agent,
name="file_organization"
)
@@ -365,44 +365,46 @@ agents = PraisonAIAgents(
agents.start()
```
### Advanced File Management with Multiple Agents
### Advanced File Operations with Multiple Agents
```python
# Create file organization agent
organizer_agent = Agent(
name="Organizer",
role="File Organizer",
goal="Sort and organize files systematically.",
tools=[file_tools],
# Create file IO agent
io_agent = Agent(
name="FileIO",
role="File IO Specialist",
goal="Handle file read/write operations efficiently.",
tools=[read_file, write_file],
self_reflect=False
)
# Create backup agent
backup_agent = Agent(
name="Backup",
role="Backup Manager",
goal="Create and manage file backups.",
backstory="Expert in data backup and recovery.",
# Create file management agent
management_agent = Agent(
name="FileManager",
role="File Management Specialist",
goal="Handle file organization and movement.",
tools=[list_files, get_file_info, copy_file, move_file, delete_file],
self_reflect=False
)
# Define tasks
organize_task = Task(
description="Organize files by type and date.",
agent=organizer_agent,
name="organize_files"
io_task = Task(
description="Read and write files.",
expected_output="File operations completed successfully.",
agent=io_agent,
name="file_io"
)
backup_task = Task(
description="Create backups of organized files.",
agent=backup_agent,
name="backup_files"
management_task = Task(
description="Organize and move files.",
expected_output="File management completed successfully.",
agent=management_agent,
name="file_management"
)
# Run agents
agents = PraisonAIAgents(
agents=[organizer_agent, backup_agent],
tasks=[organize_task, backup_task],
agents=[io_agent, management_agent],
tasks=[io_task, management_task],
process="sequential"
)
agents.start()
@@ -418,7 +420,7 @@ agents.start()
name="FileManager",
role="File System Specialist",
goal="Manage files efficiently and safely",
tools=[file_tools]
tools=[read_file, write_file, list_files, get_file_info, copy_file, move_file, delete_file]
)
```
</Accordion>
@@ -442,7 +444,7 @@ agents.start()
organizer = Agent(
name="Organizer",
role="File Organizer",
tools=[file_tools]
tools=[read_file, write_file, list_files, get_file_info, copy_file, move_file, delete_file]
)
# Cleanup agent
+84 -44
View File
@@ -75,6 +75,46 @@ Use JSON Tools to process and manipulate JSON files with AI agents.
</Step>
</Steps>
## Understanding JSON Tools
<Card title="What are JSON Tools?" icon="question">
JSON Tools provide JSON processing capabilities for AI agents:
- File reading and writing
- Data validation
- Schema validation
- Data transformation
- Structure analysis
</Card>
## Key Components
<CardGroup cols={2}>
<Card title="JSON Agent" icon="user-robot">
Create specialized JSON agents:
```python
Agent(tools=[read_json, write_json, merge_json, validate_json, analyze_json, transform_json])
```
</Card>
<Card title="JSON Task" icon="list-check">
Define JSON tasks:
```python
Task(description="json_operation")
```
</Card>
<Card title="Process Types" icon="arrows-split-up-and-left">
Sequential or parallel processing:
```python
process="sequential"
```
</Card>
<Card title="JSON Options" icon="sliders">
Customize JSON operations:
```python
indent=2, sort_keys=True
```
</Card>
</CardGroup>
## Available Functions
```python
@@ -371,11 +411,11 @@ write_json(result, "transformed_data.json")
<Card title="What are JSON Tools?" icon="question">
JSON Tools provide JSON processing capabilities for AI agents:
- JSON parsing
- File validation
- Data extraction
- Structure manipulation
- Format conversion
- File reading and writing
- Data validation
- Schema validation
- Data transformation
- Structure analysis
</Card>
## Key Components
@@ -384,7 +424,7 @@ write_json(result, "transformed_data.json")
<Card title="JSON Agent" icon="user-robot">
Create specialized JSON agents:
```python
Agent(tools=[json])
Agent(tools=[read_json, write_json, merge_json, validate_json, analyze_json, transform_json])
```
</Card>
<Card title="JSON Task" icon="list-check">
@@ -400,9 +440,9 @@ write_json(result, "transformed_data.json")
```
</Card>
<Card title="JSON Options" icon="sliders">
Customize JSON parameters:
Customize JSON operations:
```python
indent=2, encoding="utf-8"
indent=2, sort_keys=True
```
</Card>
</CardGroup>
@@ -413,24 +453,24 @@ write_json(result, "transformed_data.json")
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import json
from praisonaiagents.tools import read_json, write_json, validate_json
# Create JSON agent
# Create JSON processing agent
json_agent = Agent(
name="JSONExpert",
role="JSON Processing Specialist",
goal="Process JSON files efficiently and accurately.",
backstory="Expert in JSON file handling and validation.",
tools=[json],
role="JSON Processor",
goal="Process and validate JSON data efficiently.",
backstory="Expert in JSON processing and validation.",
tools=[read_json, write_json, validate_json],
self_reflect=False
)
# Define JSON task
json_task = Task(
description="Parse and validate API configurations.",
expected_output="Processed and validated JSON data.",
description="Process and validate configuration files.",
expected_output="Validated JSON configuration.",
agent=json_agent,
name="config_processing"
name="config_validation"
)
# Run agent
@@ -442,44 +482,44 @@ agents = PraisonAIAgents(
agents.start()
```
### Advanced JSON Processing with Multiple Agents
### Advanced JSON Operations with Multiple Agents
```python
# Create JSON processing agent
processor_agent = Agent(
name="Processor",
role="JSON Processor",
goal="Process JSON files systematically.",
tools=[json],
# Create JSON validation agent
validation_agent = Agent(
name="Validator",
role="JSON Validation Specialist",
goal="Ensure JSON data integrity and schema compliance.",
tools=[validate_json, analyze_json],
self_reflect=False
)
# Create validation agent
validator_agent = Agent(
name="Validator",
role="Data Validator",
goal="Validate JSON structure and content.",
backstory="Expert in data validation and verification.",
# Create JSON transformation agent
transform_agent = Agent(
name="Transformer",
role="JSON Transformation Specialist",
goal="Transform and merge JSON data structures.",
tools=[transform_json, merge_json],
self_reflect=False
)
# Define tasks
processing_task = Task(
description="Process and transform JSON configurations.",
agent=processor_agent,
name="json_processing"
)
validation_task = Task(
description="Validate processed JSON data.",
agent=validator_agent,
name="data_validation"
)
description="Validate JSON data",
agent=validation_agent,
name="json_validation"
)
transform_task = Task(
description="Transform JSON data",
agent=transform_agent,
name="json_transformation"
)
# Run agents
agents = PraisonAIAgents(
agents=[processor_agent, validator_agent],
tasks=[processing_task, validation_task],
agents=[validation_agent, transform_agent],
tasks=[validation_task, transform_task],
process="sequential"
)
agents.start()
@@ -495,7 +535,7 @@ agents.start()
name="JSONProcessor",
role="JSON Processing Specialist",
goal="Process JSON files accurately and safely",
tools=[json]
tools=[read_json, write_json, merge_json, validate_json, analyze_json, transform_json]
)
```
</Accordion>
@@ -519,7 +559,7 @@ agents.start()
processor = Agent(
name="Processor",
role="JSON Processor",
tools=[json]
tools=[read_json, write_json, merge_json, validate_json, analyze_json, transform_json]
)
# Validation agent
+14 -14
View File
@@ -27,7 +27,7 @@ Use Newspaper Tools to scrape and analyze news articles with AI agents.
Import the necessary components:
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import newspaper
from praisonaiagents.tools import get_article, get_news_sources, get_articles_from_source, get_trending_topics
```
</Step>
@@ -39,7 +39,7 @@ Use Newspaper Tools to scrape and analyze news articles with AI agents.
role="News Analyst",
goal="Collect and analyze news articles from various sources.",
backstory="Expert in news gathering and content analysis.",
tools=[newspaper],
tools=[get_article, get_news_sources, get_articles_from_source, get_trending_topics],
self_reflect=False
)
```
@@ -87,7 +87,7 @@ Use Newspaper Tools to scrape and analyze news articles with AI agents.
<Card title="News Agent" icon="user-robot">
Create specialized news agents:
```python
Agent(tools=[newspaper])
Agent(tools=[get_article, get_news_sources, get_articles_from_source, get_trending_topics])
```
</Card>
<Card title="News Task" icon="list-check">
@@ -247,24 +247,24 @@ topics = get_trending_topics(
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import newspaper
from praisonaiagents.tools import get_article, get_news_sources, get_articles_from_source, get_trending_topics
# Create news agent
news_agent = Agent(
name="NewsCollector",
name="NewsExpert",
role="News Analyst",
goal="Collect and analyze news articles on specific topics.",
backstory="Expert in news gathering and content analysis.",
tools=[newspaper],
goal="Gather and analyze news content efficiently.",
backstory="Expert in news analysis and content curation.",
tools=[get_article, get_news_sources, get_articles_from_source, get_trending_topics],
self_reflect=False
)
# Define news task
news_task = Task(
description="Analyze recent tech news articles about 'artificial intelligence'.",
expected_output="Summary of key AI developments with source articles.",
description="Analyze tech news trends.",
expected_output="Tech news analysis report.",
agent=news_agent,
name="tech_news"
name="tech_news_analysis"
)
# Run agent
@@ -284,7 +284,7 @@ collector_agent = Agent(
name="Collector",
role="News Collector",
goal="Gather comprehensive news coverage.",
tools=[newspaper],
tools=[get_article, get_news_sources, get_articles_from_source, get_trending_topics],
self_reflect=False
)
@@ -329,7 +329,7 @@ agents.start()
name="NewsAnalyst",
role="News Specialist",
goal="Analyze news content effectively",
tools=[newspaper]
tools=[get_article, get_news_sources, get_articles_from_source, get_trending_topics]
)
```
</Accordion>
@@ -353,7 +353,7 @@ agents.start()
monitor = Agent(
name="Monitor",
role="News Monitor",
tools=[newspaper]
tools=[get_article, get_news_sources, get_articles_from_source, get_trending_topics]
)
# Analysis agent
+33 -33
View File
@@ -27,7 +27,7 @@ Use Pandas Tools to manipulate and analyze data with AI agents.
Import the necessary components:
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import pandas_tools
from praisonaiagents.tools import read_csv, read_excel, write_csv, write_excel, filter_data, get_summary, group_by, pivot_table
```
</Step>
@@ -39,7 +39,7 @@ Use Pandas Tools to manipulate and analyze data with AI agents.
role="Data Analysis Specialist",
goal="Analyze and transform data efficiently.",
backstory="Expert in data manipulation and statistical analysis.",
tools=[pandas_tools],
tools=[read_csv, read_excel, write_csv, write_excel, filter_data, get_summary, group_by, pivot_table],
self_reflect=False
)
```
@@ -87,7 +87,7 @@ Use Pandas Tools to manipulate and analyze data with AI agents.
<Card title="Data Agent" icon="user-robot">
Create specialized data agents:
```python
Agent(tools=[pandas_tools])
Agent(tools=[read_csv, read_excel, write_csv, write_excel, filter_data, get_summary, group_by, pivot_table])
```
</Card>
<Card title="Analysis Task" icon="list-check">
@@ -451,24 +451,24 @@ write_csv(demographics, "demographic_analysis.csv")
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import pandas_tools
from praisonaiagents.tools import read_csv, filter_data, get_summary, group_by
# Create data analysis agent
data_agent = Agent(
name="DataAnalyst",
role="Data Analysis Specialist",
goal="Perform comprehensive data analysis.",
backstory="Expert in statistical analysis and data visualization.",
tools=[pandas_tools],
name="DataExpert",
role="Data Analyst",
goal="Process and analyze data efficiently.",
backstory="Expert in data analysis and statistical methods.",
tools=[read_csv, filter_data, get_summary, group_by],
self_reflect=False
)
# Define analysis task
analysis_task = Task(
description="Analyze customer demographics and purchase patterns.",
expected_output="Customer segmentation analysis with insights.",
description="Analyze sales performance data.",
expected_output="Sales analysis report.",
agent=data_agent,
name="customer_analysis"
name="sales_analysis"
)
# Run agent
@@ -480,44 +480,44 @@ agents = PraisonAIAgents(
agents.start()
```
### Advanced Analysis with Multiple Agents
### Advanced Data Operations with Multiple Agents
```python
# Create data preparation agent
prep_agent = Agent(
name="DataPrep",
role="Data Preparation Specialist",
goal="Clean and prepare data for analysis.",
tools=[pandas_tools],
# Create data import/export agent
io_agent = Agent(
name="DataIO",
role="Data IO Specialist",
goal="Handle data import and export operations.",
tools=[read_csv, read_excel, write_csv, write_excel],
self_reflect=False
)
# Create analysis agent
analysis_agent = Agent(
name="Analyzer",
role="Statistical Analyst",
goal="Perform advanced statistical analysis.",
backstory="Expert in statistical modeling and interpretation.",
role="Data Analysis Specialist",
goal="Perform complex data analysis.",
tools=[filter_data, get_summary, group_by, pivot_table],
self_reflect=False
)
# Define tasks
prep_task = Task(
description="Clean and prepare sales data for analysis.",
agent=prep_agent,
name="data_prep"
io_task = Task(
description="Import and export data",
agent=io_agent,
name="data_io"
)
analysis_task = Task(
description="Perform statistical analysis and generate insights.",
description="Analyze data",
agent=analysis_agent,
name="statistical_analysis"
)
name="data_analysis"
)
# Run agents
agents = PraisonAIAgents(
agents=[prep_agent, analysis_agent],
tasks=[prep_task, analysis_task],
agents=[io_agent, analysis_agent],
tasks=[io_task, analysis_task],
process="sequential"
)
agents.start()
@@ -533,7 +533,7 @@ agents.start()
name="DataScientist",
role="Data Analysis Specialist",
goal="Extract meaningful insights from data",
tools=[pandas_tools]
tools=[read_csv, read_excel, write_csv, write_excel, filter_data, get_summary, group_by, pivot_table]
)
```
</Accordion>
@@ -557,7 +557,7 @@ agents.start()
prep_agent = Agent(
name="Preparer",
role="Data Preparation",
tools=[pandas_tools]
tools=[read_csv, read_excel, write_csv, write_excel, filter_data, get_summary, group_by, pivot_table]
)
# Analysis agent
+34 -9
View File
@@ -26,7 +26,7 @@ Use Shell Tools to execute and manage shell commands with AI agents.
Import the necessary components:
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import shell, execute_command, list_processes, kill_process, get_system_info
from praisonaiagents.tools import execute_command, list_processes, kill_process, get_system_info
```
</Step>
@@ -38,7 +38,7 @@ Use Shell Tools to execute and manage shell commands with AI agents.
role="Shell Command Specialist",
goal="Execute shell commands efficiently and safely.",
backstory="Expert in command-line operations and automation.",
tools=[shell],
tools=[execute_command, list_processes, kill_process, get_system_info],
self_reflect=False
)
```
@@ -80,13 +80,38 @@ Use Shell Tools to execute and manage shell commands with AI agents.
- Environment management
</Card>
## Examples
## Key Components
### Basic Shell Command Agent
<CardGroup cols={2}>
<Card title="Shell Agent" icon="user-robot">
Create specialized shell agents:
```python
Agent(tools=[execute_command, list_processes, kill_process, get_system_info])
```
</Card>
<Card title="Shell Task" icon="list-check">
Define shell tasks:
```python
Task(description="shell_operation")
```
</Card>
<Card title="Process Types" icon="arrows-split-up-and-left">
Sequential or parallel processing:
```python
process="sequential"
```
</Card>
<Card title="Shell Options" icon="sliders">
Customize shell operations:
```python
timeout=30, shell=True
```
</Card>
</CardGroup>
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import shell, execute_command, list_processes, kill_process, get_system_info
from praisonaiagents.tools import execute_command, list_processes, kill_process, get_system_info
# Create shell agent
shell_agent = Agent(
@@ -94,7 +119,7 @@ shell_agent = Agent(
role="Shell Command Specialist",
goal="Execute shell commands efficiently and safely.",
backstory="Expert in command-line operations and scripting.",
tools=[shell],
tools=[execute_command, list_processes, kill_process, get_system_info],
self_reflect=False
)
@@ -123,7 +148,7 @@ command_agent = Agent(
name="Commander",
role="Command Executor",
goal="Execute shell commands systematically.",
tools=[shell],
tools=[execute_command, list_processes, kill_process, get_system_info],
self_reflect=False
)
@@ -411,7 +436,7 @@ for cmd in commands:
name="ShellManager",
role="Command Line Specialist",
goal="Execute shell commands safely and efficiently",
tools=[shell]
tools=[execute_command, list_processes, kill_process, get_system_info]
)
```
</Accordion>
@@ -435,7 +460,7 @@ for cmd in commands:
commander = Agent(
name="Commander",
role="Shell Commander",
tools=[shell]
tools=[execute_command]
)
# Monitor agent
+29 -27
View File
@@ -28,7 +28,7 @@ Use Spider Tools to scrape and crawl web content with AI agents.
Import the necessary components:
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import spider
from praisonaiagents.tools import scrape_page, extract_links, crawl, extract_text
```
</Step>
@@ -40,7 +40,7 @@ Use Spider Tools to scrape and crawl web content with AI agents.
role="Web Scraping Specialist",
goal="Extract and analyze web content efficiently.",
backstory="Expert in web scraping and content extraction.",
tools=[spider],
tools=[scrape_page, extract_links, crawl, extract_text],
self_reflect=False
)
```
@@ -75,11 +75,11 @@ Use Spider Tools to scrape and crawl web content with AI agents.
<Card title="What are Spider Tools?" icon="question">
Spider Tools provide web scraping capabilities for AI agents:
- Web page scraping
- Content extraction
- Link crawling
- HTML parsing
- Data structuring
- Page scraping and downloading
- Content extraction and filtering
- Link discovery and crawling
- HTML parsing and cleaning
- Data structuring and formatting
</Card>
## Key Components
@@ -88,7 +88,7 @@ Use Spider Tools to scrape and crawl web content with AI agents.
<Card title="Spider Agent" icon="user-robot">
Create specialized scraping agents:
```python
Agent(tools=[spider])
Agent(tools=[scrape_page, extract_content, crawl_links, parse_html, structure_data])
```
</Card>
<Card title="Spider Task" icon="list-check">
@@ -117,30 +117,30 @@ Use Spider Tools to scrape and crawl web content with AI agents.
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import spider
from praisonaiagents.tools import scrape_page, extract_links, crawl, extract_text
# Create scraping agent
spider_agent = Agent(
# Create search agent
agent = Agent(
name="WebCrawler",
role="Web Scraping Specialist",
goal="Extract web content efficiently and ethically.",
backstory="Expert in web crawling and data extraction.",
tools=[spider],
goal="Extract and analyze web content efficiently.",
backstory="Expert in web scraping and content extraction.",
tools=[scrape_page, extract_links, crawl, extract_text],
self_reflect=False
)
# Define scraping task
scraping_task = Task(
description="Extract article content from news websites.",
expected_output="Structured article data with text and metadata.",
agent=spider_agent,
name="news_scraping"
# Define task
task = Task(
description="Scrape and analyze the content from 'https://example.com'",
expected_output="Extracted content with links and text analysis",
agent=agent,
name="web_scraping"
)
# Run agent
agents = PraisonAIAgents(
agents=[spider_agent],
tasks=[scraping_task],
agents=[agent],
tasks=[task],
process="sequential"
)
agents.start()
@@ -154,7 +154,7 @@ scraper_agent = Agent(
name="Scraper",
role="Content Scraper",
goal="Extract web content systematically.",
tools=[spider],
tools=[scrape_page, crawl_links, parse_html],
self_reflect=False
)
@@ -164,6 +164,7 @@ analysis_agent = Agent(
role="Content Analyst",
goal="Analyze and structure scraped content.",
backstory="Expert in data analysis and organization.",
tools=[extract_content, structure_data],
self_reflect=False
)
@@ -199,7 +200,7 @@ agents.start()
name="WebScraper",
role="Content Extraction Specialist",
goal="Extract web content ethically and efficiently",
tools=[spider]
tools=[scrape_page, extract_content, crawl_links, parse_html, structure_data]
)
```
</Accordion>
@@ -223,13 +224,14 @@ agents.start()
scraper = Agent(
name="Scraper",
role="Web Scraper",
tools=[spider]
tools=[scrape_page, crawl_links, parse_html]
)
# Processing agent
processor = Agent(
name="Processor",
role="Data Processor"
role="Data Processor",
tools=[extract_content, structure_data]
)
# Define tasks
@@ -247,4 +249,4 @@ process_task = Task(
agents = PraisonAIAgents(
agents=[scraper, processor],
tasks=[scrape_task, process_task]
)
)
+18 -15
View File
@@ -28,7 +28,7 @@ Use Wikipedia Tools to retrieve and analyze Wikipedia content with AI agents.
Import the necessary components:
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import wikipedia
from praisonaiagents.tools import wiki_search, wiki_summary, wiki_page, wiki_random, wiki_language
```
</Step>
@@ -40,7 +40,7 @@ Use Wikipedia Tools to retrieve and analyze Wikipedia content with AI agents.
role="Wikipedia Research Specialist",
goal="Research and analyze Wikipedia content efficiently.",
backstory="Expert in information retrieval and content analysis.",
tools=[wikipedia],
tools=[wiki_search, wiki_summary, wiki_page, wiki_random, wiki_language],
self_reflect=False
)
```
@@ -75,11 +75,11 @@ Use Wikipedia Tools to retrieve and analyze Wikipedia content with AI agents.
<Card title="What are Wikipedia Tools?" icon="question">
Wikipedia Tools provide research capabilities for AI agents:
- Article retrieval
- Content search
- Information extraction
- Summary generation
- Reference collection
- Article search and retrieval
- Content summary generation
- Full page information access
- Random article discovery
- Multi-language support
</Card>
## Key Components
@@ -88,7 +88,7 @@ Use Wikipedia Tools to retrieve and analyze Wikipedia content with AI agents.
<Card title="Wiki Agent" icon="user-robot">
Create specialized research agents:
```python
Agent(tools=[wikipedia])
Agent(tools=[wiki_search, wiki_summary, wiki_page, wiki_random, wiki_language])
```
</Card>
<Card title="Wiki Task" icon="list-check">
@@ -117,7 +117,7 @@ Use Wikipedia Tools to retrieve and analyze Wikipedia content with AI agents.
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import wikipedia
from praisonaiagents.tools import wiki_search, wiki_summary, wiki_page, wiki_random, wiki_language
# Create Wikipedia agent
wiki_agent = Agent(
@@ -125,7 +125,7 @@ wiki_agent = Agent(
role="Research Specialist",
goal="Research topics efficiently and accurately.",
backstory="Expert in information gathering and analysis.",
tools=[wikipedia],
tools=[wiki_search, wiki_summary, wiki_page, wiki_random, wiki_language],
self_reflect=False
)
@@ -144,6 +144,7 @@ agents = PraisonAIAgents(
process="sequential"
)
agents.start()
```
### Advanced Research with Multiple Agents
@@ -154,7 +155,7 @@ researcher_agent = Agent(
name="Researcher",
role="Content Researcher",
goal="Research topics systematically.",
tools=[wikipedia],
tools=[wiki_search, wiki_summary, wiki_page],
self_reflect=False
)
@@ -164,6 +165,7 @@ analysis_agent = Agent(
role="Content Analyst",
goal="Analyze and summarize research findings.",
backstory="Expert in content analysis and synthesis.",
tools=[wiki_summary, wiki_page],
self_reflect=False
)
@@ -199,7 +201,7 @@ agents.start()
name="WikiResearcher",
role="Research Specialist",
goal="Research topics accurately and efficiently",
tools=[wikipedia]
tools=[wiki_search, wiki_summary, wiki_page, wiki_random, wiki_language]
)
```
</Accordion>
@@ -223,13 +225,14 @@ agents.start()
researcher = Agent(
name="Researcher",
role="Wiki Researcher",
tools=[wikipedia]
tools=[wiki_search, wiki_summary, wiki_page]
)
# Analysis agent
analyzer = Agent(
name="Analyzer",
role="Content Analyzer"
role="Content Analyzer",
tools=[wiki_summary, wiki_page]
)
# Define tasks
@@ -247,4 +250,4 @@ analyze_task = Task(
agents = PraisonAIAgents(
agents=[researcher, analyzer],
tasks=[research_task, analyze_task]
)
)
+16 -14
View File
@@ -27,7 +27,7 @@ Use XML Tools to process and manipulate XML files with AI agents.
Import the necessary components:
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import xml
from praisonaiagents.tools import read_xml, write_xml, transform_xml, validate_xml, xml_to_dict, dict_to_xml
```
</Step>
@@ -39,7 +39,7 @@ Use XML Tools to process and manipulate XML files with AI agents.
role="XML Processing Specialist",
goal="Process XML files efficiently and accurately.",
backstory="Expert in XML file manipulation and validation.",
tools=[xml],
tools=[read_xml, write_xml, transform_xml, validate_xml, xml_to_dict, dict_to_xml],
self_reflect=False
)
```
@@ -74,11 +74,11 @@ Use XML Tools to process and manipulate XML files with AI agents.
<Card title="What are XML Tools?" icon="question">
XML Tools provide XML processing capabilities for AI agents:
- XML parsing
- File validation
- Data extraction
- XML parsing and reading
- File writing and validation
- Data transformation
- Dictionary conversion
- Structure manipulation
- Format conversion
</Card>
## Key Components
@@ -87,7 +87,7 @@ Use XML Tools to process and manipulate XML files with AI agents.
<Card title="XML Agent" icon="user-robot">
Create specialized XML agents:
```python
Agent(tools=[xml])
Agent(tools=[read_xml, write_xml, transform_xml, validate_xml, xml_to_dict, dict_to_xml])
```
</Card>
<Card title="XML Task" icon="list-check">
@@ -116,7 +116,7 @@ Use XML Tools to process and manipulate XML files with AI agents.
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import xml
from praisonaiagents.tools import read_xml, write_xml, transform_xml, validate_xml, xml_to_dict, dict_to_xml
# Create XML agent
xml_agent = Agent(
@@ -124,7 +124,7 @@ xml_agent = Agent(
role="XML Processing Specialist",
goal="Process XML files efficiently and accurately.",
backstory="Expert in XML file handling and validation.",
tools=[xml],
tools=[read_xml, write_xml, transform_xml, validate_xml, xml_to_dict, dict_to_xml],
self_reflect=False
)
@@ -153,7 +153,7 @@ processor_agent = Agent(
name="Processor",
role="XML Processor",
goal="Process XML files systematically.",
tools=[xml],
tools=[read_xml, write_xml, transform_xml],
self_reflect=False
)
@@ -163,6 +163,7 @@ validator_agent = Agent(
role="Data Validator",
goal="Validate XML structure and content.",
backstory="Expert in data validation and verification.",
tools=[validate_xml, xml_to_dict, dict_to_xml],
self_reflect=False
)
@@ -198,7 +199,7 @@ agents.start()
name="XMLProcessor",
role="XML Processing Specialist",
goal="Process XML files accurately and safely",
tools=[xml]
tools=[read_xml, write_xml, transform_xml, validate_xml, xml_to_dict, dict_to_xml]
)
```
</Accordion>
@@ -222,13 +223,14 @@ agents.start()
processor = Agent(
name="Processor",
role="XML Processor",
tools=[xml]
tools=[read_xml, write_xml, transform_xml]
)
# Validation agent
validator = Agent(
name="Validator",
role="Data Validator"
role="Data Validator",
tools=[validate_xml, xml_to_dict, dict_to_xml]
)
# Define tasks
@@ -246,4 +248,4 @@ validate_task = Task(
agents = PraisonAIAgents(
agents=[processor, validator],
tasks=[process_task, validate_task]
)
)
+17 -15
View File
@@ -28,7 +28,7 @@ Use YAML Tools to process and manipulate YAML files with AI agents.
Import the necessary components:
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import yaml
from praisonaiagents.tools import read_yaml, write_yaml, validate_yaml, merge_yaml, convert_yaml
```
</Step>
@@ -40,7 +40,7 @@ Use YAML Tools to process and manipulate YAML files with AI agents.
role="YAML Processing Specialist",
goal="Process YAML files efficiently and accurately.",
backstory="Expert in YAML file manipulation and validation.",
tools=[yaml],
tools=[read_yaml, write_yaml, validate_yaml, merge_yaml, convert_yaml],
self_reflect=False
)
```
@@ -75,11 +75,11 @@ Use YAML Tools to process and manipulate YAML files with AI agents.
<Card title="What are YAML Tools?" icon="question">
YAML Tools provide YAML processing capabilities for AI agents:
- YAML parsing
- File validation
- Data extraction
- Structure manipulation
- Format conversion
- Reading YAML files
- Writing YAML data
- Validating YAML structure
- Merging YAML files
- Converting between formats
</Card>
## Key Components
@@ -88,7 +88,7 @@ Use YAML Tools to process and manipulate YAML files with AI agents.
<Card title="YAML Agent" icon="user-robot">
Create specialized YAML agents:
```python
Agent(tools=[yaml])
Agent(tools=[read_yaml, write_yaml, validate_yaml, merge_yaml, convert_yaml])
```
</Card>
<Card title="YAML Task" icon="list-check">
@@ -117,7 +117,7 @@ Use YAML Tools to process and manipulate YAML files with AI agents.
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import yaml
from praisonaiagents.tools import read_yaml, write_yaml, validate_yaml, merge_yaml, convert_yaml
# Create YAML agent
yaml_agent = Agent(
@@ -125,7 +125,7 @@ yaml_agent = Agent(
role="YAML Processing Specialist",
goal="Process YAML files efficiently and accurately.",
backstory="Expert in YAML file handling and validation.",
tools=[yaml],
tools=[read_yaml, write_yaml, validate_yaml, merge_yaml, convert_yaml],
self_reflect=False
)
@@ -154,7 +154,7 @@ processor_agent = Agent(
name="Processor",
role="YAML Processor",
goal="Process YAML files systematically.",
tools=[yaml],
tools=[read_yaml, write_yaml, convert_yaml],
self_reflect=False
)
@@ -164,6 +164,7 @@ validator_agent = Agent(
role="Data Validator",
goal="Validate YAML structure and content.",
backstory="Expert in data validation and verification.",
tools=[validate_yaml, merge_yaml],
self_reflect=False
)
@@ -199,7 +200,7 @@ agents.start()
name="YAMLProcessor",
role="YAML Processing Specialist",
goal="Process YAML files accurately and safely",
tools=[yaml]
tools=[read_yaml, write_yaml, validate_yaml, merge_yaml, convert_yaml]
)
```
</Accordion>
@@ -223,13 +224,14 @@ agents.start()
processor = Agent(
name="Processor",
role="YAML Processor",
tools=[yaml]
tools=[read_yaml, write_yaml, convert_yaml]
)
# Validation agent
validator = Agent(
name="Validator",
role="Data Validator"
role="Data Validator",
tools=[validate_yaml, merge_yaml]
)
# Define tasks
@@ -247,4 +249,4 @@ validate_task = Task(
agents = PraisonAIAgents(
agents=[processor, validator],
tasks=[process_task, validate_task]
)
)
+17 -15
View File
@@ -28,7 +28,7 @@ Use YFinance Tools to retrieve and analyze financial data with AI agents.
Import the necessary components:
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import yfinance
from praisonaiagents.tools import get_stock_price, get_stock_info, get_historical_data
```
</Step>
@@ -40,7 +40,7 @@ Use YFinance Tools to retrieve and analyze financial data with AI agents.
role="Financial Data Specialist",
goal="Retrieve and analyze financial data efficiently.",
backstory="Expert in financial data analysis and market research.",
tools=[yfinance],
tools=[get_stock_price, get_stock_info, get_historical_data],
self_reflect=False
)
```
@@ -75,11 +75,11 @@ Use YFinance Tools to retrieve and analyze financial data with AI agents.
<Card title="What are YFinance Tools?" icon="question">
YFinance Tools provide financial data capabilities for AI agents:
- Stock data retrieval
- Market analysis
- Historical data
- Company information
- Financial metrics
- Real-time stock prices
- Detailed company information
- Historical market data
- Financial metrics and ratios
- Market performance analysis
</Card>
## Key Components
@@ -88,7 +88,7 @@ Use YFinance Tools to retrieve and analyze financial data with AI agents.
<Card title="Finance Agent" icon="user-robot">
Create specialized finance agents:
```python
Agent(tools=[yfinance])
Agent(tools=[get_stock_price, get_stock_info, get_historical_data])
```
</Card>
<Card title="Finance Task" icon="list-check">
@@ -117,7 +117,7 @@ Use YFinance Tools to retrieve and analyze financial data with AI agents.
```python
from praisonaiagents import Agent, Task, PraisonAIAgents
from praisonaiagents.tools import yfinance
from praisonaiagents.tools import get_stock_price, get_stock_info, get_historical_data
# Create finance agent
finance_agent = Agent(
@@ -125,7 +125,7 @@ finance_agent = Agent(
role="Financial Data Specialist",
goal="Analyze market data efficiently and accurately.",
backstory="Expert in financial analysis and market research.",
tools=[yfinance],
tools=[get_stock_price, get_stock_info, get_historical_data],
self_reflect=False
)
@@ -154,7 +154,7 @@ data_agent = Agent(
name="DataCollector",
role="Market Data Collector",
goal="Retrieve financial data systematically.",
tools=[yfinance],
tools=[get_stock_price, get_historical_data],
self_reflect=False
)
@@ -164,6 +164,7 @@ analysis_agent = Agent(
role="Market Analyst",
goal="Analyze market trends and patterns.",
backstory="Expert in financial market analysis.",
tools=[get_stock_info],
self_reflect=False
)
@@ -199,7 +200,7 @@ agents.start()
name="FinanceAnalyst",
role="Market Analysis Specialist",
goal="Analyze financial data accurately and efficiently",
tools=[yfinance]
tools=[get_stock_price, get_stock_info, get_historical_data]
)
```
</Accordion>
@@ -223,13 +224,14 @@ agents.start()
collector = Agent(
name="Collector",
role="Data Collector",
tools=[yfinance]
tools=[get_stock_price, get_historical_data]
)
# Analysis agent
analyst = Agent(
name="Analyst",
role="Market Analyst"
role="Market Analyst",
tools=[get_stock_info]
)
# Define tasks
@@ -247,4 +249,4 @@ analyze_task = Task(
agents = PraisonAIAgents(
agents=[collector, analyst],
tasks=[collect_task, analyze_task]
)
)
+1 -1
View File
@@ -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.34.tar.gz"
url "https://github.com/MervinPraison/PraisonAI/archive/refs/tags/2.0.35.tar.gz"
sha256 "1828fb9227d10f991522c3f24f061943a254b667196b40b1a3e4a54a8d30ce32" # Replace with actual SHA256 checksum
license "MIT"
+1 -1
View File
@@ -56,7 +56,7 @@ class CloudDeployer:
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.34 gunicorn markdown\n")
file.write("RUN pip install flask praisonai==2.0.35 gunicorn markdown\n")
file.write("EXPOSE 8080\n")
file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
+4 -4
View File
@@ -1,6 +1,6 @@
[project]
name = "PraisonAI"
version = "2.0.34"
version = "2.0.35"
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 = ""
@@ -12,7 +12,7 @@ dependencies = [
"rich>=13.7",
"markdown>=3.5",
"pyparsing>=3.0.0",
"praisonaiagents>=0.0.25",
"praisonaiagents>=0.0.26",
"python-dotenv>=0.19.0",
"instructor>=1.3.3",
"PyYAML>=6.0",
@@ -84,7 +84,7 @@ autogen = ["pyautogen>=0.2.19", "praisonai-tools>=0.0.7", "crewai"]
[tool.poetry]
name = "PraisonAI"
version = "2.0.34"
version = "2.0.35"
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 = ""
@@ -102,7 +102,7 @@ python = ">=3.10,<3.13"
rich = ">=13.7"
markdown = ">=3.5"
pyparsing = ">=3.0.0"
praisonaiagents = ">=0.0.25"
praisonaiagents = ">=0.0.26"
python-dotenv = ">=0.19.0"
instructor = ">=1.3.3"
PyYAML = ">=6.0"