-
-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #298 from MervinPraison/develop
Update PraisonAI and praisonaiagents to versions 2.0.46 and 0.0.36 re…
- Loading branch information
Showing
95 changed files
with
2,930 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.45 gunicorn markdown | ||
RUN pip install flask praisonai==2.0.46 gunicorn markdown | ||
EXPOSE 8080 | ||
CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from praisonaiagents import Agent, Tools | ||
from praisonaiagents.tools import read_csv, read_excel, write_csv, write_excel, filter_data, get_summary, group_by, pivot_table | ||
import os | ||
|
||
agent = Agent(instructions="You are a Data Analyst Agent", tools=[read_csv, read_excel, write_csv, write_excel, filter_data, get_summary, group_by, pivot_table]) | ||
agent.start(f""" | ||
Read the data from the csv file {os.path.join(os.path.dirname(__file__), "tesla-stock-price.csv")} | ||
Analyse the data and give me the insights | ||
read_csv to read the file | ||
""") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from praisonaiagents import Agent, Tools | ||
from praisonaiagents.tools import get_stock_price, get_stock_info, get_historical_data | ||
|
||
agent = Agent(instructions="You are a Research Agent", tools=[get_stock_price, get_stock_info, get_historical_data]) | ||
agent.start("Understand current stock price and historical data of Apple and Google. Tell me if I can invest in them") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from praisonaiagents import Agent, Tools | ||
from praisonaiagents.tools import duckduckgo | ||
|
||
agent = Agent(instructions="You are a Image Analysis Agent", tools=[duckduckgo]) | ||
agent.start("I want to go London next week, find me a good hotel and flight") | ||
|
||
from praisonaiagents import Agent, Task, PraisonAIAgents | ||
|
||
# Create Image Analysis Agent | ||
image_agent = Agent( | ||
name="ImageAnalyst", | ||
role="Image Analysis Specialist", | ||
goal="Analyze images and videos to extract meaningful information", | ||
backstory="""You are an expert in computer vision and image analysis. | ||
You excel at describing images, detecting objects, and understanding visual content.""", | ||
llm="gpt-4o-mini", | ||
self_reflect=False | ||
) | ||
|
||
# 1. Task with Image URL | ||
task1 = Task( | ||
name="analyze_landmark", | ||
description="Describe this famous landmark and its architectural features.", | ||
expected_output="Detailed description of the landmark's architecture and significance", | ||
agent=image_agent, | ||
images=["https://upload.wikimedia.org/wikipedia/commons/b/bf/Krakow_-_Kosciol_Mariacki.jpg"] | ||
) | ||
|
||
# 2. Task with Local Image File | ||
task2 = Task( | ||
name="analyze_local_image", | ||
description="What objects can you see in this image? Describe their arrangement.", | ||
expected_output="Detailed description of objects and their spatial relationships", | ||
agent=image_agent, | ||
images=["image.jpg"] | ||
) | ||
|
||
# Create PraisonAIAgents instance | ||
agents = PraisonAIAgents( | ||
agents=[image_agent], | ||
tasks=[task1, task2], | ||
process="sequential", | ||
verbose=1 | ||
) | ||
|
||
# Run all tasks | ||
agents.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from praisonaiagents import Agent, Tools | ||
from praisonaiagents.tools import duckduckgo | ||
|
||
agent = Agent(instructions="You are a Image Analysis Agent", tools=[duckduckgo]) | ||
agent.start("I want to go London next week, find me a good hotel and flight") | ||
|
||
from praisonaiagents import Agent, Task, PraisonAIAgents | ||
|
||
# Create Image Analysis Agent | ||
image_agent = Agent( | ||
name="ImageAnalyst", | ||
role="Image Analysis Specialist", | ||
goal="Analyze images and videos to extract meaningful information", | ||
backstory="""You are an expert in computer vision and image analysis. | ||
You excel at describing images, detecting objects, and understanding visual content.""", | ||
llm="gpt-4o-mini", | ||
self_reflect=False | ||
) | ||
|
||
# 1. Task with Image URL | ||
task1 = Task( | ||
name="analyze_landmark", | ||
description="Describe this famous landmark and its architectural features.", | ||
expected_output="Detailed description of the landmark's architecture and significance", | ||
agent=image_agent, | ||
images=["https://upload.wikimedia.org/wikipedia/commons/b/bf/Krakow_-_Kosciol_Mariacki.jpg"] | ||
) | ||
|
||
# 2. Task with Local Image File | ||
task2 = Task( | ||
name="analyze_local_image", | ||
description="What objects can you see in this image? Describe their arrangement.", | ||
expected_output="Detailed description of objects and their spatial relationships", | ||
agent=image_agent, | ||
images=["image.jpg"] | ||
) | ||
|
||
# Create PraisonAIAgents instance | ||
agents = PraisonAIAgents( | ||
agents=[image_agent], | ||
tasks=[task1, task2], | ||
process="sequential", | ||
verbose=1 | ||
) | ||
|
||
# Run all tasks | ||
agents.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from praisonaiagents import Agent | ||
|
||
agent = Agent(instructions="You are a Markdown Agent, output in markdown format") | ||
agent.start("Write a blog post about AI") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from praisonaiagents import Agent, Tools | ||
from praisonaiagents.tools import duckduckgo | ||
|
||
agent = Agent(instructions="You are a Planning Agent", tools=[duckduckgo]) | ||
agent.start("I want to go London next week, find me a good hotel and flight") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from praisonaiagents import Agent, Tools | ||
from praisonaiagents.tools import execute_code, analyze_code, format_code, lint_code, disassemble_code # Code Tools | ||
from praisonaiagents.tools import execute_command, list_processes, kill_process, get_system_info # Shell Tools | ||
from praisonaiagents.tools import duckduckgo # Web Search Tool | ||
|
||
agent = Agent( | ||
instructions="You are a Programming Agent", self_reflect=True, min_reflect=5, max_reflect=10, | ||
tools=[execute_code, analyze_code, format_code, lint_code, disassemble_code, execute_command, list_processes, kill_process, get_system_info, duckduckgo] | ||
) | ||
agent.start( | ||
"Write a python script using yfinance to find the stock price of Tesla" | ||
"First check if required packages are installed" | ||
"Run it using execute_code" | ||
"execute_command if you want to run any terminal command" | ||
"search internet using duckduckgo if you want to know update python package information" | ||
"Analyse the output using analyze_code and fix error if required" | ||
"if no package is installed, install it" | ||
"then run the code" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from praisonaiagents import Agent, Tools | ||
from praisonaiagents.tools import duckduckgo | ||
|
||
agent = Agent(instructions="You are a Recommendation Agent", tools=[duckduckgo]) | ||
agent.start("Recommend me a good movie to watch in 2025") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from praisonaiagents import Agent, Tools | ||
from praisonaiagents.tools import duckduckgo | ||
|
||
agent = Agent(instructions="You are a Research Agent", tools=[duckduckgo]) | ||
agent.start("Research about AI 2024") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from praisonaiagents import Agent, Tools | ||
from praisonaiagents.tools import duckduckgo | ||
|
||
agent = Agent(instructions="You are a Shopping Agent", tools=[duckduckgo]) | ||
agent.start("I want to buy iPhone 16 Pro Max, check 5 stores and give me price in table") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from praisonaiagents import Agent | ||
|
||
agent = Agent(instructions="You are a Markdown Agent, output in markdown format") | ||
agent.start("Write a blog post about AI") |
Oops, something went wrong.